Rendering Engine 0.2.9
Modular Graphics Rendering Engine | v0.2.9
Loading...
Searching...
No Matches
drawable_2d.cpp
Go to the documentation of this file.
1#include "drawable_2d.hpp"
3#include "scene.hpp"
4
5namespace rendering_engine
6{
8 :
9 DrawableComponent(renderContext, scene)
10{}
11
16
17void Drawable2D::Update(float deltaTime)
18{
19 if (bUpdateOnTick)
20 {
22 }
23}
24
25void Drawable2D::SetPosition(const glm::vec2& position)
26{
28}
29
30void Drawable2D::SetRotation(float angleDegrees)
31{
32 mSceneComponent.SetRotation(angleDegrees);
33}
34
35void Drawable2D::SetScale(const glm::vec2& scale)
36{
38}
39
40const glm::vec2& Drawable2D::GetPosition() const
41{
43}
44
46{
48}
49
50const glm::vec2& Drawable2D::GetScale() const
51{
53}
54
59
64
69
70} // namespace rendering_engine
SceneComponent2D & GetTransform()
Access to the underlying SceneComponent2D (transform).
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.
void Destroy() override
Requests destruction of this drawable.
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.
Drawable2D(RenderResourceContext renderContext, Scene &scene)
Constructs the Drawable2D with a resource context.
void SetScale(const glm::vec2 &scale)
Sets the quad scale along each axis.
const glm::vec2 & GetPosition() const
Gets the quad position.
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 hierarchical 2D transform component.
const glm::vec2 & GetScale() const
Gets the current scale.
void UpdateWorldMatrix()
Recomputes the world transformation matrix.
const glm::vec2 & GetPosition() const
Gets the current position.
void SetScale(const glm::vec2 &scale)
Sets the scale in each dimension.
float GetRotation() const
Gets the current rotation angle (in degrees).
void SetRotation(float angleDegrees)
Sets the rotation angle in degrees.
void SetPosition(const glm::vec2 &position)
Sets the local position of this component.
Base class representing a renderable scene.
Definition scene.hpp:44
void DestroyDrawable2D(Drawable2D *drawable2D)
Schedules a 2D drawable for deferred destruction.
Definition scene.cpp:154
Aggregates pointers to global rendering resource managers.