YAGE  1.0
Yet Another Game Engine
Model Class Referenceabstract

#include <Model.h>

Inheritance diagram for Model:
IGameObject Mesh

Public Member Functions

 Model ()
 
 Model (Transform *t)
 
virtual ~Model ()
 
void SetProgram (GLuint) override
 Sets the main shader program corresponding to this object. More...
 
void SetShadowProgram (GLuint) override
 Sets the shadow pass shader program corresponding to this object. More...
 
void Destroy () override
 Destroys this object. More...
 
virtual std::vector< VertexFormatGetVertices ()=0
 
GLuint GetVao () const
 
const std::vector< GLuint > & GetVbos () const
 
const GLuint GetTexture (const std::string &) const override
 Gets a texture. More...
 
void SetTexture (const std::string &textureName, const TextureType &textureType, const GLuint &texture) override
 Adds a texture to an object. More...
 
- Public Member Functions inherited from IGameObject
virtual ~IGameObject ()
 Destructor that deletes the unique shader program and shadow program belonging to the object. More...
 
virtual void Draw (GLuint shader)=0
 Draws via the given shader. More...
 
virtual void DrawShadow (GLuint shader)=0
 Draw shadows via the given shader. More...
 
virtual void Update ()=0
 Updates this object. More...
 
virtual GLuint GetProgram ()
 Gets the object's main shader program. More...
 
virtual GLuint GetShadowProgram ()
 Gets the object's shadow program. More...
 

Protected Attributes

Transformtransform
 
GLuint vao
 
std::vector< GLuint > vbos
 
std::vector< Texturetextures
 
- Protected Attributes inherited from IGameObject
GLuint program = 0
 
GLuint shadowProgram = 0
 

Constructor & Destructor Documentation

Model::Model ( )
Model::Model ( Transform t)
Model::~Model ( )
virtual

Member Function Documentation

void Model::Destroy ( )
overridevirtual

Destroys this object.

Implements IGameObject.

const GLuint Model::GetTexture ( const std::string &  textureName) const
overridevirtual

Gets a texture.

Parameters
textureNameThe name of the texture.
Returns
The texture.

Implements IGameObject.

GLuint Model::GetVao ( ) const
const std::vector< GLuint > & Model::GetVbos ( ) const
virtual std::vector<VertexFormat> Model::GetVertices ( )
pure virtual

Implemented in Mesh.

void Model::SetProgram ( GLuint  shaderName)
overridevirtual

Sets the main shader program corresponding to this object.

Author
Harry
Date
4/14/2016
Parameters
shaderNameName of the shader.

Reimplemented from IGameObject.

void Model::SetShadowProgram ( GLuint  shaderName)
overridevirtual

Sets the shadow pass shader program corresponding to this object.

Parameters
shaderNameName of the shader.

Reimplemented from IGameObject.

void Model::SetTexture ( const std::string &  textureName,
const TextureType textureType,
const GLuint &  texture 
)
overridevirtual

Adds a texture to an object.

Parameters
textureNameName of the texture.
textureTypeType of the texture.
textureThe texture id.

Implements IGameObject.

Member Data Documentation

std::vector<Texture> Model::textures
protected
Transform* Model::transform
protected
GLuint Model::vao
protected
std::vector<GLuint> Model::vbos
protected