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:

auto base_path = agent->findShortestPathTo(context,target);
if(base_path)
{
    path = agent->generateCurvedPath(*base_path,context,0,0,20,0.3f,0.4f);
}

(And a similar modification for paths away.)

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


Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: Other Examples