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

Generating shape preprocess

The following functions, provided by Interface iMesh, are used to generate preprocess structures associated with a mesh to enable pathfinding or collision queries relating to a given shape.

virtual void generateCollisionPreprocessFor(iShape* shape, const char *const* attributes) = 0;
    virtual void generatePathfindPreprocessFor(iShape* shape, const char *const* attributes) = 0;

For this tutorial, we only require collision preprocess.

The attributes 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->generateCollisionPreprocessFor(agent_shape, 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 5.18 - Copyright © 2002-2008 PathEnginenext: The update loop ‑ handling key messages