Rendering Engine 0.2.9
Modular Graphics Rendering Engine | v0.2.9
drawable_3d.cpp
Go to the documentation of this file.
1#include "drawable_3d.hpp"
3#include "scene.hpp"
4
5namespace rendering_engine
6{
8 DrawableComponent(renderContext, scene)
9{}
10
12{
14}
15
16void Drawable3D::Update(float deltaTime)
17{
18 if (bUpdateOnTick)
19 {
21 }
22}
23
24void Drawable3D::SetPosition(const glm::vec3& position)
25{
27}
28
29void Drawable3D::SetRotation(const glm::vec3& rotation)
30{
32}
33
34void Drawable3D::SetScale(const glm::vec3& scale)
35{
37}
38
39const glm::vec3& Drawable3D::GetPosition() const
40{
42}
43
44const glm::vec3& Drawable3D::GetRotation() const
45{
47}
48
49const glm::vec3& Drawable3D::GetScale() const
50{
52}
53
55{
56 return mSceneComponent;
57}
58
60{
61 return mSceneComponent;
62}
63
65{
67}
68
69} // namespace rendering_engine
void Destroy() override
Requests destruction of this drawable.
Definition: drawable_3d.cpp:64
SceneComponent mSceneComponent
Definition: drawable_3d.hpp:99
void Initialize() override
Initializes render resource pointers (material, mesh, etc.). Must be called after setting material an...
Definition: drawable_3d.cpp:11
const glm::vec3 & GetRotation() const
Gets the mesh rotation (pitch, yaw, roll in degrees).
Definition: drawable_3d.cpp:44
SceneComponent & GetTransform()
Access to the underlying SceneComponent (transform).
Definition: drawable_3d.cpp:54
const glm::vec3 & GetScale() const
Gets the mesh scale.
Definition: drawable_3d.cpp:49
void SetRotation(const glm::vec3 &rotation)
Sets the mesh rotation in degrees.
Definition: drawable_3d.cpp:29
Drawable3D(RenderResourceContext renderContext, Scene &scene)
Constructs the Drawable3D with a render context.
Definition: drawable_3d.cpp:7
void SetScale(const glm::vec3 &scale)
Sets the mesh scale along each axis.
Definition: drawable_3d.cpp:34
void SetPosition(const glm::vec3 &position)
Sets the mesh position in world space.
Definition: drawable_3d.cpp:24
const glm::vec3 & GetPosition() const
Gets the mesh position.
Definition: drawable_3d.cpp:39
void Update(float deltaTime) override
Updates logic (animation, movement, etc.) for this drawable.
Definition: drawable_3d.cpp:16
Abstract base for all drawable (renderable) objects in the engine.
virtual void Initialize()
Initializes render resource pointers (material, mesh, etc.). Must be called after setting material an...
Represents a 3D transformable scene component with position, rotation, and scale.
const glm::vec3 & GetPosition() const
Gets the current position.
const glm::vec3 & GetRotation() const
Gets the current rotation as Euler angles (in radians).
void SetRotation(const glm::quat &rotation)
Sets the rotation using a quaternion.
void SetPosition(const glm::vec3 &position)
Sets the position of the component in world space.
const glm::vec3 & GetScale() const
Gets the current scale.
void SetScale(const glm::vec3 &scale)
Sets the scale for each dimension.
Base class representing a renderable scene.
Definition: scene.hpp:44
void DestroyDrawable3D(Drawable3D *drawable3D)
Schedules a 3D drawable for deferred destruction.
Definition: scene.cpp:149
Aggregates pointers to global rendering resource managers.