|
utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
|
The Model class represents a 3D model in the graphics application. More...
#include <headers/utility/graphic/model.hpp>


Public Types | |
| enum class | ModelType { OBJ , FBX , GLTF } |
| The ModelType enum represents the different types of 3D models that can be loaded and rendered in the graphics application. It currently includes OBJ, FBX, and GLTF model formats, allowing for flexibility in the types of models that can be used within the application. Additional model types can be added to this enum as needed to support more formats in the future. More... | |
Public Member Functions | |
| Model (std::shared_ptr< utility::File > modelAsset, const PoseF &pose, uint32_t materialID) | |
| Constructs a Model object from a given File containing the model data. | |
| Model (std::shared_ptr< utility::File > modelAsset, ModelType type, const PoseF &pose, uint32_t materialID) | |
| Constructs a Model object from a given File containing the model data and a specified ModelType. | |
| ~Model ()=default | |
| Destructs the Model object, releasing any allocated resources. | |
| ModelType | type () const |
| Get the type of the model. | |
| utility::graphic::SizeF | computeBoundingSize (void) |
| Computes the bounding size of the model. | |
| uint32_t | getMaterialID (void) const |
| Get the material ID associated with the model. | |
Public Member Functions inherited from utility::graphic::Renderable | |
| Renderable (const PoseF &pose, const Color32Bit &color) | |
| Default constructor for Renderable. | |
| virtual | ~Renderable ()=default |
| Virtual destructor for Renderable. | |
| Renderable & | setPose (const PoseF &pose) |
| Set the text pose. | |
| void | setPose (PoseF &&pose) |
| Set the text pose. | |
| const PoseF & | getPose (void) const |
| Get the text pose. | |
| glm::mat4 | getModelMatrix (void) const |
| Get the object-to-world model matrix of this renderable. | |
| Renderable & | setColor (const graphic::Color32Bit &color) |
| Set the text color. | |
| void | setColor (graphic::Color32Bit &&color) |
| Set the text color. | |
| const graphic::Color32Bit & | getColor (void) const |
| Get the text color.]. | |
| std::vector< std::shared_ptr< Mesh > > | getMeshes () const |
| Get the meshes associated with this renderable object. | |
Protected Member Functions | |
| void | loadOBJ (std::shared_ptr< utility::File > modelAsset) |
| Loads a model from a given File containing the model data. | |
Protected Member Functions inherited from utility::logging::Loggable< Model, utility::logging::DefaultLogger > | |
| Loggable (void) | |
| Construct a Loggable with the specified LoggerType. | |
| Loggable (Loggable &&other) noexcept | |
| Move constructor for Loggable. | |
| Loggable & | operator= (Loggable &&other) noexcept |
| Move assignment operator for Loggable. | |
| LoggerType & | getLogger (void) |
| Get the internal logger. | |
| LoggerType & | getLogger (void) const |
| Get the internal logger. | |
| virtual | ~Loggable (void)=default |
| Virtual destructor for proper cleanup. | |
Protected Attributes | |
| ModelType | _type |
| The type of the model (e.g., OBJ, FBX, GLTF) | |
| utility::graphic::SizeF | _boundingBox {} |
| The bounding box of the model. | |
| uint32_t | _materialID |
| The material associated with the model. | |
Protected Attributes inherited from utility::graphic::Renderable | |
| std::vector< std::shared_ptr< Mesh > > | _meshes |
| Meshes associated with this renderable object. | |
| Color32Bit | _color |
| Text RGBA color. | |
| PoseF | _pose |
| World pose (position and orientation) of the text. | |
The Model class represents a 3D model in the graphics application.
The Model class is responsible for storing the data and properties of a 3D model, including its vertices, textures, materials, and other relevant information. It provides methods to load and manage the model's data, allowing for efficient rendering and manipulation within the graphics application.
|
strong |
The ModelType enum represents the different types of 3D models that can be loaded and rendered in the graphics application. It currently includes OBJ, FBX, and GLTF model formats, allowing for flexibility in the types of models that can be used within the application. Additional model types can be added to this enum as needed to support more formats in the future.
| utility::graphic::Model::Model | ( | std::shared_ptr< utility::File > | modelAsset, |
| const PoseF & | pose, | ||
| uint32_t | materialID | ||
| ) |
Constructs a Model object from a given File containing the model data.
| modelAsset | A shared pointer to the File object containing the model data to be loaded. This constructor is responsible for initializing the Model object by loading the model data from the provided File. It processes the model data and populates the necessary properties of the Model object, such as vertices, textures, and materials, based on the content of the File. |
| pose | The initial position and orientation for the model. |
| materialID | The ID of the material associated with the model. |
Definition at line 12 of file model.cpp.

| utility::graphic::Model::Model | ( | std::shared_ptr< utility::File > | modelAsset, |
| ModelType | type, | ||
| const PoseF & | pose, | ||
| uint32_t | materialID | ||
| ) |
Constructs a Model object from a given File containing the model data and a specified ModelType.
| modelAsset | A shared pointer to the File object containing the model data to be loaded. |
| type | The type of the model (e.g., OBJ, FBX, GLTF) to be loaded. |
| pose | The initial position and orientation for the model. |
| materialID | The ID of the material associated with the model. |
This constructor is responsible for initializing the Model object by loading the model data from the provided File and setting the ModelType based on the specified type parameter.
Definition at line 38 of file model.cpp.

| utility::graphic::SizeF utility::graphic::Model::computeBoundingSize | ( | void | ) |
| uint32_t utility::graphic::Model::getMaterialID | ( | void | ) | const |
|
protected |
Loads a model from a given File containing the model data.
| modelAsset | A shared pointer to the File object containing the model data to be loaded. |
This method is responsible for parsing the model data from the provided File and populating the necessary properties of the Model object, such as vertices, textures, and materials, based on the content of the File. The parsing process will depend on the format of the model data (e.g., OBJ, FBX, GLTF) and will set the appropriate ModelType based on the file format.
Definition at line 87 of file model.cpp.


| Model::ModelType utility::graphic::Model::type | ( | ) | const |
|
protected |
|
protected |
|
protected |