Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
Loading...
Searching...
No Matches
drawable_2d.cpp
Go to the documentation of this file.
1#include "drawable_2d.hpp"
3
4namespace rendering_engine
5{
7 :
8 DrawableComponent(renderContext)
9{}
10
15
16void Drawable2D::Update(float deltaTime)
17{
18 mSceneComponent.UpdateModelMatrix();
19}
20
21void Drawable2D::SetPosition(const glm::vec2& position)
22{
23 mSceneComponent.SetPosition(position);
24}
25
26void Drawable2D::SetRotation(float angleDegrees)
27{
28 mSceneComponent.SetRotation(angleDegrees);
29}
30
31void Drawable2D::SetScale(const glm::vec2& scale)
32{
33 mSceneComponent.SetScale(scale);
34}
35
36const glm::vec2& Drawable2D::GetPosition() const
37{
38 return mSceneComponent.GetPosition();
39}
40
42{
43 return mSceneComponent.GetRotation();
44}
45
46const glm::vec2& Drawable2D::GetScale() const
47{
48 return mSceneComponent.GetScale();
49}
50
55
60
61
62} // namespace rendering_engine
SceneComponent2D & GetTransform()
Access to the underlying SceneComponent2D (transform).
Drawable2D(RenderResourceContext renderContext)
Constructs the Drawable2D with a resource context.
const glm::vec2 & GetScale() const
Gets the quad scale.
void Update(float deltaTime) override
Updates model matrix (and any other logic).
SceneComponent2D mSceneComponent
void Initialize() override
Initializes render resources.
float GetRotation() const
Gets the quad rotation angle (degrees).
void SetPosition(const glm::vec2 &position)
Sets the quad position in 2D space.
void SetRotation(float angleDegrees)
Sets the quad rotation.
void SetScale(const glm::vec2 &scale)
Sets the quad scale along each axis.
const glm::vec2 & GetPosition() const
Gets the quad position.
virtual void Initialize()
Initializes render resource pointers (material, mesh, etc.). Must be called after setting material an...
DrawableComponent(RenderResourceContext renderContext)
Constructs the DrawableComponent with a resource context.
Represents a 2D transformable scene component with position, rotation, and scale.
Aggregates pointers to global rendering resource managers.