Dungeon Architect  17.0.0
SharpNav.Crowds.PathCorridor Class Reference

Public Member Functions

 PathCorridor (int maxPath)
 
void Reset (int reference, Vector3 pos)
 Resets the path to the first polygon. More...
 
void SetCorridor (Vector3 target, int[] path, int npath)
 The current corridor position is expected to be within the first polygon in the path. The target is expected to be in the last polygon. More...
 
bool MovePosition (Vector3 npos, NavMeshQuery navquery)
 Move along the NavMeshQuery and update the position More...
 
int FindCorners (Vector3[] cornerVerts, int[] cornerFlags, int[] cornerPolys, int maxCorners, NavMeshQuery navquery)
 
bool OptimizePathTopology (NavMeshQuery navquery)
 Use a local area path search to try to reoptimize this corridor More...
 
void OptimizePathVisibility (Vector3 next, float pathOptimizationRange, NavMeshQuery navquery)
 Use an efficient local visibility search to try to optimize the corridor between the current position and the next. More...
 
int MergeCorridorStartMoved (int[] path, int npath, int maxPath, int[] visited, int nvisited)
 Merge two paths after the start is changed More...
 
int MergeCorridorStartShortcut (int[] path, int npath, int maxPath, int[] visited, int nvisited)
 Merge two paths when a shorter path is found More...
 
bool MoveOverOffmeshConnection (int offMeshConRef, int[] refs, ref Vector3 startPos, ref Vector3 endPos, NavMeshQuery navquery)
 
bool FixPathStart (int safeRef, Vector3 safePos)
 Adjust the beginning of the path More...
 
bool IsValid (int maxLookAhead, NavMeshQuery navquery)
 Determines whether all the polygons in the path are valid More...
 
int GetFirstPoly ()
 
int GetLastPoly ()
 

Properties

Vector3 Pos [get]
 
Vector3 Target [get]
 
int[] Path [get]
 
int PathCount [get]
 

Detailed Description

Definition at line 20 of file PathCorridor.cs.

Member Function Documentation

◆ FixPathStart()

bool SharpNav.Crowds.PathCorridor.FixPathStart ( int  safeRef,
Vector3  safePos 
)

Adjust the beginning of the path

Parameters
safeRefThe starting polygon reference
safePosThe starting position
Returns
True if path start changed, false if not

Definition at line 397 of file PathCorridor.cs.

◆ IsValid()

bool SharpNav.Crowds.PathCorridor.IsValid ( int  maxLookAhead,
NavMeshQuery  navquery 
)

Determines whether all the polygons in the path are valid

Parameters
maxLookAheadThe amount of polygons to examine
navqueryThe NavMeshQuery
Returns
True if all valid, false if otherwise

Definition at line 422 of file PathCorridor.cs.

◆ MergeCorridorStartMoved()

int SharpNav.Crowds.PathCorridor.MergeCorridorStartMoved ( int[]  path,
int  npath,
int  maxPath,
int[]  visited,
int  nvisited 
)

Merge two paths after the start is changed

Parameters
pathThe current path
npathCurrent path length
maxPathMaximum path length allowed
visitedThe visited polygons
nvisitedVisited path length
Returns
New path length

Definition at line 250 of file PathCorridor.cs.

◆ MergeCorridorStartShortcut()

int SharpNav.Crowds.PathCorridor.MergeCorridorStartShortcut ( int[]  path,
int  npath,
int  maxPath,
int[]  visited,
int  nvisited 
)

Merge two paths when a shorter path is found

Parameters
pathThe current path
npathCurrent path length
maxPathMaximum path length allowed
visitedThe visited polygons
nvisitedVisited path length
Returns
New path length

Definition at line 307 of file PathCorridor.cs.

◆ MovePosition()

bool SharpNav.Crowds.PathCorridor.MovePosition ( Vector3  npos,
NavMeshQuery  navquery 
)

Move along the NavMeshQuery and update the position

Parameters
nposCurrent position
navqueryThe NavMeshQuery
Returns
True if position changed, false if not

Definition at line 115 of file PathCorridor.cs.

◆ OptimizePathTopology()

bool SharpNav.Crowds.PathCorridor.OptimizePathTopology ( NavMeshQuery  navquery)

Use a local area path search to try to reoptimize this corridor

Parameters
navqueryThe NavMeshQuery
Returns
True if optimized, false if not

Definition at line 183 of file PathCorridor.cs.

◆ OptimizePathVisibility()

void SharpNav.Crowds.PathCorridor.OptimizePathVisibility ( Vector3  next,
float  pathOptimizationRange,
NavMeshQuery  navquery 
)

Use an efficient local visibility search to try to optimize the corridor between the current position and the next.

Parameters
nextThe next postion
pathOptimizationRangeThe range
navqueryThe NavMeshQuery

Definition at line 213 of file PathCorridor.cs.

◆ Reset()

void SharpNav.Crowds.PathCorridor.Reset ( int  reference,
Vector3  pos 
)

Resets the path to the first polygon.

Parameters
referenceThe starting polygon reference
posStarting position

Definition at line 87 of file PathCorridor.cs.

◆ SetCorridor()

void SharpNav.Crowds.PathCorridor.SetCorridor ( Vector3  target,
int[]  path,
int  npath 
)

The current corridor position is expected to be within the first polygon in the path. The target is expected to be in the last polygon.

Parameters
targetThe target
pathThe polygon path
npathThe path length

Definition at line 102 of file PathCorridor.cs.


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