PathEngine home previous: Performance Considerationsnext: Building from Physics Scene Data
Contents, Programmers Guide, World Representation, 3D Content Processing, Generating Convex Solids

Generating Convex Solids

Using convex solid input representation can significantly improve efficiency, particularly with BSP based processing, and using a solid representation can also have the benefit of better representing actual obstructed space.
(Tri-mesh data essentially represents just the obstruction 'shells', whereas using a solid representation then effectively also fills in the obstacle interiors.)

While tri mesh data tends to be easier to set up, based on existing scene representations, there are also some straightforward ways of getting some of your scene data into PathEngine in solid object form based on some very minimal scene markup.

Tagging small scene objects

Some scene objects are essentially convex shaped and do not need any interior space, and it is straightforward to then pass this information in to PathEngine.

Simply compile all the vertices in each object instance into it's own 'point cloud', within a solid obstacle container class. (See Input Representation.)
(PathEngine will then take care of generating a 3D hull for each point cloud.)

Obstacles can be tagged for this kind of treatment either per object type, or per placed object, at minimal cost to world creators.

Examples of this kind of object could be things like crates, barrels, small rocks, boulders, and so forth.

Depending on the level of fidelity required for your pathfinding, objects that are reasonably close to convex could also be treated in this way.
(So imagine something like a wheelbarrow, where you don't really care whether or not pathfinding agents can move in between the handles.)

Splitting larger objects into convex sub-parts

In cases where an object is not quite convex, but could be treated as a small number of convex sub-parts, a useful technique is to assign vertices to these sub-parts by painting the object face with an explicit 'sub-part index' attribute.

The following image shows a wall section object which cannot be treated as a single convex point cloud, but which can be split into 3 convex sub-parts.
Faces assigned to different sub-parts are displayed with different colours.

A well section, with sub-part indices assigned.

It's straightforward to then iterate through object vertices collecting sets of points for each sub-part index, with each point set then added to a convex solid container class.

(Note that vertex replication across convex sub-parts and a certain amount of sub-part overlap is not a problem, with this kind of preprocessing still generally a big win for BSP based 3D processing.)

Grouping very small objects and clumping

In some cases, groups of very small object can be treated as single convex solids, or very small objects added in together with the vertices in larger objects.

Bottlenecks for convex solid generation with very large point sets

While converting source data to convex solid form is generally a big win, in particular for BSP processing, if very large point sets are passed in for individual convex solids then the convex hull generation for this can potentially become a bottleneck in itself.
See Performance Considerations for a way to then work around this, if this happens.


Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: Building from Physics Scene Data