utility 2026.2.0
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
Loading...
Searching...
No Matches
renderable.hpp
1/*
2** ETIB PROJECT, 2026
3** xider
4** File description:
5** renderable
6*/
7
8#pragma once
9
10#include <memory>
11
12#include <glm/mat4x4.hpp>
13
15#include <utility/graphic/pose.hpp>
16#include <utility/graphic/mesh.hpp>
17
18namespace utility::graphic
19{
32 {
33 public:
34
35 enum class RenderableType {
36 Unknown = 0,
37 Model = 1,
38 Text = 3,
39 Mesh = 4,
40 };
41
49 Renderable(const PoseF &pose, const Color32Bit &color);
50
54 virtual ~Renderable() = default;
55
63 Renderable &setPose(const PoseF &pose);
64
70 void setPose(PoseF &&pose);
71
77 const PoseF &getPose(void) const;
78
89 [[nodiscard]] glm::mat4 getModelMatrix(void) const;
90
99
105 void setColor(graphic::Color32Bit &&color);
106
112 const graphic::Color32Bit &getColor(void) const;
113
128 [[nodiscard]] std::vector<std::shared_ptr<Mesh>> getMeshes() const;
129
143
148 virtual std::string getMaterialName() const = 0;
149
150 protected:
151 std::vector<std::shared_ptr<Mesh>>
155 };
156} // namespace utility::graphic
The Mesh class represents a 3D mesh used for rendering in a graphics application.
Definition mesh.hpp:25
The Model class represents a 3D model in the graphics application.
Definition model.hpp:41
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.
virtual RenderableType getRenderableType() const =0
Get the type of this renderable object.
virtual ~Renderable()=default
Virtual destructor for Renderable.
Color32Bit _color
Text RGBA color.
virtual std::string getMaterialName() const =0
Get the material name.
Renderable & setColor(const graphic::Color32Bit &color)
Set the text color.
Storage for text content and rendering properties.
Definition text.hpp:75
RGBA color representation with blending and manipulation operations.