#include <sgCamera.h>
Public Member Functions | |
sgCamera (sgCamera *p, sgCamera *n) | |
sgCamera * | createCamera () |
sgVector3 | projectDir (sgVector3 dir) |
void | destroy () |
void | destroyAll () |
void | updateProj () |
void | updateView () |
Public Attributes | |
float | arc |
float | aspect |
float | clipnear |
float | clipfar |
sgVector3 | position |
sgQuaternion | rotation |
sgMatrix4x4 | matproj |
sgMatrix4x4 | matview |
sgCamera * | prev |
sgCamera * | next |
Camera class. Responsible for camera handling.
Constructor. Creates a camera.
p | the previous camera in the linked camera list | |
n | the next camera in the linked camera list |
sgCamera * sgCamera::createCamera | ( | ) |
Create camera. Creates a new camera and makes it next of this.
void sgCamera::destroy | ( | ) |
Destroy. Destroys this camera.
void sgCamera::destroyAll | ( | ) |
Destroy All. Destroys this and all cameras connected to it.
Project direction. Transforms the vector with the camera transformation matrix.
void sgCamera::updateProj | ( | ) |
Update projection. Updates this cameras projection matrix. This function has to be called after making changes to arc, aspect or the far and near clipping planes.
void sgCamera::updateView | ( | ) |
Update view. Updates this cameras view transformation matrix. This function is called automatically before rendering.
float sgCamera::arc |
Arc. The cameras field of view.
float sgCamera::aspect |
Aspect ratio. The cameras aspect ratio.
float sgCamera::clipfar |
Far clipping plane dist. The distance of the far clipping plane of this camera.
float sgCamera::clipnear |
Near clipping plane dist. The distance of the near clipping plane of this camera.
Camera window size. The size of the window the camera is rendered into. Camera window position. The position the cameras window is rendered at. Projection matrix. The transformation matrix for this cameras projection.
View matrix. The transformation matrix of this camera.
Next. Pointer to the next camera within the cameras list or NULL if there is none.
Position. The position of the camera.
Previous. Pointer to the previous camera within the cameras list or NULL if there is none.
Rotation. The rotation of the camera as quaternion.