Plasma Engine  2.0
Loading...
Searching...
No Matches
SliderComponent.h
1#pragma once
2
3#include <GameEngine/GameEngineDLL.h>
4
5#include <GameEngine/Animation/TransformComponent.h>
6
8
12class PL_GAMEENGINE_DLL plSliderComponent : public plTransformComponent
13{
15
17 // plComponent
18
19public:
20 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
21 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
22
23protected:
24 virtual void OnSimulationStarted() override;
25
27 // plSliderComponent
28
29public:
32
34 float m_fDistanceToTravel = 1.0f; // [ property ]
35
37 float m_fAcceleration = 0.0f; // [ property ]
38
40 float m_fDeceleration = 0.0; // [ property ]
41
43 plEnum<plBasisAxis> m_Axis = plBasisAxis::PositiveZ; // [ property ]
44
46 plTime m_RandomStart; // [ property ]
47
48protected:
49 void Update();
50
51 float m_fLastDistance = 0.0f;
52};
Simple component manager implementation that calls an update method on all components every frame.
Definition ComponentManager.h:142
Applies a sliding transform to the game object that it is attached to.
Definition SliderComponent.h:13
plTime m_RandomStart
If non-zero, the slider starts at a random offset as if it had already been moving for up to this amo...
Definition SliderComponent.h:46
Base class for some components that modify an object's transform.
Definition TransformComponent.h:38
virtual void SerializeComponent(plWorldWriter &inout_stream) const override
Override this to save the current state of the component to the given stream.
Definition TransformComponent.cpp:36
virtual void DeserializeComponent(plWorldReader &inout_stream) override
Override this to load the current state of the component from the given stream.
Definition TransformComponent.cpp:46
virtual void OnSimulationStarted() override
This method is called once for active components, at the start of the next world update,...
Definition TransformComponent.cpp:59
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
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12