| PathEngine home | previous: | next: |
PathEngine's dynamic obstacle mechanisms provide a powerful tool for
managing the state of collision in a world,
or for representing agent knowledge or beliefs about this state of collision.
See this page for an introduction to PathEngine obstacles.
See this page for information about placing obstacles through the API.
Obstacles that haven't been burnt into a mesh
(see
Each collision or pathfinding query in the API takes a collision context argument
specifying the state of collision to be applied for that query.
For convenience, a null pointer may be passed into this argument to specify that only static collision should be applied.
A state of collision essentially means a set of dynamic obstacles,
so collision contexts started out essentially as a way of representing the set of obstacles to be included for a query.
Obstacles can be included in a collision context directly, or indirectly by being included in an obstacle set
that is then included in the collision context.
(In situations where obstacles are naturally organised into groups that need to be added or removed from contexts
obstacle sets can greatly simplify obstacle management.
In simpler situations adding obstacles directly to collision contexts avoids the need to work with an additional interface object.)
In addition to representing simply a 'state of collision',
collision contexts have evolved to also manage information about movement costs for certain types of regions with cost to traverse
(see
Refer to
Release 5 of the SDK adds the possibility to organise obstacles into sets which can then be compounded together differently in different collision contexts.
In addition to enabling groups of obstacles to be represented more naturally, collision preprocess is cached with each obstacle set, which can be an important optimisation for certain situations where collision is being performed against large number of dynamic obstacles.
Refer to
Obstacle sets
now enable you to effectively work with multiple sets of 'burnt-in' obstacles, and to modify these
sets of obstacles semi-dynamically.
This is implemented in terms of special obstacle sets that are marked for extended preprocessing.
To mark an obstacle set for extended preprocessing the obstacle set should be created with
The following code snippet shows how this can be done:
char* attributes[3]; attributes[0] = "markForPreprocessing"; attributes[1] = "true"; attributes[2] = 0; obstacleSet = mesh->newObstacleSet_WithAttributes(attributes); |
The attributes supplied on the creation of a preprocessed obstacle set are also cached and passed in
to the actual preprocess generation.
(So if you want to apply the small convex optimisation
to this preprocess then the relevant attribute should be supplied on obstacle set creation.)
Only one such obstacle set may be added to any one collision context.
Internally, PathEngine will generate the same kind of preprocess for the obstacle set as is normally generated for
the set of obstacles burnt in to a mesh.
When queries are made against a collision context that includes an obstacle set marked in this way,
preprocess from the obstacle set is used instead of mesh preprocess.
This feature is very useful in the case where different sets of static obstacles should be applied to different types of agents.
It is also possible to modify the set of obstacles in 'preprocessed obstacle sets' but note
that this can incur a (potentially very big) delay when the obstacle preprocess is subsequently updated.
The semi dynamic obstacles example project demonstrates a technique for double buffering a pair of preprocessed obstacle sets for fast pathfinding and collision around large numbers of run-time determined obstacles.
| Documentation for PathEngine release 5.16 - Copyright © 2002-2008 PathEngine | next: |