PathEngine home previous: Setting agent heading from the pathnext: Other Examples
Contents, Programmers Guide, Example Projects, Tutorials, Tutorial 3, Post processing the agent's path

Post processing the agent's path

The geometric shortest path will usually contain sharp corners.
We can eliminate these by post processing the path with the generateCurvedPath() method.

We do this with the following modification immediately after finding a path:

iPath* base_path = agent->findShortestPathTo(context,target);
    path = agent->generateCurvedPath(base_path,context,0,0,20,0.3f,0.4f);
	delete base_path;

(And a similar modification for paths away.)

See Path Post Processing for details about the generateCurvedPath() method.

Documentation for PathEngine release 6.00 - Copyright © 2002-2016 PathEnginenext: Other Examples