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
5
namespace
Nui::Systems
6
{
7
namespace
Events
8
{
12
struct
ForceTransformRecalculation
13
{
18
bool
IncludeDirty
=
true
;
19
};
20
}
21
26
class
TransformSystem
:
public
ECS::SystemBase
,
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
65
NUI_DECLARE_EVENT(
ECS::Events::OnComponentAdd<Components::Transform>
);
66
72
NUI_DECLARE_EVENT(
Events::ForceTransformRecalculation
);
73
};
74
}
Nui::ECS::Context
The ECS context class manages entities, systems, and events in the ECS framework.
Definition
Context.h:17
Nui::ECS::SystemBase
Base class for all ECS systems.
Definition
System.h:10
Nui::Systems::TransformSystem
ECS system that handles updating transform components.
Definition
TransformSystem.h:30
Nui::Systems::TransformSystem::OnInit
virtual void OnInit(ECS::Context *ctx) override
Initializes the system and subscribes to events.
Definition
TransformSystem.cpp:5
Nui::Systems::TransformSystem::OnShutdown
virtual void OnShutdown(ECS::Context *ctx) override
Shuts down the system and unsubscribes from events.
Definition
TransformSystem.cpp:26
Nui::Systems::TransformSystem::OnUpdate
virtual void OnUpdate(ECS::Context *ctx, const F64 dt) override
Updates the system.
Definition
TransformSystem.cpp:14
Nui::ECS::Events::OnComponentAdd
Event for when component is added.
Definition
Event.h:75
Nui::ECS::Events::OnEntityCreate
Event for entity creation.
Definition
Event.h:51
Nui::Systems::Events::ForceTransformRecalculation
Event for the TransformSystem to force a recalculation of the world matrix.
Definition
TransformSystem.h:13
Nui::Systems::Events::ForceTransformRecalculation::IncludeDirty
bool IncludeDirty
Whether to include dirty components in the recalculation (default: true)
Definition
TransformSystem.h:18
Engine
Core
Engine
Systems
TransformSystem.h
Generated by
1.11.0