3#include <AiPlugin/AiPluginDLL.h>
4#include <AiPlugin/Navigation/Navigation.h>
5#include <AiPlugin/Navigation/Steering.h>
6#include <Core/World/Component.h>
7#include <Core/World/World.h>
9PL_DECLARE_FLAGS(plUInt32, plAiNavigationDebugFlags, PrintState, VisPathCorridor, VisPathLine, VisTarget);
10PL_DECLARE_REFLECTABLE_TYPE(PL_AIPLUGIN_DLL, plAiNavigationDebugFlags);
15 using StorageType = plUInt8;
71 void SetDestination(
const plVec3& vGlobalPos,
bool bAllowPartialPath);
74 void CancelNavigation();
79 float m_fReachedDistance = 1.0f;
80 float m_fSpeed = 5.0f;
81 float m_fFootRadius = 0.15f;
82 plUInt32 m_uiCollisionLayer = 0;
83 float m_fFallHeight = 0.7f;
84 float m_fAcceleration = 3.0f;
85 float m_fDecceleration = 8.0f;
95 void PlaceOnGround(
plTransform& transform,
float tDiff);
100 float m_fFallSpeed = 0.0f;
101 bool m_bAllowPartialPath =
false;
102 plUInt8 m_uiSkipNextFrames = 0;
105 const char* DummyGetter()
const {
return nullptr; }
Adds functionality to navigate on a navmesh.
Definition NavigationComponent.h:46
plHashedString m_sNavmeshConfig
[ property ] Which navmesh to walk on.
Definition NavigationComponent.h:76
plHashedString m_sPathSearchConfig
[ property ] What constraints there are for walking on the navmesh.
Definition NavigationComponent.h:77
plBitflags< plAiNavigationDebugFlags > m_DebugFlags
[ property ] What aspects of the navigation to visualize.
Definition NavigationComponent.h:87
plEnum< plAiNavigationComponentState > GetState() const
Returns the current navigation state.
Definition NavigationComponent.h:90
Computes a path through a navigation mesh.
Definition Navigation.h:41
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
Simple component manager implementation that calls an update method on all components every frame.
Definition ComponentManager.h:142
This class is optimized to take nearly no memory (sizeof(void*)) and to allow very fast checks whethe...
Definition HashedString.h:25
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
Describes the different states a navigating object may be in.
Definition NavigationComponent.h:14
Enum
Definition NavigationComponent.h:18
@ Fallen
Was high up, now reached the ground. May happen if spawned in air, otherwise should never happen,...
Definition NavigationComponent.h:22
@ Moving
Moving or waiting for a path to be computed.
Definition NavigationComponent.h:20
@ Falling
High up above the ground, falling downwards.
Definition NavigationComponent.h:21
@ Failed
Path could not be found, either because start position is invalid (off mesh) or destination is not re...
Definition NavigationComponent.h:23
@ Idle
Currently not navigating.
Definition NavigationComponent.h:19
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