|
Basic Renderer
|
The camera object defines the view and projection matrices of a scene. More...
#include <Camera.h>
Public Member Functions | |
| Camera () | |
| Constructor loading standard values for position, orientation and projection. More... | |
| Camera (GLfloat fov, GLfloat aspect, GLfloat near, GLfloat far) | |
| Constructor loading standard values for position and orientation. More... | |
| Camera (const vmml::Vector3f &position, const vmml::Vector3f &rotationAxes) | |
| Constructor loading standard values for projection. More... | |
| Camera (const vmml::Vector3f &position, const vmml::Vector3f &rotationAxes, GLfloat fov, GLfloat aspect, GLfloat near, GLfloat far) | |
| Constructor. More... | |
| virtual | ~Camera () |
| Virtual destructor. More... | |
| virtual void | moveCameraForward (GLfloat camSpeed) |
| Moves the camera forward with a certain speed (based on previous position) More... | |
| virtual void | moveCameraSideward (GLfloat camSpeed) |
| Moves the camera to the right with a certain speed (based on previous position) More... | |
| virtual void | moveCameraUpward (GLfloat camSpeed) |
| Moves the camera upwards with a certain speed (based on previous position) More... | |
| virtual void | rotateCamera (GLfloat rotationX, GLfloat rotationY, GLfloat rotationZ) |
| Rotates the camera based on previous orientation. More... | |
| virtual void | resetCamera () |
| Resets camera to the default position orientation. More... | |
| void | setPosition (const vmml::Vector3f &position) |
| Sets the position of the camera. More... | |
| void | setRotation (const vmml::Vector3f &rotationAxes) |
| Sets the rotation matrix of the camera. More... | |
| void | setFieldOfView (GLfloat fov) |
| Sets field of view. More... | |
| void | setAspectRatio (GLfloat aspect) |
| Sets aspect ratio. More... | |
| void | setNearClippingPlane (GLfloat near) |
| Sets near clipping plane. More... | |
| void | setFarClippingPlane (GLfloat far) |
| Sets far clipping plane. More... | |
| virtual vmml::Matrix4f | getViewMatrix () |
| Returns the view matrix of the camera. More... | |
| virtual vmml::Matrix4f | getInverseViewMatrix () |
| Returns the inverse of the view matrix of the camera. More... | |
| virtual vmml::Matrix4f | getProjectionMatrix () |
| Returns the view projection of the camera. More... | |
| const vmml::Vector3f & | getPosition () |
| Returns the position of the camera. More... | |
| virtual vmml::Matrix4f | getRotation () |
| Returns the rotation matrix of the camera. More... | |
| virtual vmml::Matrix4f | getInverseRotation () |
| Returns the inverse of the rotation matrix of the camera. More... | |
| virtual vmml::Matrix4f | getInverseRotationX () |
| Returns the inverse of the x-axis of the rotation matrix. More... | |
| virtual vmml::Matrix4f | getInverseRotationY () |
| Returns the inverse of the y-axis of the rotation matrix. More... | |
| virtual vmml::Matrix4f | getInverseRotationZ () |
| Returns the inverse of the z-axis of the rotation matrix. More... | |
| virtual vmml::Vector3f | getForward () |
| Returns the orientation of the camera. More... | |
| virtual vmml::Vector3f | getRight () |
| Returns the right vector of the camera. More... | |
| virtual vmml::Vector3f | getUp () |
| Returns the up vector of the camera. More... | |
Static Public Member Functions | |
| static vmml::Matrix4f | lookAt (const vmml::Vector3f &eye, const vmml::Vector3f &target, const vmml::Vector3f &up) |
| Create a simple look at matrix. More... | |
| static vmml::Matrix4f | createPerspective (GLfloat fov, GLfloat aspect, GLfloat near, GLfloat far) |
| Create a 3D perspective. More... | |
The camera object defines the view and projection matrices of a scene.
| Camera::Camera | ( | ) |
Constructor loading standard values for position, orientation and projection.
| Camera::Camera | ( | GLfloat | fov, |
| GLfloat | aspect, | ||
| GLfloat | near, | ||
| GLfloat | far | ||
| ) |
Constructor loading standard values for position and orientation.
| [in] | fov | Field of view |
| [in] | aspect | Aspect ratio |
| [in] | near | Near clipping plane |
| [in] | far | Far clipping plane |
| Camera::Camera | ( | const vmml::Vector3f & | position, |
| const vmml::Vector3f & | rotationAxes | ||
| ) |
Constructor loading standard values for projection.
| [in] | position | Position of the camera |
| [in] | rotationAxes | Rotation axes of the camera |
| Camera::Camera | ( | const vmml::Vector3f & | position, |
| const vmml::Vector3f & | rotationAxes, | ||
| GLfloat | fov, | ||
| GLfloat | aspect, | ||
| GLfloat | near, | ||
| GLfloat | far | ||
| ) |
Constructor.
| [in] | position | Position of the camera |
| [in] | rotationAxes | Rotation axes of the camera |
| [in] | fov | Field of view |
| [in] | aspect | Aspect ratio |
| [in] | near | Near clipping plane |
| [in] | far | Far clipping plane |
|
inlinevirtual |
Virtual destructor.
|
static |
Create a 3D perspective.
| [in] | fov | Field of view |
| [in] | aspect | Aspect ratio |
| [in] | near | Near clipping plane |
| [in] | far | Far clipping plane |
|
virtual |
Returns the orientation of the camera.
|
virtual |
Returns the inverse of the rotation matrix of the camera.
The inverse view matrix may be useful to keep an object to face the camera (e.g. a sprite)
|
virtual |
Returns the inverse of the x-axis of the rotation matrix.
|
virtual |
Returns the inverse of the y-axis of the rotation matrix.
|
virtual |
Returns the inverse of the z-axis of the rotation matrix.
|
virtual |
Returns the inverse of the view matrix of the camera.
The inverse view matrix may be useful to keep an object at the cameras position
|
inline |
Returns the position of the camera.
|
virtual |
Returns the view projection of the camera.
|
virtual |
Returns the right vector of the camera.
|
virtual |
Returns the rotation matrix of the camera.
|
virtual |
Returns the up vector of the camera.
|
virtual |
Returns the view matrix of the camera.
|
static |
Create a simple look at matrix.
| [in] | eye | Specifies the position of the eye point |
| [in] | target | Specifies the position of the reference point |
| [in] | up | Specifies the direction of the up vector |
|
virtual |
Moves the camera forward with a certain speed (based on previous position)
| [in] | camSpeed | The velocity of the movement |
|
virtual |
Moves the camera to the right with a certain speed (based on previous position)
| [in] | camSpeed | The velocity of the movement |
|
virtual |
Moves the camera upwards with a certain speed (based on previous position)
| [in] | camSpeed | The velocity of the movement |
|
virtual |
Resets camera to the default position orientation.
|
virtual |
Rotates the camera based on previous orientation.
| [in] | rotationX | The rotation around the x axis in radians |
| [in] | rotationY | The rotation around the y axis in radians |
| [in] | rotationZ | The rotation around the z axis in radians |
|
inline |
Sets aspect ratio.
| [in] | aspect | Aspect ratio |
|
inline |
Sets far clipping plane.
| [in] | far | Far clipping plane |
|
inline |
Sets field of view.
| [in] | fov | Field of view |
|
inline |
Sets near clipping plane.
| [in] | near | Near clipping plane |
|
inline |
Sets the position of the camera.
| [in] | position | Position of the camera |
|
inline |
Sets the rotation matrix of the camera.
| [in] | rotationAxes | Rotation axes of the camera |