5 #define WAYPOINT_RADIUS 0.5
unsigned char BLOCKTYPE
The datatype used by blockdata.
Vector3d m_DeviationOrigin
When FinalDestination is too far from this, we recalculate.
std::unique_ptr< cPath > m_Path
The current cPath instance we have.
ePathFinderStatus GetNextWayPoint(cChunk &a_Chunk, const Vector3d &a_Source, Vector3d *a_Destination, Vector3d *a_OutputWaypoint, bool a_DontCare=false)
Updates the PathFinder's internal state and returns a waypoint.
bool IsWaterOrSolid(BLOCKTYPE a_BlockType)
Return true the the blocktype is either water or solid.
Vector3d m_PathDestination
Coordinates for where we are practically going.
int m_GiveUpCounter
If 0, will give up reaching the next m_WayPoint and will recalculate path.
float m_Height
The height of the Mob which owns this PathFinder.
bool m_NoPathToTarget
True if there's no path to target and we're walking to a nearby location instead.
Vector3d m_WayPoint
Coordinates of the next position that should be reached.
cPathFinder(float a_MobWidth, float a_MobHeight)
Creates a cPathFinder instance.
Vector3d m_Source
Coordinates for where the mob is currently at.
bool PathIsTooOld() const
Is the path too old and should be recalculated? When this is true ResetPathFinding() is called.
int m_NotFoundCooldown
When a path is not found, this cooldown prevents any recalculations for several ticks.
float m_Width
The width of the Mob which owns this PathFinder.
Vector3d m_FinalDestination
Coordinates for where we should go.
bool EnsureProperPoint(Vector3d &a_Vector, cChunk &a_Chunk)
Ensures the location is not in the air or under water.
void ResetPathFinding(cChunk &a_Chunk)
Resets a pathfinding task, typically because m_FinalDestination has deviated too much from m_Deviatio...