![]() |
AireEngine
A 3D Open-World Game Engine
|
A class for a 3D indexed triangular mesh. More...
#include <mesh.h>


Public Member Functions | |
| Mesh (std::vector< Vertex > vertices, std::vector< unsigned int > indices, MaterialPtr &handle) | |
| Mesh (std::vector< Vertex > vertices, std::vector< unsigned int > indices, MaterialPtr &handle, MeshHandle &meshHandle) | |
| void | render (ShaderProgram &shader) |
| unsigned int * | getVBO () |
| unsigned int * | getEB0 () |
| std::vector< Vertex > | getVertice () |
| std::vector< unsigned int > | getIndices () |
| MaterialPtr | getMaterial () |
| uint32_t | getSize () |
| MeshHandle | getMeshHandle () |
| void | translate (glm::mat4 &modelMatrix, glm::vec3 direction) |
| void | scale (glm::mat4 &modelMatrix, float val) |
| void | rotate (glm::mat4 &modelMatrix, float degree, glm::vec3 direction) |
Public Member Functions inherited from Aire::Resource | |
| Resource () | |
| Default constructor. | |
| virtual | ~Resource () |
| Default destructor. | |
| bool | isLoadToGpu () |
| ResourceState | getState () |
| void | setState (ResourceState state) |
Public Attributes | |
| std::vector< Vertex > | vertices |
| Mesh vertices. | |
| std::vector< unsigned int > | indices |
| Mesh indices. | |
| unsigned int | VAO |
Additional Inherited Members | |
Protected Attributes inherited from Aire::Resource | |
| ResourceState | resourceState |
A class for a 3D indexed triangular mesh.
|
inline |
Create a new mesh, given its geometric data
| vertices | The list of mesh vertices |
| indices | The list of mesh indices. All faces are triangles, so every three consecutive indices define a face. |
| handle | Material to assign to the mesh |
|
inline |
Create a new mesh with a pre-defined handle
| vertices | The list of mesh vertices |
| indices | The list of mesh indices. All faces are triangles, so every three consecutive indices define a face. |
| handle | Material to assign to the mesh |
| meshHandle | Pre-defined handle for the mesh |
| MaterialPtr Aire::Mesh::getMaterial | ( | ) |
| MeshHandle Aire::Mesh::getMeshHandle | ( | ) |
|
virtual |
Implements Aire::Resource.
| std::vector< Vertex > Aire::Mesh::getVertice | ( | ) |
|
inline |
Render the mesh
| shader | Shader program to use for rendering |

Apply rotation on an existing model matrix
| modelMatrix | The model matrix |
| degree | The degrees of rotation to apply to the model matrix |
| direction | The rotation direction |
Apply scale on an existing model matrix
| modelMatrix | The model matrix |
| val | The scale to apply to the model matrix |
| void Aire::Mesh::translate | ( | glm::mat4 & | modelMatrix, |
| glm::vec3 | direction ) |
Apply translation on an existing model matrix
| modelMatrix | The model matrix |
| direction | The translation to apply to the model matrix |