Chira Engine
A customizable MIT-licensed game engine.
chira::MeshDataBuilder Class Reference
Inheritance diagram for chira::MeshDataBuilder:
Collaboration diagram for chira::MeshDataBuilder:

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().
 
- Public Member Functions inherited from chira::MeshData
void render (glm::mat4 model, MeshCullType cullType=MeshCullType::BACK)
 
SharedPointer< IMaterialgetMaterial () 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...
 
- Protected Member Functions inherited from chira::MeshData
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
 
- Protected Attributes inherited from chira::MeshData
bool initialized = false
 
Renderer::MeshHandle handle {}
 
MeshDrawMode drawMode = MeshDrawMode::STATIC
 
MeshDepthFunction depthFunction = MeshDepthFunction::LEQUAL
 
SharedPointer< IMaterialmaterial
 
std::vector< Vertexvertices
 
std::vector< Index > indices
 

Detailed Description

Definition at line 8 of file MeshDataBuilder.h.

Member Function Documentation

◆ addVertex()

void MeshDataBuilder::addVertex ( Vertex  vertex,
bool  addDuplicate = false 
)
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.


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