| PathEngine home | previous: | next: |
Finds the shortest path of escape from a specified region from a given start position.
(This version supports passing in a callback object to enable the query to be aborted early.)
iPath* findPathAway_WithQueryCallBack(iShape* shape, const iCollisionContext* context, const cPosition& start, const cPosition& awayFrom, tSigned32 distanceAway, iQueryCallBack* queryCallBack) const; |
| shape | The collision shape to use for this query. | ||
| context |
The state of dynamic collision that will apply for this query. An empty context can be specified by passing a value of zero for this argument. | ||
| start |
The start point for pathfinding. This position must be a valid position on this mesh. This start point must be unobstructed. | ||
| awayFrom | A position defining the centre of a region to escape from. This position must be a valid position on this mesh. | ||
| distanceAway |
Controls the size of the region to escape from, see below.
Must be greater than zero. | ||
| queryCallBack | A pointer to a valid implementation of the iQueryCallBack interface, or else null. |
The distance applies as a manhattan distance along the x and y axes.
In other words the query searches for a position to satisfy the following:
x >= awayFrom.x - distanceAway
x <= awayFrom.x + distanceAway
y >= awayFrom.y - distanceAway
y <= awayFrom.y + distanceAway
These bounds are applied with a kind of 'flood fill' mechanism,
with potential goal positions generated only where the bounds are reachable through the ground mesh.
(See
If no unobstructed path to such a point exists then an empty path is returned. If 'start' already satisfies the distance constraint then a path with only one point is returned.
Refer to
Note that if the search is aborted by the query callback then the path returned will not satisfy the distance constraint.
| Documentation for PathEngine release 5.17 - Copyright © 2002-2008 PathEngine | next: |