MinVR  0.9.0
A multi-platform virtual reality library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MinVR::CameraOffAxis Class Reference
Inheritance diagram for MinVR::CameraOffAxis:
MinVR::AbstractCamera

Public Member Functions

 CameraOffAxis (glm::vec3 topLeft, glm::vec3 topRight, glm::vec3 botLeft, glm::vec3 botRight, glm::mat4 initialHeadFrame, double interOcularDistance, double nearClipDist, double farClipDist)
 
virtual ~CameraOffAxis ()
 
virtual void updateHeadTrackingFrame (glm::mat4 newHeadFrame)
 Updates the camera's current head position. More...
 
virtual void applyProjectionAndCameraMatrices ()
 Sets the openGL matrices. More...
 
virtual void applyProjectionAndCameraMatricesForLeftEye ()
 Sets the openGL matrices. More...
 
virtual void applyProjectionAndCameraMatricesForRightEye ()
 Sets the openGL matrices. More...
 
virtual void setObjectToWorldMatrix (glm::mat4 obj2World)
 Sets the object to world matrix. More...
 
glm::mat4 getLeftEyeFrame ()
 Gets the current location of the left eye. More...
 
glm::mat4 getRightEyeFrame ()
 Gets the current location of the right eye. More...
 
- Public Member Functions inherited from MinVR::AbstractCamera
 AbstractCamera ()
 
virtual ~AbstractCamera ()
 

Protected Member Functions

virtual void applyProjectionAndCameraMatrices (const glm::mat4 &projectionMat, const glm::mat4 &viewMat)
 
glm::mat4 invertYMat ()
 
glm::mat4 perspectiveProjection (double left, double right, double bottom, double top, double nearval, double farval, float upDirection=-1.0)
 

Protected Attributes

glm::vec3 _topLeft
 
glm::vec3 _topRight
 
glm::vec3 _botLeft
 
glm::vec3 _botRight
 
glm::mat4 _headFrame
 
double _iod
 
double _nearClip
 
double _farClip
 
double _halfWidth
 
double _halfHeight
 
glm::mat4 _room2tile
 
glm::mat4 _projection
 
glm::mat4 _projectionLeft
 
glm::mat4 _projectionRight
 
glm::mat4 _view
 
glm::mat4 _viewLeft
 
glm::mat4 _viewRight
 
glm::mat4 _object2World
 
glm::mat4 _currentViewMatrix
 

Detailed Description

An offaxis VR camera

This derived class represents an offaxis view frustrum. It should be used head tracking in front of a flat display tile or in a VR CAVE.

Constructor & Destructor Documentation

MinVR::CameraOffAxis::CameraOffAxis ( glm::vec3  topLeft,
glm::vec3  topRight,
glm::vec3  botLeft,
glm::vec3  botRight,
glm::mat4  initialHeadFrame,
double  interOcularDistance,
double  nearClipDist,
double  farClipDist 
)
virtual MinVR::CameraOffAxis::~CameraOffAxis ( )
virtual

Member Function Documentation

virtual void MinVR::CameraOffAxis::applyProjectionAndCameraMatrices ( )
virtual

This method sets the openGL projection and modelview matrices as if the camera is centered between the eyes. This is used for mono rendering.

Implements MinVR::AbstractCamera.

virtual void MinVR::CameraOffAxis::applyProjectionAndCameraMatrices ( const glm::mat4 &  projectionMat,
const glm::mat4 &  viewMat 
)
protectedvirtual
virtual void MinVR::CameraOffAxis::applyProjectionAndCameraMatricesForLeftEye ( )
virtual

This method sets the openGL projection and modelview matrices as if the camera is located at the left eye. This is used for stereoscopic rendering.

Implements MinVR::AbstractCamera.

virtual void MinVR::CameraOffAxis::applyProjectionAndCameraMatricesForRightEye ( )
virtual

This method sets the openGL projection and modelview matrices as if the camera is located at the right eye. This is used for stereoscopic rendering.

Implements MinVR::AbstractCamera.

glm::mat4 MinVR::CameraOffAxis::getLeftEyeFrame ( )

Based on the current head position and interocular distance, this returns the left eye position

Returns
A coordinate frame representing the translation and rotation for the left eye position.
glm::mat4 MinVR::CameraOffAxis::getRightEyeFrame ( )

Based on the current head position and interocular distance, this returns the right eye position

Returns
A coordinate frame representing the translation and rotation for the right eye position.
glm::mat4 MinVR::CameraOffAxis::invertYMat ( )
protected
glm::mat4 MinVR::CameraOffAxis::perspectiveProjection ( double  left,
double  right,
double  bottom,
double  top,
double  nearval,
double  farval,
float  upDirection = -1.0 
)
protected
virtual void MinVR::CameraOffAxis::setObjectToWorldMatrix ( glm::mat4  obj2World)
virtual

This method sets the transformation between the current object (model) space and world (room) coordinate system. It is used when setting the opengl modelview matrix.

Implements MinVR::AbstractCamera.

virtual void MinVR::CameraOffAxis::updateHeadTrackingFrame ( glm::mat4  newHeadFrame)
virtual

This method is called by the MVREngine to update the current head position. It also recalculates the current offaxis projection matrix based on the head position and modelview matrix.

Parameters
[in]Thenew head position.

Implements MinVR::AbstractCamera.

Member Data Documentation

glm::vec3 MinVR::CameraOffAxis::_botLeft
protected
glm::vec3 MinVR::CameraOffAxis::_botRight
protected
glm::mat4 MinVR::CameraOffAxis::_currentViewMatrix
protected
double MinVR::CameraOffAxis::_farClip
protected
double MinVR::CameraOffAxis::_halfHeight
protected
double MinVR::CameraOffAxis::_halfWidth
protected
glm::mat4 MinVR::CameraOffAxis::_headFrame
protected
double MinVR::CameraOffAxis::_iod
protected
double MinVR::CameraOffAxis::_nearClip
protected
glm::mat4 MinVR::CameraOffAxis::_object2World
protected
glm::mat4 MinVR::CameraOffAxis::_projection
protected
glm::mat4 MinVR::CameraOffAxis::_projectionLeft
protected
glm::mat4 MinVR::CameraOffAxis::_projectionRight
protected
glm::mat4 MinVR::CameraOffAxis::_room2tile
protected
glm::vec3 MinVR::CameraOffAxis::_topLeft
protected
glm::vec3 MinVR::CameraOffAxis::_topRight
protected
glm::mat4 MinVR::CameraOffAxis::_view
protected
glm::mat4 MinVR::CameraOffAxis::_viewLeft
protected
glm::mat4 MinVR::CameraOffAxis::_viewRight
protected

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