PathEngine home previous: Collision Queriesnext: Connectivity Queries
Contents, Programmers Guide, Applying the SDK, Performing Collision Queries without Preprocess

Performing Collision Queries without Preprocess

In addition to the standard code-path for testing collision against a set of expanded boundaries, PathEngine also provides an alternative code-path based on testing agent shape directly against obstacles shapes and the edges of the mesh.

There is no per-shape memory overhead for this functionality so this enables collision queries to be applied for an effectively unlimited set of shapes.
This can be useful, for example, for testing collision when placing obstacles or for performing collision queries for rotations of long thin agent shapes.

To enable the alternative code-paths you just need to set the 'allowCollisionWithoutPreprocess' option to true when initialising a mesh (this defaults to false).
Refer to iPathEngine::loadMeshFromBuffer() for details about initialising a mesh with options, and to Handling Attributes for details specifically about the named attribute system used for specifying options.

The alternative code-paths currently supports just point collision testing, i.e. the following queries:

Line collision tests and other queries are not supported with this code path.

When the alternative code-path has been enabled for a mesh you can call the supported collision queries with or without specific collision preprocess being generated for the test shape.
If specific preprocess is present then this will be used, otherwise the calls with fall back on the alternative code-path.

Note that the alternative code-path does in fact still require some preprocess, the difference being that there is no requirement for preprocess per agent shape.
The required preprocess is generated once when loading the mesh.

The alternative code-path is necessarily slower than the code-path based on more specific queries.

Differences in collision behaviour between code paths

It is important to note that the current implementation of the alternative collision code path will provide different results in certain specific situations.
Whether or not this matters will depend on the obstruction geometry against which the queries are called and also the way in which the queries are used by the client application.

The difference relates to base obstacles or context obstacles. Collision against mesh edges will behave in exactly the same way for both code-paths.
The differences then relative specifically to the way in which the influence of a base obstacles is considered to extend through a mesh and against overlapping geometry.

The standard code-path for collision is based on point collision against the expanded boundaries of obstacles and mesh edges.
In this case the expanded boundary of an obstacle is applied through any faces reachable through the mesh within that expanded boundary.
(Refer to The PathEngine Movement Model for a more detailed description of this movement model.)


Point collision implemented in terms of obstacle centre against an expanded boundary returns true

The alternative code-path tests directly for obstacle overlapping other obstacles.


Point collision implemented in terms of an obstacle against obstacle overlap check returns false


Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: Connectivity Queries