|PathEngine home||previous: ||next: |
Pathfinding queries, such as iAgent::findShortestPathTo() and
iAgent::findPathAway(), use iPath objects to return the result of the query.
You can think of the path as the movement required for an agent to solve the constraints of the query.
Note that a null pointer is returned from a failed query, and a path with just 1 position is returned when an agent does not need to move.
We add a variable for the agent's current path:
// the agents current path iPath *path=0;
And the following code to draw the path:
// draw path if there is one testbed->setColour("green"); testbed->drawPath(path);
(Note that it is safe to call iTestBed::drawPath() with a null pointer. This will simply return with no effect.)
|Documentation for PathEngine release 6.00 - Copyright © 2002-2016 PathEngine||next: |