![]() |
Chira Engine
A customizable MIT-licensed game engine.
|
Public Member Functions | |
void | addTriangle (Vertex v1, Vertex v2, Vertex v3, bool addDuplicate=false) |
void | addSquare (Vertex v1, Vertex v2, Vertex v3, Vertex v4, bool addDuplicate=false) |
Vertex v4 forms a face with vertex v1 and v3. | |
void | addSquare (Vertex center, glm::vec2 size, SignedAxis normal, float offset=0, bool addDuplicate=false) |
void | addCube (Vertex center, glm::vec3 size, bool visibleOutside=true, bool addDuplicate=false) |
void | update () |
void | clear () |
Does not call update(). | |
![]() | |
void | render (glm::mat4 model, MeshCullType cullType=MeshCullType::BACK) |
SharedPointer< IMaterial > | getMaterial () const |
void | setMaterial (SharedPointer< IMaterial > newMaterial) |
MeshDepthFunction | getDepthFunction () const |
void | setDepthFunction (MeshDepthFunction function) |
std::vector< byte > | getMeshData (const std::string &meshLoader) const |
void | appendMeshData (const std::string &loader, const std::string &identifier) |
Protected Member Functions | |
void | addVertex (Vertex vertex, bool addDuplicate=false) |
Pass true to addDuplicate if you don't want to scan the entire vertex vector to calculate the index. More... | |
![]() | |
void | setupForRendering () |
Establishes the vertex buffers and copies the current mesh data into them. | |
void | updateMeshData () |
Updates the vertex buffers with the current mesh data. | |
void | clearMeshData () |
Does not call updateMeshData(). | |
Protected Attributes | |
Index | currentIndex = 0 |
![]() | |
bool | initialized = false |
Renderer::MeshHandle | handle {} |
MeshDrawMode | drawMode = MeshDrawMode::STATIC |
MeshDepthFunction | depthFunction = MeshDepthFunction::LEQUAL |
SharedPointer< IMaterial > | material |
std::vector< Vertex > | vertices |
std::vector< Index > | indices |
Definition at line 8 of file MeshDataBuilder.h.
|
protected |
Pass true to addDuplicate if you don't want to scan the entire vertex vector to calculate the index.
This will make a duplicate vertex if one already exists.
Definition at line 11 of file MeshDataBuilder.cpp.