|
utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
|
The Renderable class represents an object that can be rendered in the graphics application. More...
#include <headers/utility/graphic/renderable.hpp>


Public Member Functions | |
| 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 Attributes | |
| 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 Renderable class represents an object that can be rendered in the graphics application.
The Renderable class serves as a base class for objects that can be rendered, such as models, sprites, or other graphical entities. It provides a common interface and properties for renderable objects, allowing for consistent handling and rendering within the graphics application.
Definition at line 31 of file renderable.hpp.
| utility::graphic::Renderable::Renderable | ( | const PoseF & | pose, |
| const Color32Bit & | color | ||
| ) |
Default constructor for Renderable.
| pose | The initial pose (position and orientation) of the renderable object. Defaults to the origin with no rotation. |
| color | The initial color of the renderable object. Defaults to opaque white. |
Definition at line 13 of file renderable.cpp.
| const Color32Bit & utility::graphic::Renderable::getColor | ( | void | ) | const |
Get the text color.].
Definition at line 28 of file renderable.cpp.
| std::vector< std::shared_ptr< Mesh > > utility::graphic::Renderable::getMeshes | ( | ) | const |
Get the meshes associated with this renderable object.
This method returns a vector of shared pointers to Mesh objects that are associated with this renderable object. Each Mesh represents a part of the geometry that can be rendered, and the shared pointers allow for efficient memory management and sharing of mesh data across multiple renderable objects if needed. The returned vector can be used by the rendering system to access the mesh data for rendering this object in the scene.
Definition at line 38 of file renderable.cpp.
| glm::mat4 utility::graphic::Renderable::getModelMatrix | ( | void | ) | const |
Get the object-to-world model matrix of this renderable.
Converts the renderable pose (position + orientation) into the glm::mat4 expected by per-instance rendering. Meshes are stored in local (object) space, so this matrix is what positions them in the world instead of a CPU-baked transform.
Definition at line 33 of file renderable.cpp.
| const PoseF & utility::graphic::Renderable::getPose | ( | void | ) | const |
Get the text pose.
Definition at line 23 of file renderable.cpp.
| Renderable & utility::graphic::Renderable::setColor | ( | const graphic::Color32Bit & | color | ) |
Set the text color.
| color | Text RGBA color. |
Definition at line 58 of file renderable.cpp.
| void utility::graphic::Renderable::setColor | ( | graphic::Color32Bit && | color | ) |
| Renderable & utility::graphic::Renderable::setPose | ( | const PoseF & | pose | ) |
Set the text pose.
| pose | Text world pose (position and orientation). |
Definition at line 47 of file renderable.cpp.
| void utility::graphic::Renderable::setPose | ( | PoseF && | pose | ) |
Set the text pose.
| pose | Text world pose (position and orientation). |
Definition at line 53 of file renderable.cpp.
|
protected |
Text RGBA color.
Definition at line 125 of file renderable.hpp.
|
protected |
Meshes associated with this renderable object.
Definition at line 124 of file renderable.hpp.
|
protected |
World pose (position and orientation) of the text.
Definition at line 126 of file renderable.hpp.