Atoms Crowd  7.0.0
AtomsUtils::dtPathCorridor Class Reference

#include <DetourPathCorridor.h>

Public Member Functions

bool init (const int maxPath)
 
void reset (dtPolyRef ref, const float *pos)
 
int findCorners (float *cornerVerts, unsigned char *cornerFlags, dtPolyRef *cornerPolys, const int maxCorners, dtNavMeshQuery *navquery, const dtQueryFilter *filter, float pathOffsetDistance, float earlyReachDistance, bool bAllowEarlyReach=true)
 
bool optimizePathVisibility (const float *next, const float pathOptimizationRange, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
 
bool optimizePathTopology (dtNavMeshQuery *navquery, const dtQueryFilter *filter)
 
bool moveOverOffmeshConnection (dtPolyRef offMeshConRef, dtPolyRef *refs, const float *agentPos, float *startPos, float *endPos, dtNavMeshQuery *navquery)
 
bool canMoveOverOffmeshConnection (dtPolyRef offMeshConRef, dtPolyRef *refs, const float *agentPos, float *startPos, float *endPos, dtNavMeshQuery *navquery) const
 [UE4] check if offmesh connection can be traversed, but don't modify corridor yet
 
void pruneOffmeshConenction (dtPolyRef offMeshConRef)
 [UE4] remove offmesh connection from corridor
 
bool fixPathStart (dtPolyRef safeRef, const float *safePos)
 
bool trimInvalidPath (dtPolyRef safeRef, const float *safePos, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
 
bool isValid (const int maxLookAhead, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
 
bool movePosition (const float *npos, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
 
void moveTargetPosition (const float *npos, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
 
void setCorridor (const float *target, const dtPolyRef *polys, const int npath)
 
const float * getPos () const
 
const float * getTarget () const
 
dtPolyRef getFirstPoly () const
 
dtPolyRef getLastPoly () const
 
const dtPolyRefgetPath () const
 
int getPathCount () const
 
void setEarlyReachTest (bool enable)
 
float getSegmentAngle () const
 
const float * getNextFixedCorner () const
 
const float * getNextFixedCorner2 () const
 
bool hasNextFixedCorner () const
 
bool hasNextFixedCorner2 () const
 

Detailed Description

Represents a dynamic polygon corridor used to plan agent movement. ,

Member Function Documentation

◆ findCorners()

int AtomsUtils::dtPathCorridor::findCorners ( float *  cornerVerts,
unsigned char *  cornerFlags,
dtPolyRef cornerPolys,
const int  maxCorners,
dtNavMeshQuery navquery,
const dtQueryFilter filter,
float  pathOffsetDistance,
float  earlyReachDistance,
bool  bAllowEarlyReach = true 
)

Finds the corners in the corridor from the position toward the target. (The straightened path.)

Parameters
[out]cornerVertsThe corner vertices. [(x, y, z) * cornerCount] [Size: <= maxCorners]
[out]cornerFlagsThe flag for each corner. [(flag) * cornerCount] [Size: <= maxCorners]
[out]cornerPolysThe polygon reference for each corner. [(polyRef) * cornerCount] [Size: <= maxCorners]
[in]maxCornersThe maximum number of corners the buffers can hold.
[in]navqueryThe query object used to build the corridor.
[in]filterThe filter to apply to the operation.
[in]pathOffsetDistance[UE4] Radius for path offsetting
[in]earlyReachDistance[UE4] Radius for early reach detection
[in]bAllowEarlyReach[UE4] Check if corner skipping for EarlyReachTest is available now
Returns
The number of corners returned in the corner buffers. [0 <= value <= maxCorners]

◆ getFirstPoly()

dtPolyRef AtomsUtils::dtPathCorridor::getFirstPoly ( ) const
inline

The polygon reference id of the first polygon in the corridor, the polygon containing the position.

Returns
The polygon reference id of the first polygon in the corridor. (Or zero if there is no path.)

◆ getLastPoly()

dtPolyRef AtomsUtils::dtPathCorridor::getLastPoly ( ) const
inline

The polygon reference id of the last polygon in the corridor, the polygon containing the target.

Returns
The polygon reference id of the last polygon in the corridor. (Or zero if there is no path.)

◆ getPath()

const dtPolyRef* AtomsUtils::dtPathCorridor::getPath ( ) const
inline

The corridor's path.

Returns
The corridor's path. [(polyRef) * getPathCount()]

◆ getPathCount()

int AtomsUtils::dtPathCorridor::getPathCount ( ) const
inline

The number of polygons in the current corridor path.

Returns
The number of polygons in the current corridor path.

◆ getPos()

const float* AtomsUtils::dtPathCorridor::getPos ( ) const
inline

Gets the current position within the corridor. (In the first polygon.)

Returns
The current position within the corridor.

◆ getTarget()

const float* AtomsUtils::dtPathCorridor::getTarget ( ) const
inline

Gets the current target within the corridor. (In the last polygon.)

Returns
The current target within the corridor.

◆ init()

bool AtomsUtils::dtPathCorridor::init ( const int  maxPath)

Allocates the corridor's path buffer.

Parameters
[in]maxPathThe maximum path size the corridor can handle.
Returns
True if the initialization succeeded.

◆ isValid()

bool AtomsUtils::dtPathCorridor::isValid ( const int  maxLookAhead,
dtNavMeshQuery navquery,
const dtQueryFilter filter 
)

Checks the current corridor path to see if its polygon references remain valid.

Parameters
[in]maxLookAheadThe number of polygons from the beginning of the corridor to search.
[in]navqueryThe query object used to build the corridor.
[in]filterThe filter to apply to the operation.

◆ movePosition()

bool AtomsUtils::dtPathCorridor::movePosition ( const float *  npos,
dtNavMeshQuery navquery,
const dtQueryFilter filter 
)

Moves the position from the current location to the desired location, adjusting the corridor as needed to reflect the change.

Parameters
[in]nposThe desired new position. [(x, y, z)]
[in]navqueryThe query object used to build the corridor.
[in]filterThe filter to apply to the operation.

◆ moveTargetPosition()

void AtomsUtils::dtPathCorridor::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 to reflect the change.

Parameters
[in]nposThe desired new target position. [(x, y, z)]
[in]navqueryThe query object used to build the corridor.
[in]filterThe filter to apply to the operation.

◆ optimizePathTopology()

bool AtomsUtils::dtPathCorridor::optimizePathTopology ( dtNavMeshQuery navquery,
const dtQueryFilter filter 
)

Attempts to optimize the path using a local area search. (Partial replanning.)

Parameters
[in]navqueryThe query object used to build the corridor.
[in]filterThe filter to apply to the operation.

◆ optimizePathVisibility()

bool AtomsUtils::dtPathCorridor::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.

Parameters
[in]nextThe point to search toward. [(x, y, z])
[in]pathOptimizationRangeThe maximum range to search. [Limit: > 0]
[in]navqueryThe query object used to build the corridor.
[in]filterThe filter to apply to the operation.

◆ reset()

void AtomsUtils::dtPathCorridor::reset ( dtPolyRef  ref,
const float *  pos 
)

Resets the path corridor to the specified position.

Parameters
[in]refThe polygon reference containing the position.
[in]posThe new position in the corridor. [(x, y, z)]

◆ setCorridor()

void AtomsUtils::dtPathCorridor::setCorridor ( const float *  target,
const dtPolyRef polys,
const int  npath 
)

Loads a new path and target into the corridor.

Parameters
[in]targetThe target location within the last polygon of the path. [(x, y, z)]
[in]pathThe path corridor. [(polyRef) * npolys]
[in]npathThe number of polygons in the path.

The documentation for this class was generated from the following file: