Public Member Functions | Private Member Functions | Private Attributes
LeapUtil::Camera Class Reference

#include <LeapUtil.h>

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

List of all members.

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
const Leap::VectorGetPosition () const
 position of the camera in world space
const Leap::MatrixGetPOV () const
 POV is the world space location and orientation of the camera.
Leap::Matrix GetRotation () const
 orientation of the camera in world space
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
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.
void Rotate (const Leap::Matrix &mtxRotation)
 apply the specified rotation to the camera on top of its current rotation
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
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
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

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.

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.

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.

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 ( ) [inline, private]

Definition at line 404 of file LeapUtil.h.


Member Data Documentation

Definition at line 423 of file LeapUtil.h.

Definition at line 421 of file LeapUtil.h.

Definition at line 419 of file LeapUtil.h.

Definition at line 420 of file LeapUtil.h.

Definition at line 418 of file LeapUtil.h.

Definition at line 422 of file LeapUtil.h.

Definition at line 415 of file LeapUtil.h.

Definition at line 416 of file LeapUtil.h.

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 Sat Jun 8 2019 18:47:25