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

Scene Object is the base class for all objects in the scene (Camera, Light and Molecule). More...

#include <SceneObject.hpp>

Inheritance diagram for SceneObject:
Camera Light

Public Member Functions

 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.
 

Protected Member Functions

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

glm::mat4 * _modelMatrix
 current model matrix of the object
 
glm::mat4 * _inverseModelMatrix
 current inverse model matrix of the object
 

Detailed Description

Scene Object is the base class for all objects in the scene (Camera, Light and Molecule).

A molecule is an object of this class, Camera and Light are derived from this class. This class provides the basic transformation methods needed: Rotation around X and Y axis and Translation.

Definition at line 12 of file SceneObject.hpp.

Member Function Documentation

void SceneObject::Transform ( glm::mat4  transformMatrix,
glm::mat4  inverseTransformMatrix 
)
protectedvirtual

Updates the model matrix and inverse model matrix with given transformMatrix (for model matrix) and inverseTransformMatrix (for inverse model matrix).

Called by the rotation and translation functions. Multiplication Order: modelMatrix = modelMatrix * transformMatrix / inverseModelMatrix = inverseTransformMatrix * inverseModelMatrix.

Definition at line 95 of file SceneObject.cpp.

void SceneObject::Transform_world ( glm::mat4  transformMatrix,
glm::mat4  inverseTransformMatrix 
)
protectedvirtual

Updates the model matrix and inverse model matrix with given transformMatrix (for model matrix) and inverseTransformMatrix (for inverse model matrix).

Called by the rotation and translation functions. Multiplication Order: modelMatrix = transformMatrix * modelMatrix / inverseModelMatrix = inverseModelMatrix * inverseTransformMatrix.

Definition at line 87 of file SceneObject.cpp.


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