PathEngine home previous: Shape creationnext: The update loop ‑ handling key messages
Contents, Programmers Guide, Example Projects, Tutorials, Tutorial 1, Generating shape preprocess

Generating shape 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.

For this tutorial we only require unobstructed space preprocess, for collision queries, and do not require pathfinding, so we'll use just generateUnobstructedSpaceFor().

In addition to the previously created shape, there are a couple of other parameters to this method.

The second parameter determines whether boundaries in the unobstructed space preprocess are combined into a single boundary representation. We'll set this to false, for fastest possible preprocess generation, and because we don't need to subsequently generate pathfinding preprocess.

The final parameter enables a set of arbitrary attributes to be passed in to control aspects of process generation.
(Refer to Handling Attributes for details about this attribute passing mechanism.)
In this case we simply pass a null pointer to indicate no attributes, since we just want the default preprocess generation behaviour.

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

The preprocess generated by this call includes a minkowski expansion of the external edges of the mesh by the shape specified.
PathEngine collision is implemented in terms of collision of the agent origin against these expanded boundaries.

Refer to Preprocess Generation for more details about shape related preprocess generation.


Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: The update loop ‑ handling key messages