3#include <Core/Messages/EventMessage.h>
4#include <Core/World/Component.h>
5#include <Core/World/ComponentManager.h>
6#include <Foundation/Types/Bitflags.h>
7#include <GameEngine/GameEngineDLL.h>
8#include <RendererCore/RendererCoreDLL.h>
15PL_DECLARE_FLAGS(plUInt32, plPathComponentFlags, VisualizePath, VisualizeUpDir);
16PL_DECLARE_REFLECTABLE_TYPE(PL_GAMEENGINE_DLL, plPathComponentFlags);
62 virtual void SerializeComponent(
plWorldWriter& ref_stream)
const override;
63 virtual void DeserializeComponent(
plWorldReader& ref_stream)
override;
66 virtual void OnActivated()
override;
67 virtual void OnDeactivated()
override;
80 void SetClosed(
bool bClosed);
81 bool GetClosed()
const {
return m_bClosed; }
100 void EnsureControlPointRepresentationIsUpToDate();
114 void EnsureLinearizedRepresentationIsUpToDate();
137 float m_fSegmentFraction = 0.0f;
138 plUInt32 m_uiSegmentNode = 0;
145 void SetLinearSamplerTo(
LinearSampler& ref_sampler,
float fDistance)
const;
150 bool AdvanceLinearSamplerBy(
LinearSampler& ref_sampler,
float& inout_fAddDistance)
const;
162 void SetLinearizationError(
float fError);
163 float GetLinearizationError()
const {
return m_fLinearizationError; }
166 plUInt32 Nodes_GetCount()
const {
return m_Nodes.GetCount(); }
167 const plString& Nodes_GetNode(plUInt32 i)
const {
return m_Nodes[i]; }
168 void Nodes_SetNode(plUInt32 i,
const plString& node);
169 void Nodes_Insert(plUInt32 uiIndex,
const plString& node);
170 void Nodes_Remove(plUInt32 uiIndex);
175 void DrawDebugVisualizations();
178 float m_fLinearizationError = 0.05f;
179 float m_fLinearizedLength = 0.0f;
180 bool m_bDisableControlPointUpdates =
false;
181 bool m_bControlPointsChanged =
true;
182 bool m_bLinearizedRepresentationChanged =
true;
183 bool m_bClosed =
false;
196 using StorageType = plUInt8;
229 plAngle GetRoll()
const {
return m_Roll; }
241 virtual void OnActivated()
override;
242 virtual void OnDeactivated()
override;
Float wrapper struct for a safe usage and conversions of angles.
Definition Angle.h:10
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
Base class of all component types.
Definition Component.h:25
Definition ComponentManager.h:88
Definition DynamicArray.h:81
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Describes a path shape.
Definition PathComponent.h:55
float GetLinearizedRepresentationLength() const
Returns the total length of the linearized path representation.
Definition PathComponent.h:120
const plArrayPtr< const plPathComponent::LinearizedElement > GetLinearizedRepresentation() const
Grants access to the linearized representation that define the path's shape.
Definition PathComponent.h:117
void SetDisableControlPointUpdates(bool bDisable)
Forces that the current control point state is never updated in the future. Used as a work-around dur...
Definition PathComponent.h:123
const plArrayPtr< const plPathComponent::ControlPoint > GetControlPointRepresentation() const
Grants access to the control points that define the path's shape.
Definition PathComponent.h:103
Definition PathComponent.h:28
void Initialize() override
This method is called after the constructor. A derived type can override this method to do initializa...
Definition PathComponent.cpp:845
Attach this to child object of an plPathComponent to turn them into viable path nodes.
Definition PathComponent.h:217
Interface for binary in (read) streams.
Definition Stream.h:22
Interface for binary out (write) streams.
Definition Stream.h:107
static plVec3Template< float > MakeZero()
Definition Vec3.h:38
static plVec3Template< float > MakeAxisZ()
Definition Vec3.h:47
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
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
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
A custom enum implementation that allows to define the underlying storage type to control its memory ...
Definition Enum.h:37
Base class for all messages that are sent as 'events'.
Definition EventMessage.h:8
Definition HierarchyChangedMessages.h:7
Definition PathComponent.h:21
The 'raw' data for a single path control point.
Definition PathComponent.h:89
An object that keeps track of where one is sampling the path component.
Definition PathComponent.h:130
If the path is linearized, this represents a single sample point.
Definition PathComponent.h:108
The different modes that tangents may use in a path node.
Definition PathComponent.h:195
Enum
Definition PathComponent.h:199
@ Auto
The curvature through the node is automatically computed to be smooth.
Definition PathComponent.h:200
@ Linear
There is no curvature through this node/tangent. Creates sharp corners.
Definition PathComponent.h:201
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54
Definition WorldModule.h:33