C# Class SharpNav.Crowds.PathCorridor

Show file Open project: Robmaister/SharpNav Class Usage Examples

Public Methods

Method Description
FindCorners ( SharpNav.Pathfinding.StraightPath corners, NavMeshQuery navquery ) : void
FixPathStart ( NavPolyId safeRef, Microsoft.Xna.Framework.Vector3 safePos ) : bool

Adjust the beginning of the path

GetFirstPoly ( ) : NavPolyId
GetLastPoly ( ) : NavPolyId
IsValid ( int maxLookAhead, NavMeshQuery navquery ) : bool

Determines whether all the polygons in the path are valid

MergeCorridorStartMoved ( SharpNav.Pathfinding.Path path, List visited ) : int

Merge two paths after the start is changed

MergeCorridorStartShortcut ( SharpNav.Pathfinding.Path corridorPath, SharpNav.Pathfinding.Path visitedPath ) : int

Merge two paths when a shorter path is found

MoveOverOffmeshConnection ( NavPolyId offMeshConRef, NavPolyId refs, Microsoft.Xna.Framework.Vector3 &startPos, Microsoft.Xna.Framework.Vector3 &endPos, NavMeshQuery navquery ) : bool
MovePosition ( Microsoft.Xna.Framework.Vector3 npos, NavMeshQuery navquery ) : bool

Move along the NavMeshQuery and update the position

OptimizePathTopology ( NavMeshQuery navquery, NavQueryFilter filter ) : bool

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

OptimizePathVisibility ( Microsoft.Xna.Framework.Vector3 next, float pathOptimizationRange, NavMeshQuery navquery ) : void

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

PathCorridor ( )
Reset ( NavPolyId reference, Microsoft.Xna.Framework.Vector3 pos ) : void

Resets the path to the first polygon.

SetCorridor ( Microsoft.Xna.Framework.Vector3 target, SharpNav.Pathfinding.Path path ) : void

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.

Method Details

FindCorners() public method

public FindCorners ( SharpNav.Pathfinding.StraightPath corners, NavMeshQuery navquery ) : void
corners SharpNav.Pathfinding.StraightPath
navquery NavMeshQuery
return void

FixPathStart() public method

Adjust the beginning of the path
public FixPathStart ( NavPolyId safeRef, Microsoft.Xna.Framework.Vector3 safePos ) : bool
safeRef NavPolyId The starting polygon reference
safePos Microsoft.Xna.Framework.Vector3 The starting position
return bool

GetFirstPoly() public method

public GetFirstPoly ( ) : NavPolyId
return NavPolyId

GetLastPoly() public method

public GetLastPoly ( ) : NavPolyId
return NavPolyId

IsValid() public method

Determines whether all the polygons in the path are valid
public IsValid ( int maxLookAhead, NavMeshQuery navquery ) : bool
maxLookAhead int The amount of polygons to examine
navquery NavMeshQuery The NavMeshQuery
return bool

MergeCorridorStartMoved() public method

Merge two paths after the start is changed
public MergeCorridorStartMoved ( SharpNav.Pathfinding.Path path, List visited ) : int
path SharpNav.Pathfinding.Path The current path
visited List The visited polygons
return int

MergeCorridorStartShortcut() public method

Merge two paths when a shorter path is found
public MergeCorridorStartShortcut ( SharpNav.Pathfinding.Path corridorPath, SharpNav.Pathfinding.Path visitedPath ) : int
corridorPath SharpNav.Pathfinding.Path
visitedPath SharpNav.Pathfinding.Path
return int

MoveOverOffmeshConnection() public method

public MoveOverOffmeshConnection ( NavPolyId offMeshConRef, NavPolyId refs, Microsoft.Xna.Framework.Vector3 &startPos, Microsoft.Xna.Framework.Vector3 &endPos, NavMeshQuery navquery ) : bool
offMeshConRef NavPolyId
refs NavPolyId
startPos Microsoft.Xna.Framework.Vector3
endPos Microsoft.Xna.Framework.Vector3
navquery NavMeshQuery
return bool

MovePosition() public method

Move along the NavMeshQuery and update the position
public MovePosition ( Microsoft.Xna.Framework.Vector3 npos, NavMeshQuery navquery ) : bool
npos Microsoft.Xna.Framework.Vector3 Current position
navquery NavMeshQuery The NavMeshQuery
return bool

OptimizePathTopology() public method

Use a local area path search to try to reoptimize this corridor
public OptimizePathTopology ( NavMeshQuery navquery, NavQueryFilter filter ) : bool
navquery NavMeshQuery The NavMeshQuery
filter SharpNav.Pathfinding.NavQueryFilter
return bool

OptimizePathVisibility() public method

Use an efficient local visibility search to try to optimize the corridor between the current position and the next.
public OptimizePathVisibility ( Microsoft.Xna.Framework.Vector3 next, float pathOptimizationRange, NavMeshQuery navquery ) : void
next Microsoft.Xna.Framework.Vector3 The next postion
pathOptimizationRange float The range
navquery NavMeshQuery The NavMeshQuery
return void

PathCorridor() public method

public PathCorridor ( )

Reset() public method

Resets the path to the first polygon.
public Reset ( NavPolyId reference, Microsoft.Xna.Framework.Vector3 pos ) : void
reference NavPolyId The starting polygon reference
pos Microsoft.Xna.Framework.Vector3 Starting position
return void

SetCorridor() public method

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.
public SetCorridor ( Microsoft.Xna.Framework.Vector3 target, SharpNav.Pathfinding.Path path ) : void
target Microsoft.Xna.Framework.Vector3 The target
path SharpNav.Pathfinding.Path The polygon path
return void