11 #include "../FastRandom.h" 12 #ifdef COMPILING_PATHFIND_DEBUGGER 15 #include "PathFinderIrrlicht_Head.h" 18 #include <unordered_map> 81 const Vector3d & a_StartingPoint,
const Vector3d & a_EndingPoint,
int a_MaxSteps,
82 double a_BoundingBoxWidth,
double a_BoundingBoxHeight
92 cPath & operator=(
const cPath & a_other) =
delete;
114 ASSERT(m_CurrentPoint < m_PathPoints.size());
115 Vector3i Point = m_PathPoints[m_PathPoints.size() - 1 - m_CurrentPoint];
117 return Vector3d(Point.x + m_HalfWidth, Point.y, Point.z + m_HalfWidth);
125 return (m_CurrentPoint == m_PathPoints.size());
132 return (m_CurrentPoint == 0);
147 return m_PathPoints.size() - m_CurrentPoint;
157 void FinishCalculation();
159 void AttemptToFindAlternative();
165 bool ProcessIfWalkable(
const Vector3i & a_Location,
cPathCell * a_Source,
int a_Cost);
173 std::unordered_map<Vector3i, cPathCell, VectorHasher<int>>
m_Map;
191 void FillCellAttributes(
cPathCell & a_Cell);
198 bool BlockTypeIsSpecial(
BLOCKTYPE a_Type);
200 bool HasSolidBelow(
const Vector3i & a_Location);
201 #ifdef COMPILING_PATHFIND_DEBUGGER 202 #include "../path_irrlicht.cpp"
unsigned char BLOCKTYPE
The datatype used by blockdata.
size_t WayPointsLeft() const
The amount of waypoints left to return.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
std::unordered_map< Vector3i, cPathCell, VectorHasher< int > > m_Map
ePathFinderStatus m_Status
std::priority_queue< cPathCell *, std::vector< cPathCell * >, compareHeuristics > m_OpenList
Vector3< double > Vector3d
bool IsValid() const
Returns true if this path is properly initialized.
cPathCell * m_NearestPointToTarget
Vector3d GetNextPoint()
Returns the next point in the path.
The pathfinder has 3 types of cells (cPathCell).
bool NoMoreWayPoints() const
Checks if we have no more waypoints to return.
std::vector< Vector3i > m_PathPoints
bool IsFirstPoint() const
Returns true if GetNextPoint() was never called for this Path.