Mesh manager. Handles mesh creation, storage, and deletion.
More...
#include <meshManager.h>
Mesh manager. Handles mesh creation, storage, and deletion.
◆ createMesh()
| MeshHandle MeshManager::createMesh |
( |
std::vector< Vertex > | vertices, |
|
|
std::vector< unsigned int > | indices, |
|
|
MaterialPtr & | handle ) |
Create a custom new mesh NOTE: DO NOT call delete on returned pointer. The associated texture will be automatically deleted when the loader goes out of scope.
- Parameters
-
| vertices | The vertices of the new mesh |
| indices | The indices of the new mesh. All faces are triangles, so every three consecutive indices define a face. |
| handle | The material of the new mesh |
- Returns
- A handle to the new mesh
◆ createModel()
| ModelHandle Aire::MeshManager::createModel |
( |
const std::string & | path, |
|
|
bool | flippedUV = false ) |
Load a new model from a file. .obj readily supported. Other file formats might work. Check Assimp list of supported file formats.
- Parameters
-
| path | The path to the model file to load |
| flippedUV | If True, the UVs of the created model will be flipped. |
- Returns
- A handle to the new model
◆ ExtractBoneWeightForVertices()
| void Aire::MeshManager::ExtractBoneWeightForVertices |
( |
std::vector< Vertex > & | vertices, |
|
|
aiMesh * | mesh, |
|
|
const aiScene * | scene, |
|
|
BoneInfoMap & | map, |
|
|
int & | count ) |
Extract bone weights for a list of vertices
- Parameters
-
| vertices | List of vertices to query for |
| mesh | The Assimp mesh |
| scene | The Assimp scene |
| map | The map mapping bone name to the bone info object |
| count | The number of bones associated with the vertices
|
◆ freeModelDataInCpu()
| void Aire::MeshManager::freeModelDataInCpu |
( |
const ModelHandle & | handle | ) |
|
Remove a model object from CPU memory
- Parameters
-
| handle | Handle to the model |
◆ getMeshPtr()
| MeshPtr Aire::MeshManager::getMeshPtr |
( |
const MeshHandle & | handle | ) |
|
Get pointer to a mesh identified by its handle
- Parameters
-
| handle | The handle of the mesh object to query for |
- Returns
- A pointer to the mesh identified with the handle
◆ getModelPtr()
| ModelPtr Aire::MeshManager::getModelPtr |
( |
const ModelHandle & | handle | ) |
|
Get pointer to a model identified by its handle
- Parameters
-
| handle | The handle of the model object to query for |
- Returns
- A pointer to the model identified with the handle
◆ moveMeshToGpu()
| void Aire::MeshManager::moveMeshToGpu |
( |
const MeshHandle & | handle | ) |
|
Move a mesh to GPU memory
- Parameters
-
| handle | Handle to identify the mesh |
◆ moveModelToGpu() [1/2]
| void Aire::MeshManager::moveModelToGpu |
( |
const ModelHandle & | handle | ) |
|
Move a model to GPU memory
- Parameters
-
| handle | Handle to identify the model |
◆ moveModelToGpu() [2/2]
| void Aire::MeshManager::moveModelToGpu |
( |
const std::string & | path | ) |
|
Move a model to GPU memory (identified by model path)
- Parameters
-
| path | Path from which the model was loaded as an identifier |
◆ RemoveMeshInGpu()
| void Aire::MeshManager::RemoveMeshInGpu |
( |
const MeshHandle & | handle | ) |
|
Remove a mesh object from GPU memory
- Parameters
-
| handle | Handle to identify the mesh |
◆ RemoveMoelInGpu()
| void Aire::MeshManager::RemoveMoelInGpu |
( |
const ModelHandle & | handle | ) |
|
Remove a model object from GPU memory
- Parameters
-
| handle | Handle to identify the model |
◆ SetVertexBoneData()
Set the bone data for a vertex
- Parameters
-
| vertex | The vertex to set bone data for |
| boneID | The ID to link to the vertex |
| weight | The weight associated with the bone |
◆ SetVertexBoneDataToDefault()
| void Aire::MeshManager::SetVertexBoneDataToDefault |
( |
Vertex & | vertex | ) |
|
Clear the bone data associated with a vertex
- Parameters
-
| vertex | The vertex to reset bone data on |
The documentation for this class was generated from the following files:
- source/res-management/meshManager.h
- source/res-management/meshManager.cpp