Plasma Engine  2.0
Loading...
Searching...
No Matches
AgentSteeringComponent.h
1#pragma once
2
3#include <Core/World/Component.h>
4#include <Core/World/World.h>
5#include <Foundation/Communication/Event.h>
6#include <RecastPlugin/RecastPluginDLL.h>
7
25
27{
28 using StorageType = plUInt8;
29
30 enum Enum
31 {
32 HasNoTarget,
33 HasTargetWaitingForPath,
34 HasTargetPathFindingFailed,
35 HasTargetAndValidPath,
36
37 Default = HasNoTarget
38 };
39};
40
43class PL_RECASTPLUGIN_DLL plAgentSteeringComponent : public plComponent
44{
45 PL_DECLARE_ABSTRACT_COMPONENT_TYPE(plAgentSteeringComponent, plComponent);
46
48 // plComponent
49
50public:
51 virtual void SerializeComponent(plWorldWriter& inout_stream) const override;
52 virtual void DeserializeComponent(plWorldReader& inout_stream) override;
53
55 // plAgentSteeringComponent
56
57public:
60
61 virtual void SetTargetPosition(const plVec3& vPosition) = 0; // [ scriptable ]
62 virtual plVec3 GetTargetPosition() const = 0; // [ scriptable ]
63 virtual void ClearTargetPosition() = 0; // [ scriptable ]
64 virtual plAgentPathFindingState::Enum GetPathToTargetState() const = 0;
65
67};
Base class for components that implement 'agent steering' behavior. If, moving from point A to point ...
Definition AgentSteeringComponent.h:44
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 DeserializeComponent(plWorldReader &inout_stream)
Override this to load the current state of the component from the given stream.
Definition Component.cpp:58
Definition Event.h:177
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
Definition AgentSteeringComponent.h:27
Definition AgentSteeringComponent.h:9
Type
Definition AgentSteeringComponent.h:11
@ WarningNoFullPathToTarget
Path-finding resulted in a partial path, so one can get closer to it, but the target cannot be reache...
Definition AgentSteeringComponent.h:17
@ ErrorOutsideNavArea
The current agent position is outside valid navigation area.
Definition AgentSteeringComponent.h:18
@ TargetCleared
The agent's target location was cleared and it is now not moving further.
Definition AgentSteeringComponent.h:13
@ PathToTargetFound
Path-finding was successful, agent will follow the path now.
Definition AgentSteeringComponent.h:14
@ TargetReached
The agent reached the current target location.
Definition AgentSteeringComponent.h:12
@ ErrorSteeringFailed
Some generic error.
Definition AgentSteeringComponent.h:19
@ ErrorNoPathToTarget
Path-finding failed, the target location cannot be reached.
Definition AgentSteeringComponent.h:16
@ ErrorInvalidTargetPosition
The target position cannot be reached because it is not inside the navigation area.
Definition AgentSteeringComponent.h:15