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. |
CCameraState::CCameraState | ( | void | ) |
Constructs a CCameraState object.
The constructed object is ready to use.
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.
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.
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.
matrix | The rotation matrix |
Implements ICameraState.
void CCameraState::getCameraRotation | ( | mat4_t & | matrix | ) | [inline, virtual] |
Get the camera rotation matrix.
The matrix is 4x4 and all elements are used.
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.
t | Translation vector. |
Implements ICameraState.
void CCameraState::getCameraTranslation | ( | vec3_t & | t | ) | [inline, virtual] |
Get the current camera translation vector.
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.
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.
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