Rendering Engine
0.2.9
Modular Graphics Rendering Engine | v0.2.9
drawable_3d.hpp
Go to the documentation of this file.
1
// This file is part of the Rendering Engine project.
2
// Author: Alexander Obzherin <alexanderobzherin@gmail.com>
3
// Copyright (c) 2026 Alexander Obzherin
4
// Distributed under the terms of the zlib License. See LICENSE.md for details.
5
6
#pragma once
7
8
#include "
rendering_engine_export.hpp
"
9
#include "
drawable_component.hpp
"
10
#include "
scene_component.hpp
"
11
12
namespace
rendering_engine
13
{
14
class
Camera;
15
16
/**
17
* @class Drawable3D
18
* @brief 3D drawable component for rendering objects in 3D space.
19
*
20
* Encapsulates a transform (SceneComponent).
21
* Provides per-frame update, world transform access, and render submission.
22
*
23
* @note Not copyable or assignable.
24
* @see DrawableComponent, SceneComponent, Camera
25
*/
26
class
RE_API
Drawable3D
:
public
DrawableComponent
27
{
28
public
:
29
/**
30
* @brief Constructs the Drawable3D with a render context.
31
* @param renderContext Resource context.
32
*/
33
Drawable3D
(
RenderResourceContext
renderContext,
Scene
& scene);
34
35
/**
36
* @copydoc DrawableComponent::Initialize
37
*/
38
void
Initialize()
override
;
39
40
/**
41
* @copydoc DrawableComponent::Update
42
*/
43
void
Update(
float
deltaTime)
override
;
44
45
/**
46
* @brief Submits this mesh to the renderer for drawing.
47
*/
48
virtual
void
Draw
(
const
Camera
& camera) = 0;
49
50
/**
51
* @brief Sets the mesh position in world space.
52
* @param position New position vector (x, y, z).
53
*/
54
void
SetPosition(
const
glm::vec3& position);
55
56
/**
57
* @brief Sets the mesh rotation in degrees.
58
* @param rotation New rotation vector (pitch, yaw, roll), in degrees.
59
*/
60
void
SetRotation(
const
glm::vec3& rotation);
61
62
/**
63
* @brief Sets the mesh scale along each axis.
64
* @param scale New scale vector (x, y, z).
65
*/
66
void
SetScale(
const
glm::vec3& scale);
67
68
/**
69
* @brief Gets the mesh position.
70
*/
71
const
glm::vec3& GetPosition()
const
;
72
73
/**
74
* @brief Gets the mesh rotation (pitch, yaw, roll in degrees).
75
*/
76
const
glm::vec3& GetRotation()
const
;
77
78
/**
79
* @brief Gets the mesh scale.
80
*/
81
const
glm::vec3& GetScale()
const
;
82
83
/**
84
* @brief Access to the underlying SceneComponent (transform).
85
*/
86
SceneComponent
& GetTransform();
87
const
SceneComponent
& GetTransform()
const
;
88
///@}
89
90
/**
91
* @copydoc DrawableComponent::Destroy
92
*/
93
void
Destroy()
override
;
94
95
Drawable3D
(
const
Drawable3D
& rhs) =
delete
;
96
Drawable3D
&
operator=
(
const
Drawable3D
& rhs) =
delete
;
97
98
protected
:
99
SceneComponent
mSceneComponent
;
100
};
101
102
}
// namespace rendering_engine
rendering_engine::Camera
Represents a 3D perspective camera with world transform and projection settings.
Definition:
camera.hpp:48
rendering_engine::Drawable3D
3D drawable component for rendering objects in 3D space.
Definition:
drawable_3d.hpp:27
rendering_engine::Drawable3D::mSceneComponent
SceneComponent mSceneComponent
Definition:
drawable_3d.hpp:99
rendering_engine::Drawable3D::Drawable3D
Drawable3D(const Drawable3D &rhs)=delete
rendering_engine::Drawable3D::operator=
Drawable3D & operator=(const Drawable3D &rhs)=delete
rendering_engine::Drawable3D::Draw
virtual void Draw(const Camera &camera)=0
Submits this mesh to the renderer for drawing.
rendering_engine::DrawableComponent
Abstract base for all drawable (renderable) objects in the engine.
Definition:
drawable_component.hpp:48
rendering_engine::SceneComponent
Represents a 3D transformable scene component with position, rotation, and scale.
Definition:
scene_component.hpp:43
rendering_engine::Scene
Base class representing a renderable scene.
Definition:
scene.hpp:44
drawable_component.hpp
rendering_engine
Definition:
actor.hpp:13
rendering_engine_export.hpp
RE_API
#define RE_API
Definition:
rendering_engine_export.hpp:10
scene_component.hpp
rendering_engine::RenderResourceContext
Aggregates pointers to global rendering resource managers.
Definition:
render_resource_context.hpp:26
RenderingEngine
RenderingLibrary
Include
drawable_3d.hpp
Generated by
1.9.4