Molecule Viewer
 All Classes Functions Variables Enumerations Pages
Public Member Functions | List of all members
Camera Class Reference

Class representing the camera in the scene, a perspective projection is used. More...

#include <Camera.hpp>

Inheritance diagram for Camera:
SceneObject

Public Member Functions

 Camera ()
 Creates a camera object with perspective projection. More...
 
 Camera (int windowWidth, int windowHeight)
 Creates a camera object with perspective projection and given aspect ratio. More...
 
void SetViewMatrix (glm::mat4 viewMatrix)
 Sets the camera's view matrix.
 
void SetModelMatrix (glm::mat4 model)
 Sets the camera's model matrix.
 
glm::mat4 GetViewMatrix () const
 Returns the view matrix, which is the inverse of camera's model matrix.
 
glm::mat4 GetProjectionMatrix () const
 Returns the perspective projection matrix of the camera.
 
void UpdateProjectionMatrix (int windowWidth, int windowHeight, float far)
 Updates the perspective projection matrix of the camera with new far plane and new aspect ratio (windowWidth/windowHeight).
 
- Public Member Functions inherited from SceneObject
 SceneObject ()
 Create a new Scene Object.
 
virtual ~SceneObject ()
 Delete the Scene Object.
 
glm::mat4 GetModelMatrix () const
 Returns the current model matrix of the object.
 
glm::mat4 GetInverseModelMatrix () const
 Returns the current inverse model matrix of the object.
 
virtual void Reset ()
 Resets the model matrix and inverse model matrix to identity matrix.
 
virtual void Translate (float x, float y, float z)
 Translates the object according to the transform vector x,y,z.
 
virtual void RotateX_world (float angle)
 Rotates the object around world x-axis, angle in degrees.
 
virtual void RotateY_world (float angle)
 Rotates the object around world y-axis, angle in degrees.
 
virtual void RotateX (float angle)
 Rotates the object around it's own x-axis, angle in degrees.
 
virtual void RotateY (float angle)
 Rotates the object around it's own y-axis, angle in degrees.
 

Additional Inherited Members

- Protected Member Functions inherited from SceneObject
virtual void Transform (glm::mat4 transformMatrix, glm::mat4 inverseTransformMatrix)
 Updates the model matrix and inverse model matrix with given transformMatrix (for model matrix) and inverseTransformMatrix (for inverse model matrix). More...
 
virtual void Transform_world (glm::mat4 transformMatrix, glm::mat4 inverseTransformMatrix)
 Updates the model matrix and inverse model matrix with given transformMatrix (for model matrix) and inverseTransformMatrix (for inverse model matrix). More...
 
- Protected Attributes inherited from SceneObject
glm::mat4 * _modelMatrix
 current model matrix of the object
 
glm::mat4 * _inverseModelMatrix
 current inverse model matrix of the object
 

Detailed Description

Class representing the camera in the scene, a perspective projection is used.

Definition at line 9 of file Camera.hpp.

Constructor & Destructor Documentation

Camera::Camera ( )

Creates a camera object with perspective projection.

  • 4:3 aspect ration
  • 60 degree FOV
  • Near Plane = 0.1 and Far Plane = 400
  • position 0,0,0 and looking down z-

Definition at line 5 of file Camera.cpp.

Camera::Camera ( int  windowWidth,
int  windowHeight 
)

Creates a camera object with perspective projection and given aspect ratio.

  • choose your own aspect ratio (windowWidth/windowHeight)
  • 60 degree FOV
  • Near Plane = 0.1 and Far Plane = 400
  • position 0,0,0 and looking down z-

Definition at line 10 of file Camera.cpp.


The documentation for this class was generated from the following files: