PathEngine home previous: PathEngine Coordinatesnext: Setting Face Attributes
Contents, Programmers Guide, World Representation, Obstacle Placement

Obstacle Placement

Once PathEngine meshes have been generated to define the ground surfaces of a world, obstacles can now be placed on these surfaces. (See this page for an introduction to PathEngine obstacles.)

When generating meshes from 3DS Max, obstacles can be represented directly in Max (as 'pinned shapes'), and exported together with a ground mesh. (See this page, in the exporter documentation.)

When using a content chain based on the content processing functionality (or direct mesh xml generation) obstacle placement needs to be performed directly through the main API.

Placing obstacles through the API

iAgent instances are used to represent the placement of an object with a given shape at a given position on the surface of a mesh (for both obstacles and pathfinding agents).

To place an obstacle you need both a position and a shape.
Information about resolving positions to the ground can be found here.
iPathEngine::newShape() enables you to setup an obstacle shape.
iMesh::placeAgent() can then be used to place an obstacle with that shape.

Obstacle size constraints

Note that iShape instances are subject to range constraints, as described in Shape Validation.

iMesh::placeLargeStaticObstacle() can be used to place obstacles that are not subject to these range constraints, but with the limitation that the resulting iAgent cannot be moved and cannot be the subject of collision or pathfinding queries.

'Burning in' static obstacles

Obstacles that are completely static (e.g. obstacles that are used to represent scenery objects) should be 'burnt in' for preprocessing.
This enables PathEngine to work with large numbers of these kinds of obstacles very efficiently.

When exporting from Max, obstacles tagged with the 'baseObstacle' prefix are automatically burnt in.

When placing obstacles directly through the main API, iMesh::burnContextIntoMesh() should be used.

Obstacle sets (added in release 5.0 of the SDK) now enable you to effectively work with multiple sets of 'burnt-in' obstacles, and to modify these sets of obstacles semi-dynamically. Refer to Obstacle Management for details about this feature.

Named obstacles

Obstacles can be named and stored with a mesh, but not burnt in, using iMesh::storeNamedObstacle().
This is useful for placing things like doors, switches or other content features that will then be managed dynamically at run-time.

Run-time obstacle management

Refer to this page for information about run-time dynamic obstacle management.


Documentation for PathEngine release 5.16 - Copyright © 2002-2008 PathEnginenext: Setting Face Attributes