Engine
Model Class Reference

Defines a model used for rendering. More...

#include <model.h>

Inheritance diagram for Model:
RectangularPrism Sphere

Public Member Functions

Eigen::Matrix< GLfloat, 4, 4 > GetModelMatrix ()
 
void SetModelMatrix (Eigen::Matrix< GLfloat, 4, 4 > model)
 
Mesh GetMesh ()
 
Material GetMaterial ()
 
Eigen::Matrix< GLfloat, 3, 3 > GetNormalMatrix ()
 

Protected Member Functions

 Model ()
 

Protected Attributes

Mesh m_mesh
 
Eigen::Matrix< GLfloat, 4, 4 > m_model_matrix
 
Material m_material
 
Eigen::Matrix< GLfloat, 3, 3 > m_normal_matrix
 

Detailed Description

Defines a model used for rendering.

Model is the base class for all entities that are rendered in a scene. It stores properites such as the mesh, material properties, textures, etc. It also holds the model matrix which handles transforming the mesh from local coordinates to world coordinates. See Here for more details.

Constructor & Destructor Documentation

Model::Model ( )
protected

Builds a Model with an empty mesh and identity model matrix

Member Function Documentation

Material Model::GetMaterial ( )

#return material for this mesh

Mesh Model::GetMesh ( )
Returns
Copy of the mesh used by this model
Eigen::Matrix< GLfloat, 4, 4 > Model::GetModelMatrix ( )
Returns
The model matrix
Eigen::Matrix< GLfloat, 3, 3 > Model::GetNormalMatrix ( )
Returns
The normal matrix
void Model::SetModelMatrix ( Eigen::Matrix< GLfloat, 4, 4 >  model)

Sets the model matrix

Parameters
modelMatrix to be set as the model matrix

Member Data Documentation

Material Model::m_material
protected

Material properties for this model

Mesh Model::m_mesh
protected

The mesh for this model

Eigen::Matrix<GLfloat,4,4> Model::m_model_matrix
protected

The model matrix. This handles transforming from local model coordinates to world coordinates

Eigen::Matrix<GLfloat,3,3> Model::m_normal_matrix
protected

The normal matrix. Used in rendering light interaction with surface


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