Public Member Functions | Private Member Functions | Private Attributes | List of all members
LeapUtil::Camera Class Reference

#include <LeapUtil.h>

Inheritance diagram for LeapUtil::Camera:
Inheritance graph
[legend]

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::VectorGetOrbitTarget () const
 the point of interest for the camera to orbit around More...
 
const Leap::VectorGetPosition () const
 position of the camera in world space More...
 
const Leap::MatrixGetPOV () 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
 

Detailed Description

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.

Constructor & Destructor Documentation

LeapUtil::Camera::Camera ( )
inline

Definition at line 274 of file LeapUtil.h.

Member Function Documentation

float LeapUtil::Camera::CalcViewDepth ( const Leap::Vector vPos) const
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.

float LeapUtil::Camera::GetAspectRatio ( ) const
inline

Definition at line 399 of file LeapUtil.h.

float LeapUtil::Camera::GetFarClip ( ) const
inline

Definition at line 383 of file LeapUtil.h.

float LeapUtil::Camera::GetMaxOrbitLatitude ( ) const
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.

float LeapUtil::Camera::GetNearClip ( ) const
inline

Definition at line 381 of file LeapUtil.h.

const Leap::Vector& LeapUtil::Camera::GetOrbitTarget ( ) const
inline

the point of interest for the camera to orbit around

Definition at line 336 of file LeapUtil.h.

const Leap::Vector& LeapUtil::Camera::GetPosition ( ) const
inline

position of the camera in world space

Definition at line 293 of file LeapUtil.h.

const Leap::Matrix& LeapUtil::Camera::GetPOV ( ) const
inline

POV is the world space location and orientation of the camera.

Definition at line 284 of file LeapUtil.h.

Leap::Matrix LeapUtil::Camera::GetRotation ( ) const
inline

orientation of the camera in world space

Definition at line 298 of file LeapUtil.h.

float LeapUtil::Camera::GetVerticalFOVDegrees ( ) const
inline

Definition at line 395 of file LeapUtil.h.

Leap::Matrix LeapUtil::Camera::GetView ( ) const
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.

void LeapUtil::Camera::Move ( const Leap::Vector vDeltaPos)
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.

void LeapUtil::Camera::Rotate ( const Leap::Matrix mtxRotation)
inline

apply the specified rotation to the camera on top of its current rotation

Definition at line 325 of file LeapUtil.h.

void LeapUtil::Camera::Rotate ( const Leap::Vector vAxis,
float  fRadians 
)
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.

void LeapUtil::Camera::SetAspectRatio ( float  fAspectRatio)
inline

Definition at line 401 of file LeapUtil.h.

void LeapUtil::Camera::SetClipPlanes ( float  fNearClip,
float  fFarClip 
)
inline

Definition at line 389 of file LeapUtil.h.

void LeapUtil::Camera::SetFarClip ( float  fFarClip)
inline

Definition at line 387 of file LeapUtil.h.

void LeapUtil::Camera::SetMaxOrbitLatitude ( float  fMaxOrbitLatitude)
inline

Definition at line 361 of file LeapUtil.h.

void LeapUtil::Camera::SetNearClip ( float  fNearClip)
inline

Definition at line 385 of file LeapUtil.h.

void LeapUtil::Camera::SetOrbitTarget ( const Leap::Vector vOrbitTarget)
inline

Definition at line 341 of file LeapUtil.h.

void LeapUtil::Camera::SetPosition ( const Leap::Vector vPos)
inline

Definition at line 295 of file LeapUtil.h.

void LeapUtil::Camera::SetPOV ( const Leap::Matrix mtxPOV)
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.

void LeapUtil::Camera::SetRotation ( const Leap::Vector vAxis,
float  fRadians 
)
inline

Definition at line 300 of file LeapUtil.h.

void LeapUtil::Camera::SetRotation ( const Leap::Matrix mtxRot)
inline

Definition at line 302 of file LeapUtil.h.

void LeapUtil::Camera::SetRotationLookAt ( const Leap::Vector vTarget,
const Leap::Vector vUp = Leap::Vector::yAxis() 
)
inline

maintains the current camera position and turns it to look at the specified target position

Definition at line 313 of file LeapUtil.h.

void LeapUtil::Camera::SetVerticalFOVDegrees ( float  fFOV)
inline

Definition at line 397 of file LeapUtil.h.

void LeapUtil::Camera::updateOrbitDistance ( )
inlineprivate

Definition at line 404 of file LeapUtil.h.

Member Data Documentation

float LeapUtil::Camera::m_fAspectRatio
private

Definition at line 423 of file LeapUtil.h.

float LeapUtil::Camera::m_fFarClip
private

Definition at line 421 of file LeapUtil.h.

float LeapUtil::Camera::m_fMaxOrbitLatitude
private

Definition at line 419 of file LeapUtil.h.

float LeapUtil::Camera::m_fNearClip
private

Definition at line 420 of file LeapUtil.h.

float LeapUtil::Camera::m_fOrbitDistance
private

Definition at line 418 of file LeapUtil.h.

float LeapUtil::Camera::m_fVerticalFOVDegrees
private

Definition at line 422 of file LeapUtil.h.

Leap::Matrix LeapUtil::Camera::m_mtxPOV
private

Definition at line 415 of file LeapUtil.h.

Leap::Vector LeapUtil::Camera::m_vLastMousePos
private

Definition at line 416 of file LeapUtil.h.

Leap::Vector LeapUtil::Camera::m_vOrbitTarget
private

Definition at line 417 of file LeapUtil.h.


The documentation for this class was generated from the following files:


leap_motion
Author(s): Florian Lier , Mirza Shah , Isaac IY Saito
autogenerated on Tue Jun 2 2020 03:58:01