7 #include "vmmlib/vector.hpp"
8 #include "vmmlib/matrix.hpp"
9 #include "vmmlib/util.hpp"
30 Camera(GLfloat fov, GLfloat aspect, GLfloat near, GLfloat far);
36 Camera(
const vmml::Vector3f &position,
const vmml::Vector3f &rotationAxes);
46 Camera(
const vmml::Vector3f &position,
const vmml::Vector3f &rotationAxes, GLfloat fov, GLfloat aspect, GLfloat near, GLfloat far);
72 virtual void rotateCamera(GLfloat rotationX, GLfloat rotationY, GLfloat rotationZ);
81 void setPosition(
const vmml::Vector3f &position) { _position = position; }
86 void setRotation(
const vmml::Vector3f &rotationAxes) { _rotationAxes = rotationAxes; }
158 virtual vmml::Vector3f
getUp();
167 static vmml::Matrix4f
lookAt(
const vmml::Vector3f &eye,
const vmml::Vector3f &target,
const vmml::Vector3f &up);
175 static vmml::Matrix4f
createPerspective(GLfloat fov, GLfloat aspect, GLfloat near, GLfloat far);
181 vmml::Vector3f _position;
182 vmml::Vector3f _rotationAxes;
184 GLfloat _fov, _aspect, _near, _far;
virtual vmml::Vector3f getForward()
Returns the orientation of the camera.
Definition: Camera.cpp:99
virtual vmml::Matrix4f getInverseViewMatrix()
Returns the inverse of the view matrix of the camera.
Definition: Camera.cpp:57
void setRotation(const vmml::Vector3f &rotationAxes)
Sets the rotation matrix of the camera.
Definition: Camera.h:86
virtual vmml::Matrix4f getProjectionMatrix()
Returns the view projection of the camera.
Definition: Camera.cpp:61
std::shared_ptr< Camera > CameraPtr
Definition: Camera.h:187
virtual void moveCameraForward(GLfloat camSpeed)
Moves the camera forward with a certain speed (based on previous position)
Definition: Camera.cpp:25
virtual vmml::Vector3f getRight()
Returns the right vector of the camera.
Definition: Camera.cpp:105
void setFieldOfView(GLfloat fov)
Sets field of view.
Definition: Camera.h:91
void setNearClippingPlane(GLfloat near)
Sets near clipping plane.
Definition: Camera.h:101
The camera object defines the view and projection matrices of a scene.
Definition: Camera.h:14
virtual vmml::Matrix4f getInverseRotation()
Returns the inverse of the rotation matrix of the camera.
Definition: Camera.cpp:71
virtual vmml::Matrix4f getViewMatrix()
Returns the view matrix of the camera.
Definition: Camera.cpp:53
virtual void rotateCamera(GLfloat rotationX, GLfloat rotationY, GLfloat rotationZ)
Rotates the camera based on previous orientation.
Definition: Camera.cpp:40
void setFarClippingPlane(GLfloat far)
Sets far clipping plane.
Definition: Camera.h:106
static vmml::Matrix4f createPerspective(GLfloat fov, GLfloat aspect, GLfloat near, GLfloat far)
Create a 3D perspective.
Definition: Camera.cpp:133
virtual vmml::Matrix4f getRotation()
Returns the rotation matrix of the camera.
Definition: Camera.cpp:66
Camera()
Constructor loading standard values for position, orientation and projection.
Definition: Camera.cpp:7
static vmml::Matrix4f lookAt(const vmml::Vector3f &eye, const vmml::Vector3f &target, const vmml::Vector3f &up)
Create a simple look at matrix.
Definition: Camera.cpp:119
virtual vmml::Matrix4f getInverseRotationZ()
Returns the inverse of the z-axis of the rotation matrix.
Definition: Camera.cpp:92
virtual vmml::Matrix4f getInverseRotationX()
Returns the inverse of the x-axis of the rotation matrix.
Definition: Camera.cpp:78
const vmml::Vector3f & getPosition()
Returns the position of the camera.
Definition: Camera.h:124
virtual void resetCamera()
Resets camera to the default position orientation.
Definition: Camera.cpp:47
void setAspectRatio(GLfloat aspect)
Sets aspect ratio.
Definition: Camera.h:96
virtual void moveCameraSideward(GLfloat camSpeed)
Moves the camera to the right with a certain speed (based on previous position)
Definition: Camera.cpp:30
virtual vmml::Matrix4f getInverseRotationY()
Returns the inverse of the y-axis of the rotation matrix.
Definition: Camera.cpp:85
virtual void moveCameraUpward(GLfloat camSpeed)
Moves the camera upwards with a certain speed (based on previous position)
Definition: Camera.cpp:35
virtual vmml::Vector3f getUp()
Returns the up vector of the camera.
Definition: Camera.cpp:111
virtual ~Camera()
Virtual destructor.
Definition: Camera.h:50
void setPosition(const vmml::Vector3f &position)
Sets the position of the camera.
Definition: Camera.h:81