Plasma Engine  2.0
Loading...
Searching...
No Matches
PathState.h
1#pragma once
2
3#include <Foundation/Containers/HashTable.h>
4#include <Foundation/Math/Math.h>
5#include <Utilities/UtilitiesDLL.h>
6
9{
10 PL_DECLARE_POD_TYPE();
11
13 {
15 m_fCostToNode = 0.0f;
17 }
18
21
25
33};
34
35template <typename PathStateType>
36class plPathSearch;
37
49template <typename PathStateType>
51{
52public:
58 virtual void GenerateAdjacentStates(plInt64 iNodeIndex, const PathStateType& StartState, plPathSearch<PathStateType>* pPathSearch) = 0;
59
62 virtual void StartSearchForClosest(plInt64 iStartNodeIndex, const PathStateType* pStartState) {}
63
66 virtual void StartSearch(plInt64 iStartNodeIndex, const PathStateType* pStartState, plInt64 iTargetNodeIndex) {}
67
70 virtual void SearchFinished(plResult res) {}
71};
Implements a directed breadth-first search through a graph (A*).
Definition GraphSearch.h:16
The base class for all path state generates.
Definition PathState.h:51
virtual void StartSearchForClosest(plInt64 iStartNodeIndex, const PathStateType *pStartState)
Automatically called by plPathSearch objects when a new path search is about to start (plPathSearch::...
Definition PathState.h:62
virtual void GenerateAdjacentStates(plInt64 iNodeIndex, const PathStateType &StartState, plPathSearch< PathStateType > *pPathSearch)=0
Called by a plPathSearch object to generate the adjacent states from graph node iNodeIndex.
virtual void SearchFinished(plResult res)
Automatically called by plPathSearch objects when a path search was finished. Allows the generator to...
Definition PathState.h:70
virtual void StartSearch(plInt64 iStartNodeIndex, const PathStateType *pStartState, plInt64 iTargetNodeIndex)
Automatically called by plPathSearch objects when a new path search is about to start (plPathSearch::...
Definition PathState.h:66
Base class for all path finding state objects.
Definition PathState.h:9
float m_fEstimatedCostToTarget
Definition PathState.h:32
plInt64 m_iReachedThroughNode
Initialized by the path searcher. Back-pointer to the node from which this node was reached.
Definition PathState.h:20
float m_fCostToNode
Definition PathState.h:24
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54