Matrix stack class.
More...
#include <OsirisSDK/OMatrixStack.h>
|
| OMatrixStack () |
| Class constructor.
|
|
virtual | ~OMatrixStack () |
| Class destructor.
|
|
void | push () |
| Pushes the current matrix on the stack.
|
|
void | pop () |
| Discards the matrix on top of the stack, and brings up the next one.
|
|
OMatrix4x4 | top () const |
| Retrieves the current (top) matrix.
|
|
void | translate (const OVector3 &dir) |
| Applies the translation transformation to a given direction. More...
|
|
void | translate (const float &dx, const float &dy, const float &dz) |
| Applies the translation transform to a given direction. More...
|
|
void | rotate (const OVector3 &axis, const float &angle) |
| Applies the rotation transformation around a given axis. More...
|
|
void | rotate (const float &axisX, const float &axisY, const float &axisZ, const float &angle) |
| Applies the rotation transformation around a given axis. More...
|
|
void | rotateX (const float &angle) |
| Applies the rotation transformation around the X axis. More...
|
|
void | rotateY (const float &angle) |
| Applies the rotation transformation around the Y axis. More...
|
|
void | rotateZ (const float &angle) |
| Applies the rotation transformation around the Z axis. More...
|
|
void | scale (const OVector3 &factorVec) |
| Applies the scale transformation, which re-scales the coordinate system by given factors in each component axis. More...
|
|
void | scale (const float &uniformFactor) |
| Applies the scale transformation by a uniform parameter for all space axes. More...
|
|
void | perspective (float fieldOfViewDeg, float aspectRatio, float zNear, float zFar) |
| Applies the perspective projection transformation. More...
|
|
void | camera (const OVector3 &position, const OVector3 &direction, const OVector3 &up=OVector3(0, 1, 0)) |
| Applies the camera transformation, moving the coordinate system to account for the current camera position and looking direction. More...
|
|
Matrix stack class.
This class represents a stack of matrices, useful for handling coordinate system transformations on multiple levels. There is a top matrix on the stack, where transformations can be applied. When the need comes to preserve the top matrix, it can be pushed onto the stack, so it can be retrieved at a later time by using the pop() method.
Applies the camera transformation, moving the coordinate system to account for the current camera position and looking direction.
- Parameters
-
position | Current camera position coordinates. |
direction | Camera looking direction vector. |
up | Vertical reference vector (direction when the camera is facing "up"). |
void OMatrixStack::perspective |
( |
float |
fieldOfViewDeg, |
|
|
float |
aspectRatio, |
|
|
float |
zNear, |
|
|
float |
zFar |
|
) |
| |
Applies the perspective projection transformation.
- Parameters
-
fieldOfViewDeg | Angle of the camera's field of view in degrees. |
aspectRatio | The aspect ration of the screen (width/height). |
zNear | Nearest camera depth. |
zFar | Farthest camera depth. |
void OMatrixStack::rotate |
( |
const OVector3 & |
axis, |
|
|
const float & |
angle |
|
) |
| |
Applies the rotation transformation around a given axis.
- Parameters
-
axis | Rotation axis vector. |
angle | Rotation angle in degrees. |
void OMatrixStack::rotate |
( |
const float & |
axisX, |
|
|
const float & |
axisY, |
|
|
const float & |
axisZ, |
|
|
const float & |
angle |
|
) |
| |
Applies the rotation transformation around a given axis.
- Parameters
-
axisX | Rotation axis vector component on the X axis. |
axisY | Rotation axis vector component on the Y axis. |
axisZ | Rotation axis vector component on the Z axis. |
angle | Rotation angle in degrees. |
void OMatrixStack::rotateX |
( |
const float & |
angle | ) |
|
Applies the rotation transformation around the X axis.
- Parameters
-
angle | Rotation angle in degrees. |
void OMatrixStack::rotateY |
( |
const float & |
angle | ) |
|
Applies the rotation transformation around the Y axis.
- Parameters
-
angle | Rotation angle in degrees. |
void OMatrixStack::rotateZ |
( |
const float & |
angle | ) |
|
Applies the rotation transformation around the Z axis.
- Parameters
-
angle | Rotation angle in degrees. |
void OMatrixStack::scale |
( |
const OVector3 & |
factorVec | ) |
|
Applies the scale transformation, which re-scales the coordinate system by given factors in each component axis.
- Parameters
-
factorVec | Scale factors for each axis component. |
void OMatrixStack::scale |
( |
const float & |
uniformFactor | ) |
|
Applies the scale transformation by a uniform parameter for all space axes.
- Parameters
-
uniformFactor | Scale factor for all space axes. |
void OMatrixStack::translate |
( |
const OVector3 & |
dir | ) |
|
Applies the translation transformation to a given direction.
- Parameters
-
dir | Displacement direction vector. |
void OMatrixStack::translate |
( |
const float & |
dx, |
|
|
const float & |
dy, |
|
|
const float & |
dz |
|
) |
| |
Applies the translation transform to a given direction.
- Parameters
-
dx | Displacement direction on the X axis. |
dy | Displacement direction on the Y axis. |
dz | Displacement direction on the Z axis. |
The documentation for this class was generated from the following files: