|
| Mesh ()=default |
| Default constructor for the Mesh class.
|
|
| ~Mesh () |
| Destructor for the Mesh class.
|
|
| Mesh (const std::string &filePath) |
| Constructor that loads a mesh from a given file path.
|
|
| Mesh (std::vector< std::vector< Vertex > > verticesPerSubmesh, std::vector< std::vector< unsigned int > > indicesPerSubmesh, std::vector< std::shared_ptr< Material > > mats) |
| Constructor that takes vertices, indices, and materials directly.
|
|
| Mesh (std::vector< std::vector< Vertex > > verticesPerSubmesh, std::vector< std::vector< unsigned int > > indicesPerSubmesh) |
| Constructor that takes vertices and indices data without materials.
|
|
bool | loadMesh (const std::string &filePath) |
| Loads a mesh from a file.
|
|
void | setMaterials (const std::vector< std::shared_ptr< Material > > &newMaterials) |
| Sets the materials for the mesh.
|
|
void | setMaterial (const std::shared_ptr< Material > &mat) |
| Sets a single material for the mesh.
|
|
void | addMaterial (const std::shared_ptr< Material > &mat) |
| Adds a material to the mesh.
|
|
void | setupMesh () |
| Initializes OpenGL buffers for the mesh (VAO, VBO, EBO).
|
|
void | draw (ShaderProgram &shader) |
| Renders the mesh using a specified shader.
|
|
void | setUniforms (GLuint shaderProgramID) |
| Sets the uniform variables for the shader program.
|
|
void | renderMaterial (ShaderProgram &shader) |
| Renders the material of the mesh.
|
|
std::string | getName () |
| Retrieves the name of the mesh.
|
|
void | setName (std::string n_) |
| Sets the name of the mesh.
|
|
const std::string & | getLastError () const |
| Retrieves the last error encountered during mesh loading.
|
|
std::shared_ptr< Material > | GetMaterialByIndex (int index) |
| Retrieves a material by its index.
|
|
std::vector< std::shared_ptr< Material > > & | GetAllMaterials () |
| Retrieves all materials associated with the mesh.
|
|
std::vector< GLuint > | GetVAOs () |
| Retrieves all VAOs associated with the mesh.
|
|
std::vector< std::vector< unsigned int > > | GetSubMeshIndex () |
| Retrieves all submesh indices.
|
|
Represents a 3D mesh, including vertex data, indices, and materials.
The Mesh
class is responsible for storing, loading, and rendering 3D mesh data. It handles multiple submeshes, OpenGL buffers, and materials associated with the mesh.
The class supports the use of multiple materials and submeshes, where each submesh has its own vertex and index data.
Definition at line 89 of file mesh.hpp.