PathEngine home previous: Adding pathfind preprocessnext: The shortest path query
Contents, Programmers Guide, Example Projects, Tutorials, Tutorial 3, Path objects

Path objects

Interface iPath objects simply represent a sequence of connected positions on a mesh.

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

(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 PathEnginenext: The shortest path query