#include <Path.h>
Definition at line 68 of file Path.h.
◆ cPath() [1/4]
cPath::cPath |
( |
cChunk & |
a_Chunk, |
|
|
const Vector3d & |
a_StartingPoint, |
|
|
const Vector3d & |
a_EndingPoint, |
|
|
int |
a_MaxSteps, |
|
|
double |
a_BoundingBoxWidth, |
|
|
double |
a_BoundingBoxHeight |
|
) |
| |
Creates a pathfinder instance.
After calling this, you are expected to call CalculationStep() once per tick or once per several ticks until it returns something other than CALCULATING.
- Parameters
-
a_StartingPoint | The function expects this position to be the lowest block the mob is in, a rule of thumb: "The block where the Zombie's knees are at". |
a_EndingPoint | "The block where the Zombie's knees want to be". |
a_MaxSteps | The maximum steps before giving up. |
a_BoundingBoxWidth | the character's boundingbox width in blocks. Currently the parameter is ignored and 1 is assumed. |
a_BoundingBoxHeight | the character's boundingbox width in blocks. Currently the parameter is ignored and 2 is assumed. |
Definition at line 32 of file Path.cpp.
◆ cPath() [2/4]
Creates an invalid path which is not usable.
You shouldn't call any method other than isValid on such a path.
Definition at line 75 of file Path.cpp.
◆ cPath() [3/4]
cPath::cPath |
( |
const cPath & |
a_other | ) |
|
|
delete |
delete default constructors
◆ cPath() [4/4]
cPath::cPath |
( |
cPath && |
a_other | ) |
|
|
delete |
◆ AcceptNearbyPath()
Called after the PathFinder's step returns NEARBY_FOUND.
Changes the PathFinder status from NEARBY_FOUND to PATH_FOUND, returns the nearby destination that the PathFinder found a path to.
Definition at line 123 of file Path.cpp.
◆ AttemptToFindAlternative()
void cPath::AttemptToFindAlternative |
( |
| ) |
|
|
private |
◆ BlockTypeIsSpecial()
bool cPath::BlockTypeIsSpecial |
( |
BLOCKTYPE |
a_Type | ) |
|
|
private |
◆ BodyFitsIn()
bool cPath::BodyFitsIn |
( |
const Vector3i & |
a_Location, |
|
|
const Vector3i & |
a_Source |
|
) |
| |
|
private |
◆ BuildPath()
void cPath::BuildPath |
( |
| ) |
|
|
private |
◆ CalculationStep()
Performs part of the path calculation and returns the appropriate status.
If PATH_FOUND is returned, the path was found, and you can call query the instance for waypoints via GetNextWayPoint, etc. If NEARBY_FOUND is returned, it means that the destination is not reachable, but a nearby destination is reachable. If the user likes the alternative destination, they can call AcceptNearbyPath to treat the path as found, and to make consequent calls to step return PATH_FOUND If PATH_NOT_FOUND is returned, then no path was found.
Definition at line 84 of file Path.cpp.
◆ FillCellAttributes()
void cPath::FillCellAttributes |
( |
cPathCell & |
a_Cell | ) |
|
|
private |
◆ FinishCalculation() [1/2]
void cPath::FinishCalculation |
( |
| ) |
|
|
private |
◆ FinishCalculation() [2/2]
◆ GetCell()
◆ GetNextPoint()
Returns the next point in the path.
Definition at line 112 of file Path.h.
◆ HasSolidBelow()
bool cPath::HasSolidBelow |
( |
const Vector3i & |
a_Location | ) |
|
|
private |
◆ IsFirstPoint()
bool cPath::IsFirstPoint |
( |
| ) |
const |
|
inline |
◆ IsValid()
bool cPath::IsValid |
( |
void |
| ) |
const |
|
inline |
Returns true if this path is properly initialized.
Returns false if this path was initialized with an empty constructor. If false, the path is unusable and you should not call any methods.
Definition at line 139 of file Path.h.
◆ IsWalkable()
bool cPath::IsWalkable |
( |
const Vector3i & |
a_Location, |
|
|
const Vector3i & |
a_Source |
|
) |
| |
|
private |
◆ NoMoreWayPoints()
bool cPath::NoMoreWayPoints |
( |
| ) |
const |
|
inline |
Checks if we have no more waypoints to return.
Never call getnextPoint when this is true.
Definition at line 123 of file Path.h.
◆ OpenListAdd()
void cPath::OpenListAdd |
( |
cPathCell * |
a_Cell | ) |
|
|
private |
◆ OpenListPop()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ ProcessCell()
◆ ProcessIfWalkable()
bool cPath::ProcessIfWalkable |
( |
const Vector3i & |
a_Location, |
|
|
cPathCell * |
a_Source, |
|
|
int |
a_Cost |
|
) |
| |
|
private |
◆ SpecialIsSolidFromThisDirection()
◆ StepOnce()
◆ WayPointsLeft()
size_t cPath::WayPointsLeft |
( |
| ) |
const |
|
inline |
The amount of waypoints left to return.
Definition at line 145 of file Path.h.
◆ m_BadChunkFound
bool cPath::m_BadChunkFound |
|
private |
◆ m_BoundingBoxHeight
int cPath::m_BoundingBoxHeight |
|
private |
◆ m_BoundingBoxWidth
int cPath::m_BoundingBoxWidth |
|
private |
◆ m_Chunk
◆ m_CurrentPoint
size_t cPath::m_CurrentPoint |
|
private |
◆ m_Destination
◆ m_HalfWidth
double cPath::m_HalfWidth |
|
private |
◆ m_IsValid
◆ m_Map
◆ m_NearestPointToTarget
◆ m_OpenList
◆ m_PathPoints
std::vector<Vector3i> cPath::m_PathPoints |
|
private |
◆ m_Source
◆ m_Status
◆ m_StepsLeft
The documentation for this class was generated from the following files: