PathEngine home previous: Tutorial 3next: Path objects
Contents, Programmers Guide, Example Projects, Tutorials, Tutorial 3, Adding pathfind preprocess

Adding pathfind preprocess

The iMesh::generateUnobstructedSpaceFor() and iMesh::generatePathfindPreprocessFor() methods are used to generate preprocess structures associated with a mesh to enable pathfinding or collision queries relating to a given shape.

Unlike the previous two tutorials, this tutorial will add pathfinding queries as well as the simpler collision queries. So we'll need to change the way we create unobstructed space preprocess slightly, and add in a call to generate preprocess for pathfinding.

Pathfind preprocess generation requires 'combined' unobstructed space boundaries, so we change the unobstructed space generation generation call to set the 'combine' parameter to true:

mesh->generateUnobstructedSpaceFor(*agent_shape, true, 0);

And then we call the generatePathfindPreprocessFor() method to actually generate pathfind preprocess:

mesh->generatePathfindPreprocessFor(*agent_shape, 0);

Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: Path objects