PathEngine home previous: Performing Collision Queries without Preprocessnext: Limiting the Scope for Pathfinding
Contents, Programmers Guide, Applying the SDK, Pathfinding Queries

Pathfinding Queries

Supplying a context

Each query accepts a collision context argument.
This controls the set of obstacles to be 'included' for the query.

Calling against the mesh or agent interfaces

In general, each query can be invoked on either the Interface iMesh or the Interface iAgent interface.
The iAgent methods supply arguments corresponding to the position and shape of the agent on which the method is called, and ensure that the agent itself is not treated as an obstruction.

The queries

Shortest path

iMesh::findShortestPath() and iAgent::findShortestPathTo() provide the fundamental pathfinding query for a path from a known start point to a known goal.

Path away

iMesh::findPathAway() and iAgent::findPathAway() both find the shortest path out of a region around a specified point.
This can be used as the basis for a 'run away' behaviour.

Closest unobstructed point

iMesh::findClosestUnobstructedPosition() and iAgent::findClosestUnobstructedPosition() find the closest unobstructed position to a specified target position.
This query is essential for pathfinding to or from positions that may be outside unobstructed space for a pathfinding agent, for example in the case where large agents chase smaller agents, or when agents move under the control of an external collision system.

Note that this query does not actually require full pathfind preproces to be generated.


Documentation for PathEngine release 5.16 - Copyright © 2002-2008 PathEnginenext: Limiting the Scope for Pathfinding