Class that represents a camera on the scene.
More...
#include <OsirisSDK/OCamera.h>
Class that represents a camera on the scene.
| OCamera::OCamera |
( |
float |
fieldOfViewDeg = 45.0f, |
|
|
float |
aspectRatio = 4.0f / 3, |
|
|
float |
zNear = 1.0f, |
|
|
float |
zFar = 5.0f, |
|
|
const OVector3 & |
pos = OVector3(0.0f , 0.0f, -1.0f), |
|
|
const OVector3 & |
or = OVector3(0.0f) |
|
) |
| |
Class constructor.
The constructor takes in all the attributes of the scene camera.
- 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. |
| pos | Camera position. |
| or | Camera orientation vector containing Euler angles: rotations around axes x, y and z. The camera always faces the positive z-axis direction from it's perspective. |
| float OCamera::aspectRatio |
( |
| ) |
const |
Returns screen aspect ratio.
- Returns
- Screen aspect ratio (width/height)
| void OCamera::changePosition |
( |
const OVector3 & |
displacement | ) |
|
Change camera position using a displacement vector.
- Parameters
-
| displacement | Displacement vector. |
| float OCamera::fieldOfViewDegrees |
( |
| ) |
const |
Returns the camera field of view.
- Returns
- Field of view in degrees.
Retrieves the camera orientation from the state object.
- Returns
- Camera orientation vector in terms of Euler angles.
Retrieves the camera position from the state object.
- Returns
- Camera position coordinates.
| void OCamera::setCameraLimits |
( |
float |
zNear, |
|
|
float |
zFar |
|
) |
| |
Sets camera depth limits.
- Parameters
-
| zNear | Nearest camera depth. |
| zFar | Farthest camera depth. |
| void OCamera::setFieldOfView |
( |
float |
valueDeg | ) |
|
Sets the camera field of view.
- Parameters
-
| valueDeg | Field of view in degrees. |
| void OCamera::setOrientation |
( |
const OVector3 & |
orientation | ) |
|
Set camera orientation.
- Parameters
-
| orientation | New orientation vector given in Euler angles. |
| void OCamera::setPosition |
( |
const OVector3 & |
position | ) |
|
Set camera position.
- Parameters
-
| position | Camera position coordinates. |
Calculates the perspective and camera transformations.
- Returns
- Matrix stack containing the transformation matrix.
The documentation for this class was generated from the following files: