Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Member Functions | List of all members
jop::Model Class Reference

#include <Model.hpp>

Public Member Functions

 Model ()
 Constructor. More...
 
 Model (const Mesh &mesh)
 Constructor for initializing with a mesh. More...
 
 Model (const Material &material)
 Constructor for initializing with a material. More...
 
 Model (const Mesh &mesh, const Material &material)
 Constructor for initializing with a mesh and material. More...
 
Mesh * getMesh ()
 Get the mesh. More...
 
const Mesh * getMesh () const
 Get the mesh. More...
 
Model & setMesh (const Mesh &mesh)
 Set the mesh. More...
 
Material * getMaterial ()
 Get the material. More...
 
const Material * getMaterial () const
 Get the material. More...
 
Model & setMaterial (const Material &material)
 Set the material. More...
 
bool isValid () const
 Check if this model is valid. More...
 

Detailed Description

Definition at line 37 of file Model.hpp.

Constructor & Destructor Documentation

jop::Model::Model ( )

Constructor.

jop::Model::Model ( const Mesh &  mesh)

Constructor for initializing with a mesh.

Note that a model is not valid until it has a material also.

Parameters
meshMesh to initialize with
jop::Model::Model ( const Material &  material)

Constructor for initializing with a material.

Note that a model is not valid until it has a mesh also.

Parameters
materialMaterial to initialize with
jop::Model::Model ( const Mesh &  mesh,
const Material &  material 
)

Constructor for initializing with a mesh and material.

Parameters
meshMesh to initialize with
materialMaterial to initialize with

Member Function Documentation

Material* jop::Model::getMaterial ( )

Get the material.

Returns
Pointer to the material. nullptr if none bound
const Material* jop::Model::getMaterial ( ) const

Get the material.

Returns
Pointer to the material. nullptr if none bound
Mesh* jop::Model::getMesh ( )

Get the mesh.

Returns
Pointer to the mesh. nullptr if none bound
const Mesh* jop::Model::getMesh ( ) const

Get the mesh.

Returns
Pointer to the mesh. nullptr if none bound
bool jop::Model::isValid ( ) const

Check if this model is valid.

The model is valid if both a valid mesh and material are present.

Returns
True if valid
Model& jop::Model::setMaterial ( const Material &  material)

Set the material.

Parameters
materialThe new material
Returns
Reference to self
Model& jop::Model::setMesh ( const Mesh &  mesh)

Set the mesh.

Parameters
meshReference to the mesh
Returns
Reference to self

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