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
renderable.cpp
1/*
2** ETIB PROJECT, 2026
3** xider
4** File description:
5** renderable
6*/
7
8#include <utility/graphic/renderable.hpp>
9#include <utility/graphic/transform.hpp>
10
11namespace utility::graphic
12{
13 Renderable::Renderable(const PoseF &pose, const Color32Bit &color)
14 : _color(color)
15 , _pose(pose)
16 {
17 }
18
20 // Getters //
22
23 const PoseF &Renderable::getPose(void) const
24 {
25 return _pose;
26 }
27
29 {
30 return _color;
31 }
32
33 glm::mat4 Renderable::getModelMatrix(void) const
34 {
35 return poseToMatrix(_pose);
36 }
37
38 std::vector<std::shared_ptr<Mesh>> Renderable::getMeshes() const
39 {
40 return _meshes;
41 }
42
44 // Setters //
46
48 {
49 _pose = pose;
50 return *this;
51 }
52
54 {
55 _pose = std::move(pose);
56 }
57
59 {
60 _color = color;
61 return *this;
62 }
63
65 {
66 _color = std::move(color);
67 }
68
69} // namespace utility::graphic
The Renderable class represents an object that can be rendered in the graphics application.
glm::mat4 getModelMatrix(void) const
Get the object-to-world model matrix of this renderable.
std::vector< std::shared_ptr< Mesh > > _meshes
Meshes associated with this renderable object.
PoseF _pose
World pose (position and orientation) of the text.
Renderable & setPose(const PoseF &pose)
Set the text pose.
const PoseF & getPose(void) const
Get the text pose.
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.
Renderable(const PoseF &pose, const Color32Bit &color)
Default constructor for Renderable.
Color32Bit _color
Text RGBA color.
Renderable & setColor(const graphic::Color32Bit &color)
Set the text color.