Plasma Engine  2.0
Loading...
Searching...
No Matches
ResetTransformComponent.h
1#pragma once
2
3#include <Core/World/Component.h>
4#include <Core/World/World.h>
5#include <GameEngine/GameEngineDLL.h>
6
8
18class PL_GAMEENGINE_DLL plResetTransformComponent : public plComponent
19{
21
23 // plComponent
24
25public:
26 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
27 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
28
29protected:
30 virtual void OnSimulationStarted() override;
31
33 // plResetTransformComponent
34
35public:
38
39 plVec3 m_vLocalPosition = plVec3::MakeZero();
40 plQuat m_qLocalRotation = plQuat::MakeIdentity();
41 plVec3 m_vLocalScaling = plVec3(1, 1, 1);
42 float m_fLocalUniformScaling = 1.0f;
43
44 bool m_bResetLocalPositionX = true;
45 bool m_bResetLocalPositionY = true;
46 bool m_bResetLocalPositionZ = true;
47 bool m_bResetLocalRotation = true;
48 bool m_bResetLocalScaling = true;
49};
Base class of all component types.
Definition Component.h:25
virtual void SerializeComponent(plWorldWriter &inout_stream) const
Override this to save the current state of the component to the given stream.
Definition Component.cpp:54
virtual void OnSimulationStarted()
This method is called once for active components, at the start of the next world update,...
Definition Component.cpp:144
virtual void DeserializeComponent(plWorldReader &inout_stream)
Override this to load the current state of the component from the given stream.
Definition Component.cpp:58
Definition ComponentManager.h:88
static const plQuatTemplate< float > MakeIdentity()
Definition Quat_inl.h:29
This component sets the local transform of its owner to known values when the simulation starts.
Definition ResetTransformComponent.h:19
static plVec3Template< float > MakeZero()
Definition Vec3.h:38
Reads a world description from a stream. Allows to instantiate that world multiple times in different...
Definition WorldReader.h:47
Stores an entire plWorld in a stream.
Definition WorldWriter.h:13