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
10#include "scene_component.hpp"
11
12namespace rendering_engine
13{
14class 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 */
27{
28public:
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
98protected:
100};
101
102} // namespace rendering_engine
Represents a 3D perspective camera with world transform and projection settings.
Definition: camera.hpp:48
3D drawable component for rendering objects in 3D space.
Definition: drawable_3d.hpp:27
SceneComponent mSceneComponent
Definition: drawable_3d.hpp:99
Drawable3D(const Drawable3D &rhs)=delete
Drawable3D & operator=(const Drawable3D &rhs)=delete
virtual void Draw(const Camera &camera)=0
Submits this mesh to the renderer for drawing.
Abstract base for all drawable (renderable) objects in the engine.
Represents a 3D transformable scene component with position, rotation, and scale.
Base class representing a renderable scene.
Definition: scene.hpp:44
#define RE_API
Aggregates pointers to global rendering resource managers.