#include <PropaneCamera.h>
Public Member Functions | |
| float * | getMatrix () |
| Return the 4x4 matrix that this camera represents. | |
| float * | getInverseMatrix () |
| Get inverse matrix of quaternion Get the "inverse" matrix of the quaternion, which you can use to do things like get the forward vector and a lot of screen space manipulations. | |
| void | setPerspective () |
| Tell OpenGL to set our view on the world, using getMatrix. It will apply any pitch/heading/roll changes you have made to the aggregate quaternion, and then reset the 'temporary' variables used. | |
| Vector3 | getForwardVector () |
| Get the forward vector of the camera. | |
| float | changePitch (float angle) |
| Change the pitch ("nodding" rotation"). | |
| float | changeYaw (float angle) |
| Change the yaw ("shaking your head" rotation). | |
| float | changeRoll (float angle) |
| Change the roll ("barrel roll" rotation). | |
| void | reset () |
| Reset temporary yaw/pitch/roll. | |
| Camera () | |
| Default constructor. | |
| Quaternion | getAggregate () const |
| Get the aggregate quaternion. | |
| void | setPosition (const Vector3 &newPosition) |
| Reset the position of the camera. | |
| void | moveForward (float magnitude) |
| Move the camera "forward" by a set amount. | |
This is vaguely based on the Quaternion camera from NeHe, except mine works.
|
|
Default constructor. It will set the yaw, pitch and roll to 0, and the camera's position to (0,0,0). |
|
|
Change the pitch ("nodding" rotation"). The camera will not update the internal quaternion until you call setPerspective or getForwardVector.
|
|
|
Change the roll ("barrel roll" rotation). The camera will not update the internal quaternion until you call setPerspective or getForwardVector.
|
|
|
Change the yaw ("shaking your head" rotation). The camera will not update the internal quaternion until you call setPerspective or getForwardVector.
|
|
|
Get the aggregate quaternion. You can use the aggregate quaternion for quaternion math, or for saving and reloading later.
|
|
|
Get the forward vector of the camera. This is the vector the camera is pointing in the general direction of; you can use this to "move in the direction" you are looking by adding it to your position. See moveForward for a method that handles this automatically. It will apply any pitch/roll/heading changes and reset the related temporary variables.
|
|
|
Get inverse matrix of quaternion Get the "inverse" matrix of the quaternion, which you can use to do things like get the forward vector and a lot of screen space manipulations.
|
|
|
Return the 4x4 matrix that this camera represents.
|
|
|
Move the camera "forward" by a set amount.
|
|
|
Reset temporary yaw/pitch/roll. setPerspective and getForwardVector call this method automatically, so it is provided as a convenience. It will reset the temporary yaw, pitch and roll variables. |
|
|
Tell OpenGL to set our view on the world, using getMatrix. It will apply any pitch/heading/roll changes you have made to the aggregate quaternion, and then reset the 'temporary' variables used. It will then multiply the matrix represented by the quaternion into the current OpenGL state, and apply the translation indicated by the camera's position vector.
|
|
|
Reset the position of the camera.
|
1.4.6