utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
utility::graphic::Renderable Class Reference

The Renderable class represents an object that can be rendered in the graphics application. More...

#include <headers/utility/graphic/renderable.hpp>

Inheritance diagram for utility::graphic::Renderable:
Collaboration diagram for utility::graphic::Renderable:

Public Member Functions

 Renderable (const PoseF &pose, const Color32Bit &color)
 Default constructor for Renderable.
 
virtual ~Renderable ()=default
 Virtual destructor for Renderable.
 
RenderablesetPose (const PoseF &pose)
 Set the text pose.
 
void setPose (PoseF &&pose)
 Set the text pose.
 
const PoseFgetPose (void) const
 Get the text pose.
 
glm::mat4 getModelMatrix (void) const
 Get the object-to-world model matrix of this renderable.
 
RenderablesetColor (const graphic::Color32Bit &color)
 Set the text color.
 
void setColor (graphic::Color32Bit &&color)
 Set the text color.
 
const graphic::Color32BitgetColor (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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Renderable()

utility::graphic::Renderable::Renderable ( const PoseF pose,
const Color32Bit color 
)

Default constructor for Renderable.

Parameters
poseThe initial pose (position and orientation) of the renderable object. Defaults to the origin with no rotation.
colorThe initial color of the renderable object. Defaults to opaque white.

Definition at line 13 of file renderable.cpp.

Member Function Documentation

◆ getColor()

const Color32Bit & utility::graphic::Renderable::getColor ( void  ) const

Get the text color.].

Returns
Const reference to the text color.

Definition at line 28 of file renderable.cpp.

◆ getMeshes()

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.

Returns
A vector of shared pointers to Mesh objects associated with this renderable object.

Definition at line 38 of file renderable.cpp.

◆ getModelMatrix()

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.

Returns
The model matrix (translation * rotation).

Definition at line 33 of file renderable.cpp.

◆ getPose()

const PoseF & utility::graphic::Renderable::getPose ( void  ) const

Get the text pose.

Returns
Const reference to the text pose (position and orientation).

Definition at line 23 of file renderable.cpp.

◆ setColor() [1/2]

Renderable & utility::graphic::Renderable::setColor ( const graphic::Color32Bit color)

Set the text color.

Parameters
colorText RGBA color.
Returns
Reference to this Text instance for chaining.

Definition at line 58 of file renderable.cpp.

◆ setColor() [2/2]

void utility::graphic::Renderable::setColor ( graphic::Color32Bit &&  color)

Set the text color.

Parameters
colorText RGBA color.

Definition at line 64 of file renderable.cpp.

◆ setPose() [1/2]

Renderable & utility::graphic::Renderable::setPose ( const PoseF pose)

Set the text pose.

Parameters
poseText world pose (position and orientation).
Returns
Reference to this Text instance for chaining.

Definition at line 47 of file renderable.cpp.

◆ setPose() [2/2]

void utility::graphic::Renderable::setPose ( PoseF &&  pose)

Set the text pose.

Parameters
poseText world pose (position and orientation).

Definition at line 53 of file renderable.cpp.

Member Data Documentation

◆ _color

Color32Bit utility::graphic::Renderable::_color
protected

Text RGBA color.

Definition at line 125 of file renderable.hpp.

◆ _meshes

std::vector<std::shared_ptr<Mesh> > utility::graphic::Renderable::_meshes
protected

Meshes associated with this renderable object.

Definition at line 124 of file renderable.hpp.

◆ _pose

PoseF utility::graphic::Renderable::_pose
protected

World pose (position and orientation) of the text.

Definition at line 126 of file renderable.hpp.


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