19 #ifndef DETOUTPATHCORRIDOR_H 20 #define DETOUTPATHCORRIDOR_H 42 bool init(
const int maxPath);
58 int findCorners(
float* cornerVerts,
unsigned char* cornerFlags,
59 dtPolyRef* cornerPolys,
const int maxCorners,
76 float* startPos,
float* endPos,
112 inline const float*
getPos()
const {
return m_pos; }
116 inline const float*
getTarget()
const {
return m_target; }
136 const dtPolyRef* visited,
const int nvisited);
139 const dtPolyRef* visited,
const int nvisited);
142 const dtPolyRef* visited,
const int nvisited);
144 #endif // DETOUTPATHCORRIDOR_H bool fixPathStart(dtPolyRef safeRef, const float *safePos)
unsigned int dtPolyRef
A handle to a polygon within a navigation mesh tile.
Represents a dynamic polygon corridor used to plan agent movement. ,.
int findCorners(float *cornerVerts, unsigned char *cornerFlags, dtPolyRef *cornerPolys, const int maxCorners, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
Finds the corners in the corridor from the position toward the target. (The straightened path...
bool init(const int maxPath)
Allocates the corridor's path buffer.
void movePosition(const float *npos, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
Moves the position from the current location to the desired location, adjusting the corridor as neede...
const float * getPos() const
Gets the current position within the corridor. (In the first polygon.)
bool trimInvalidPath(dtPolyRef safeRef, const float *safePos, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
Defines polygon filtering and traversal costs for navigation mesh query operations.
void reset(dtPolyRef ref, const float *pos)
Resets the path corridor to the specified position.
void setCorridor(const float *target, const dtPolyRef *polys, const int npath)
Loads a new path and target into the corridor.
const dtPolyRef * getPath() const
The corridor's path.
void moveTargetPosition(const float *npos, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
Moves the target from the curent location to the desired location, adjusting the corridor as needed t...
int dtMergeCorridorStartMoved(dtPolyRef *path, const int npath, const int maxPath, const dtPolyRef *visited, const int nvisited)
bool optimizePathTopology(dtNavMeshQuery *navquery, const dtQueryFilter *filter)
Attempts to optimize the path using a local area search. (Partial replanning.)
int dtMergeCorridorStartShortcut(dtPolyRef *path, const int npath, const int maxPath, const dtPolyRef *visited, const int nvisited)
void optimizePathVisibility(const float *next, const float pathOptimizationRange, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
Attempts to optimize the path if the specified point is visible from the current position.
int getPathCount() const
The number of polygons in the current corridor path.
const float * getTarget() const
Gets the current target within the corridor. (In the last polygon.)
bool moveOverOffmeshConnection(dtPolyRef offMeshConRef, dtPolyRef *refs, float *startPos, float *endPos, dtNavMeshQuery *navquery)
bool isValid(const int maxLookAhead, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
Checks the current corridor path to see if its polygon references remain valid.
dtPolyRef getLastPoly() const
The polygon reference id of the last polygon in the corridor, the polygon containing the target...
Provides the ability to perform pathfinding related queries against a navigation mesh.
int dtMergeCorridorEndMoved(dtPolyRef *path, const int npath, const int maxPath, const dtPolyRef *visited, const int nvisited)
dtPolyRef getFirstPoly() const
The polygon reference id of the first polygon in the corridor, the polygon containing the position...