PathEngine home previous: iAgent::findPathAway_WithQueryCallBack()next: iAgent::findShortestPathTo_WithQueryCallBack()
Contents, API Reference, Interfaces, iAgent, findShortestPathTo

iAgent::findShortestPathTo()

Description

Finds the shortest path from the agent's current position to a specified target position.

Syntax

iPath* findShortestPathTo(const iCollisionContext* context, const cPosition& target) const;

Parameters

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.
Note that the agent is not considered to obstruct itself even if included in this context.
target The target position for pathfinding. This position must be a valid position on the agent's mesh.

Requirements

Requires that the agent is moveable and that pathfinding preprocess has been generated on the agent's mesh for the agent's collision shape.

The agent must be currently placed at a position that is unobstructed according to the specified context.

Return Value

This query returns an Interface iPath object to represent the shortest path that will take the agent to the specified target position without collision, if such a path exists.

If no unobstructed path exists then an empty path is returned. If 'target' is identical to the agent's current position then a path with only one point is returned.

Remarks

Calling this method is functionally equivalent to calling iAgent::findPathAway_WithQueryCallBack(), with null for the callback parameter.


Documentation for PathEngine release 5.17 - Copyright © 2002-2008 PathEnginenext: iAgent::findShortestPathTo_WithQueryCallBack()