#include <LeapUtil.h>
Public Member Functions | |
float | CalcViewDepth (const Leap::Vector &vPos) const |
Camera () | |
float | GetAspectRatio () const |
float | GetFarClip () const |
float | GetMaxOrbitLatitude () const |
float | GetNearClip () const |
const Leap::Vector & | GetOrbitTarget () const |
the point of interest for the camera to orbit around More... | |
const Leap::Vector & | GetPosition () const |
position of the camera in world space More... | |
const Leap::Matrix & | GetPOV () const |
POV is the world space location and orientation of the camera. More... | |
Leap::Matrix | GetRotation () const |
orientation of the camera in world space More... | |
float | GetVerticalFOVDegrees () const |
Leap::Matrix | GetView () const |
void | Move (const Leap::Vector &vDeltaPos) |
translate the position of the camera (move it from its current position) by the specified offset More... | |
void | OnMouseDown (const Leap::Vector &vMousePos) |
void | OnMouseMoveOrbit (const Leap::Vector &vMousePos) |
void | OnMouseWheel (float fDeltaZ) |
convenience methods for mapping mouse movements to orbit camera movements. More... | |
void | Rotate (const Leap::Matrix &mtxRotation) |
apply the specified rotation to the camera on top of its current rotation More... | |
void | Rotate (const Leap::Vector &vAxis, float fRadians) |
void | RotateOrbit (float fDeltaMagnitude, float fDeltaLongitude, float fDeltaLatitude) |
void | SetAspectRatio (float fAspectRatio) |
void | SetClipPlanes (float fNearClip, float fFarClip) |
void | SetFarClip (float fFarClip) |
void | SetMaxOrbitLatitude (float fMaxOrbitLatitude) |
void | SetNearClip (float fNearClip) |
void | SetOrbitTarget (const Leap::Vector &vOrbitTarget) |
void | SetPosition (const Leap::Vector &vPos) |
void | SetPOV (const Leap::Matrix &mtxPOV) |
void | SetPOVLookAt (const Leap::Vector &vCameraPosition, const Leap::Vector &vTarget, Leap::Vector vUp=Leap::Vector::yAxis()) |
places the camera a the given position with it pointing towards the specified target position More... | |
void | SetRotation (const Leap::Vector &vAxis, float fRadians) |
void | SetRotation (const Leap::Matrix &mtxRot) |
void | SetRotationLookAt (const Leap::Vector &vTarget, const Leap::Vector &vUp=Leap::Vector::yAxis()) |
maintains the current camera position and turns it to look at the specified target position More... | |
void | SetVerticalFOVDegrees (float fFOV) |
Private Member Functions | |
void | updateOrbitDistance () |
Private Attributes | |
float | m_fAspectRatio |
float | m_fFarClip |
float | m_fMaxOrbitLatitude |
float | m_fNearClip |
float | m_fOrbitDistance |
float | m_fVerticalFOVDegrees |
Leap::Matrix | m_mtxPOV |
Leap::Vector | m_vLastMousePos |
Leap::Vector | m_vOrbitTarget |
a graphics system agnostic camera that provides a point of view and a view matrix as well as utility methods for moving the point of view around in useful ways. field of view, aspect ratio and clipping planes are stored but not handled directly by this class. no projection matrix created - the stored values can be used to generate the proper projection matrix on whatever graphics system is used. this class can also be sub-classed to suit a particular graphics system. convention is right hand rule with z- forward, y+ up, x+ right
Definition at line 271 of file LeapUtil.h.
|
inline |
Definition at line 274 of file LeapUtil.h.
|
inline |
returns how far a world space point is down the line of sight of the camera. negative values are behind the camera.
Definition at line 368 of file LeapUtil.h.
|
inline |
Definition at line 399 of file LeapUtil.h.
|
inline |
Definition at line 383 of file LeapUtil.h.
|
inline |
the maximum vertical angle in radians that the camera can ascend/descend to during orbit movement. default is 3/4 of a right angle.
Definition at line 356 of file LeapUtil.h.
|
inline |
Definition at line 381 of file LeapUtil.h.
|
inline |
the point of interest for the camera to orbit around
Definition at line 336 of file LeapUtil.h.
|
inline |
position of the camera in world space
Definition at line 293 of file LeapUtil.h.
|
inline |
POV is the world space location and orientation of the camera.
Definition at line 284 of file LeapUtil.h.
|
inline |
orientation of the camera in world space
Definition at line 298 of file LeapUtil.h.
|
inline |
Definition at line 395 of file LeapUtil.h.
|
inline |
View is the world space to camera space transform. Useful for setting the view matrix in your rendering pipeline.
Definition at line 290 of file LeapUtil.h.
|
inline |
translate the position of the camera (move it from its current position) by the specified offset
Definition at line 319 of file LeapUtil.h.
void LeapUtil::Camera::OnMouseDown | ( | const Leap::Vector & | vMousePos | ) |
Definition at line 79 of file LeapUtil.cpp.
void LeapUtil::Camera::OnMouseMoveOrbit | ( | const Leap::Vector & | vMousePos | ) |
Definition at line 85 of file LeapUtil.cpp.
void LeapUtil::Camera::OnMouseWheel | ( | float | fDeltaZ | ) |
convenience methods for mapping mouse movements to orbit camera movements.
Definition at line 71 of file LeapUtil.cpp.
|
inline |
apply the specified rotation to the camera on top of its current rotation
Definition at line 325 of file LeapUtil.h.
|
inline |
Definition at line 330 of file LeapUtil.h.
void LeapUtil::Camera::RotateOrbit | ( | float | fDeltaMagnitude, |
float | fDeltaLongitude, | ||
float | fDeltaLatitude | ||
) |
rotate the camera about its orbit target. the orbit position is on a sphere. fDeltaMagnitude changes the distance of the camera to the target fDeltaLongitude is in radians and changes the position of the camera around the left-right direction on the sphere fDeltaLatitude is in radians and changes the position of the camera around the up-down direction of the sphere
Definition at line 52 of file LeapUtil.cpp.
|
inline |
Definition at line 401 of file LeapUtil.h.
|
inline |
Definition at line 389 of file LeapUtil.h.
|
inline |
Definition at line 387 of file LeapUtil.h.
|
inline |
Definition at line 361 of file LeapUtil.h.
|
inline |
Definition at line 385 of file LeapUtil.h.
|
inline |
Definition at line 341 of file LeapUtil.h.
|
inline |
Definition at line 295 of file LeapUtil.h.
|
inline |
Definition at line 286 of file LeapUtil.h.
void LeapUtil::Camera::SetPOVLookAt | ( | const Leap::Vector & | vCameraPosition, |
const Leap::Vector & | vTarget, | ||
Leap::Vector | vUp = Leap::Vector::yAxis() |
||
) |
places the camera a the given position with it pointing towards the specified target position
Camera methods
Definition at line 18 of file LeapUtil.cpp.
|
inline |
Definition at line 300 of file LeapUtil.h.
|
inline |
Definition at line 302 of file LeapUtil.h.
|
inline |
maintains the current camera position and turns it to look at the specified target position
Definition at line 313 of file LeapUtil.h.
|
inline |
Definition at line 397 of file LeapUtil.h.
|
inlineprivate |
Definition at line 404 of file LeapUtil.h.
|
private |
Definition at line 423 of file LeapUtil.h.
|
private |
Definition at line 421 of file LeapUtil.h.
|
private |
Definition at line 419 of file LeapUtil.h.
|
private |
Definition at line 420 of file LeapUtil.h.
|
private |
Definition at line 418 of file LeapUtil.h.
|
private |
Definition at line 422 of file LeapUtil.h.
|
private |
Definition at line 415 of file LeapUtil.h.
|
private |
Definition at line 416 of file LeapUtil.h.
|
private |
Definition at line 417 of file LeapUtil.h.