Nui Engine
A game engine framework
Loading...
Searching...
No Matches
TransformSystem.h
1#pragma once
2#include "Core/Engine/Components/TransformComponent.h"
3#include "Core/Engine/ECS/ECS.h"
4
5namespace Nui::Systems
6{
7 namespace Events
8 {
13 {
18 bool IncludeDirty = true;
19 };
20 }
21
27 NUI_EVENT_SUBSCRIBER(ECS::Events::OnEntityCreate),
28 NUI_EVENT_SUBSCRIBER(ECS::Events::OnComponentAdd<Components::Transform>),
29 NUI_EVENT_SUBSCRIBER(Events::ForceTransformRecalculation)
30 {
31 public:
36 virtual void OnInit(ECS::Context* ctx) override;
37
43 virtual void OnUpdate(ECS::Context* ctx, const F64 dt) override;
44
49 virtual void OnShutdown(ECS::Context* ctx) override;
50
51 private:
58 NUI_DECLARE_EVENT(ECS::Events::OnEntityCreate);
59
66
72 NUI_DECLARE_EVENT(Events::ForceTransformRecalculation);
73 };
74}
The ECS context class manages entities, systems, and events in the ECS framework.
Definition Context.h:17
Base class for all ECS systems.
Definition System.h:10
ECS system that handles updating transform components.
Definition TransformSystem.h:30
virtual void OnInit(ECS::Context *ctx) override
Initializes the system and subscribes to events.
Definition TransformSystem.cpp:5
virtual void OnShutdown(ECS::Context *ctx) override
Shuts down the system and unsubscribes from events.
Definition TransformSystem.cpp:26
virtual void OnUpdate(ECS::Context *ctx, const F64 dt) override
Updates the system.
Definition TransformSystem.cpp:14
Event for when component is added.
Definition Event.h:75
Event for entity creation.
Definition Event.h:51
Event for the TransformSystem to force a recalculation of the world matrix.
Definition TransformSystem.h:13
bool IncludeDirty
Whether to include dirty components in the recalculation (default: true)
Definition TransformSystem.h:18