engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
dtPathCorridor类 参考

Represents a dynamic polygon corridor used to plan agent movement. 更多...

#include <DetourPathCorridor.h>

Public 成员函数

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
 
int 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. 更多...
 
dtPolyRef getFirstPoly () const
 The polygon reference id of the first polygon in the corridor, the polygon containing the position. 更多...
 
dtPolyRef getLastPoly () const
 The polygon reference id of the last polygon in the corridor, the polygon containing the target. 更多...
 
const dtPolyRef * getPath () const
 The corridor's path. 更多...
 
int getPathCount () const
 The number of polygons in the current corridor path. 更多...
 
const float * getPos () const
 Gets the current position within the corridor. 更多...
 
const float * getTarget () const
 Gets the current target within the corridor. 更多...
 
bool init (const int maxPath)
 Allocates the corridor's path buffer. 更多...
 
bool isValid (const int maxLookAhead, dtNavMeshQuery *navquery, const dtQueryFilter *filter)
 Checks the current corridor path to see if its polygon references remain valid. 更多...
 
bool 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. 更多...
 
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 to reflect the change. 更多...
 
bool optimizePathTopology (dtNavMeshQuery *navquery, const dtQueryFilter *filter)
 Attempts to optimize the path using a local area search. 更多...
 
bool 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. 更多...
 
void pruneOffmeshConenction (dtPolyRef offMeshConRef)
 [UE4] remove offmesh connection from corridor
 
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. 更多...
 

详细描述

Represents a dynamic polygon corridor used to plan agent movement.

,

成员函数说明

◆ findCorners()

int 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.)

参数
[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
返回
The number of corners returned in the corner buffers. [0 <= value <= maxCorners]

◆ getFirstPoly()

dtPolyRef dtPathCorridor::getFirstPoly ( ) const
inline

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

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

◆ getLastPoly()

dtPolyRef dtPathCorridor::getLastPoly ( ) const
inline

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

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

◆ getPath()

const dtPolyRef * dtPathCorridor::getPath ( ) const
inline

The corridor's path.

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

◆ getPathCount()

int dtPathCorridor::getPathCount ( ) const
inline

The number of polygons in the current corridor path.

返回
The number of polygons in the current corridor path.

◆ getPos()

const float * dtPathCorridor::getPos ( ) const
inline

Gets the current position within the corridor.

(In the first polygon.)

返回
The current position within the corridor.

◆ getTarget()

const float * dtPathCorridor::getTarget ( ) const
inline

Gets the current target within the corridor.

(In the last polygon.)

返回
The current target within the corridor.

◆ init()

bool dtPathCorridor::init ( const int  maxPath)

Allocates the corridor's path buffer.

参数
[in]maxPathThe maximum path size the corridor can handle.
返回
True if the initialization succeeded.

◆ isValid()

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

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

参数
[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 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.

参数
[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 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.

参数
[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 dtPathCorridor::optimizePathTopology ( dtNavMeshQuery *  navquery,
const dtQueryFilter *  filter 
)

Attempts to optimize the path using a local area search.

(Partial replanning.)

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

◆ optimizePathVisibility()

bool 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.

参数
[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 dtPathCorridor::reset ( dtPolyRef  ref,
const float *  pos 
)

Resets the path corridor to the specified position.

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

◆ setCorridor()

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

Loads a new path and target into the corridor.

参数
[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.

该类的文档由以下文件生成: