3#include <Core/Messages/EventMessage.h>
4#include <Core/World/Component.h>
5#include <Core/World/ComponentManager.h>
6#include <GameEngine/Animation/PathComponent.h>
7#include <GameEngine/Animation/PropertyAnimResource.h>
17 using StorageType = plUInt8;
25 Default = OnlyPosition
53 virtual void SerializeComponent(
plWorldWriter& ref_stream)
const override;
54 virtual void DeserializeComponent(
plWorldReader& ref_stream)
override;
57 virtual void OnActivated()
override;
58 virtual void OnSimulationStarted()
override;
68 void SetPathObject(
const char* szReference);
72 float m_fSpeed = 1.0f;
73 float m_fLookAhead = 1.0f;
74 float m_fSmoothing = 0.5f;
75 float m_fTiltAmount = 5.0f;
79 void SetDistanceAlongPath(
float fDistance);
80 float GetDistanceAlongPath()
const;
83 void SetDirectionForwards(
bool bForwards);
86 void ToggleDirection();
91 bool IsDirectionForwards()
const;
94 bool IsRunning()
const;
97 void SetRunning(
bool bRunning);
100 void Update(
bool bForce =
false);
106 float m_fStartDistance = 0.0f;
107 bool m_bLastStateValid =
false;
108 bool m_bIsRunning =
true;
109 bool m_bIsRunningForwards =
true;
111 plVec3 m_vLastTargetPosition;
115 const char* DummyGetter()
const {
return nullptr; }
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
static constexpr plAngle MakeFromDegree(float fDegree)
Creates an instance of plAngle that was initialized from degree. (Performs a conversion)
Definition Angle_inl.h:33
Base class of all component types.
Definition Component.h:25
Simple component manager implementation that calls an update method on all components every frame.
Definition ComponentManager.h:142
A message sender that sends all messages to the next component derived from plEventMessageHandlerComp...
Definition EventMessage.h:39
This component makes the plGameObject, that it is attached to, move along a path defined by an plPath...
Definition FollowPathComponent.h:46
plEnum< plPropertyAnimMode > m_Mode
[ property ] How the path should be traversed.
Definition FollowPathComponent.h:70
plEnum< plFollowPathMode > m_FollowMode
[ property ] How the transform of the follower should be affected by the path.
Definition FollowPathComponent.h:71
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
Definition FollowPathComponent.h:16
A handle to a game object.
Definition Declarations.h:76
Sent when an animation reached its end (either forwards or backwards playing)
Definition CommonMessages.h:42
An object that keeps track of where one is sampling the path component.
Definition PathComponent.h:130