SuzanneIsland: An island of Real-time rendering effects!
Public Member Functions | Static Public Attributes
Geometry Class Reference

A SceneObject that holds Surfaces containing mesh data and textures. More...

#include <geometry.h>

Inheritance diagram for Geometry:
SceneObject Eagle Light

Public Member Functions

 Geometry (const glm::mat4 &matrix_, const std::string &filePath)
 
virtual void update (float timeDelta)
 Update the state of the SceneObject. More...
 
virtual void draw (Shader *shader, Camera *camera, bool useFrustumCulling, Texture::FilterType filterType, const glm::mat4 &viewMat)
 draw the SceneObject using given shader
 
glm::mat3 getNormalMatrix () const
 return a the transposed inverse of the modelMatrix. More...
 
glm::vec3 getBBMin ()
 Returns min vertex of axis-aligned bounding box enclosing all surfaces. More...
 
glm::vec3 getBBMax ()
 Returns max vertex of axis-aligned bounding box enclosing all surfaces. More...
 
- Public Member Functions inherited from SceneObject
 SceneObject (const glm::mat4 &modelMatrix_)
 
void applyTransformation (const glm::mat4 &trans_mat, const glm::mat4 &invtrans_mat, Order mult_order)
 Apply a transformation matrix to the current matrix. More...
 
const glm::mat4 & getMatrix () const
 
void setTransform (const glm::mat4 &new_trans_mat)
 Replaces current matrix and sets its inverse. More...
 
const glm::mat4 & getInverseMatrix () const
 
glm::vec3 getLocation () const
 Returns the location of the SceneObject. More...
 
void setLocation (const glm::vec3 &location)
 Set SceneObject's location: rightmost column of the model matrix. More...
 
void rotateX (float radians, Order mult_order)
 Applies an X axis rotation operation to the current transformation. More...
 
void rotateY (float radians, Order mult_order)
 Applies a Y axis rotation operation to the current transformation. More...
 
void rotateZ (float radians, Order mult_order)
 Applies a Z axis rotation operation to the current transformation. More...
 
void rotate (float radians, Order mult_order, const glm::vec3 &rot_axis)
 Applies a rotation around a given vector (= axis) More...
 
void translate (const glm::vec3 &trans_vec, Order mult_order)
 Applies a translation operation to the current transformation. More...
 
void scale (const glm::vec3 &scaling_vec, Order mult_order)
 Applies a scale operation to the current transformation. More...
 
std::string matrixToString (const glm::mat4 &matrix)
 Get a string to visualize the given matrix. More...
 

Static Public Attributes

static int drawnSurfaceCount = 0
 The number of surfaces being drawn.
 

Additional Inherited Members

- Public Types inherited from SceneObject
enum  Order { LEFT, RIGHT }
 enum specifying matrix multiplication order. More...
 

Detailed Description

A SceneObject that holds Surfaces containing mesh data and textures.

Member Function Documentation

§ getBBMax()

glm::vec3 Geometry::getBBMax ( )

Returns max vertex of axis-aligned bounding box enclosing all surfaces.

Returns
max vertex of axis-aligned bounding box enclosing all surfaces.

§ getBBMin()

glm::vec3 Geometry::getBBMin ( )

Returns min vertex of axis-aligned bounding box enclosing all surfaces.

Returns
min vertex of axis-aligned bounding box enclosing all surfaces.

§ getNormalMatrix()

glm::mat3 Geometry::getNormalMatrix ( ) const

return a the transposed inverse of the modelMatrix.

this should be used to transform normals into world space. the inverse is used since the normals of a scaled vector are inversely scaled, the transpose is used to revert the inversion of the rotational components while not affecting the scale factors which lie on the main diagonal. mat3 is used since the translational component is irrelevant for normals.

Returns
the matrix to transform normals into world space.

§ update()

void Geometry::update ( float  timeDelta)
virtual

Update the state of the SceneObject.

Parameters
[in]timeDeltatime passed since last frame in seconds

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