CCameraState Class Reference

Implementation of the ICameraState interface. More...

Inheritance diagram for CCameraState:

ICameraState

List of all members.

Public Member Functions

 CCameraState (void)
 Constructs a CCameraState object.
void resetCamera (void)
 Reset camera to initial position and angles.
void setFovY (float fovY)
 Set the vertical field-of-view in degree.
void setProjectionMode (projMode_e mode)
 Set the projection mode.
void setCameraRotation (const mat4_t &matrix)
 Sets the camera rotation matrix.
void getCameraRotation (mat4_t &matrix)
 Get the camera rotation matrix.
void setCameraTranslation (const vec3_t &t)
 Sets the new camera translation vector.
void getCameraTranslation (vec3_t &t)
 Get the current camera translation vector.
void applyProjectionMatrix (float worldRadius)
 Multiplies the camera's projection matrix to the current GL_PROJECTION matrix.
void applyModelViewMatrix (void)
 Multiplies the camera's transformation to the current GL_MODELVIEW matrix.
void getModelViewMatrix (mat4_t &matrix)
 Returns the camera transformation as a model view matrix.


Detailed Description

Implementation of the ICameraState interface.

Constructor & Destructor Documentation

CCameraState::CCameraState ( void   ) 

Constructs a CCameraState object.

The constructed object is ready to use.


Member Function Documentation

void CCameraState::resetCamera ( void   )  [virtual]

Reset camera to initial position and angles.

Does not change the projection mode

Implements ICameraState.

void CCameraState::setFovY ( float  fovY  )  [inline, virtual]

Set the vertical field-of-view in degree.

The value can range from >0 degree up to < 180 degree. If the value is outside this range, it is set to 50. The horizontal fov depends on the width/height aspect of the viewport, where fovX = ( width / height ) * fovY. The default value is 50.

Parameters:
fovY Vertical field-of-view in degree.

Implements ICameraState.

void CCameraState::setProjectionMode ( projMode_e  mode  )  [virtual]

Set the projection mode.

The default is PROJECT_FRUSTUM.

Parameters:
mode Projection mode.

Implements ICameraState.

void CCameraState::setCameraRotation ( const mat4_t matrix  )  [inline, virtual]

Sets the camera rotation matrix.

The matrix is 4x4 and all matrix elements are used. The matrix is strored in column major order.

Parameters:
matrix The rotation matrix
Precondition:
Assumes the matrix is a rotation matrix. If this is not the case, results are undefined.

Implements ICameraState.

void CCameraState::getCameraRotation ( mat4_t matrix  )  [inline, virtual]

Get the camera rotation matrix.

The matrix is 4x4 and all elements are used.

Parameters:
matrix The rotation maxtrix buffer.

Implements ICameraState.

void CCameraState::setCameraTranslation ( const vec3_t t  )  [inline, virtual]

Sets the new camera translation vector.

This translation is applied after the camera was rotated.

Parameters:
t Translation vector.

Implements ICameraState.

void CCameraState::getCameraTranslation ( vec3_t t  )  [inline, virtual]

Get the current camera translation vector.

Parameters:
t The translation vector will be stored there.

Implements ICameraState.

void CCameraState::applyProjectionMatrix ( float  worldRadius  ) 

Multiplies the camera's projection matrix to the current GL_PROJECTION matrix.

The resulting matrix is P1 = P0 * M.

Parameters:
worldRadius Bounding radius of the wolrd's geometry. Must be greater than zero.

void CCameraState::applyModelViewMatrix ( void   ) 

Multiplies the camera's transformation to the current GL_MODELVIEW matrix.

The resulting matrix is P1 = P0 * M.

void CCameraState::getModelViewMatrix ( mat4_t matrix  ) 

Returns the camera transformation as a model view matrix.

Parameters:
matrix Pointer to a 16 element float array representing a 4x4 column major order matrix. The requested matrix will be strored in this buffer.

... then translate


The documentation for this class was generated from the following file:
Generated on Sun Mar 2 17:12:32 2008 for Shader Maker by  doxygen 1.5.4