PathEngine home | previous: | next: |
The collision queries break down into two main categories, 'point' collision queries and 'line'
collision queries.
As explained in
A number of line collision queries are provided with different functionality.
PathEngine then also supports querying for the closest point in unobstructed space to a given target point, with a number of different parameters and constraints.
Except for certain specific cases, collision queries require the generation of agent 'unobstructed space'
(with
Each query accepts a collision context argument.
This controls the set of obstacles to be 'included' for the query.
In general, each query can be invoked on either the
The iAgent methods supply
arguments corresponding to the position and shape
of the agent on which the method is called,
and ensure that the agent itself is excluded from collision.
This can be used to test whether an agent can be placed at a given position.
This can be useful, for example, when using dynamic obstacles to implement switches or trigger systems.
This version of the line collision can be used, for example,
to see if movement is unobstructed from one agent to another, or to a known end position.
This is essentially a test for collision when moving in a direction from a known start position.
The query performs a traversal over the surface of the mesh to determine the actual end position
with respect to overlapping geometry.
This is also essentially a movement in direction query.
This version does some extra work where necessary in order to obtain information about the point of collision.
This can be used then, to implement basic contact physics such as sliding against walls, or pushing obstacles.
There are essentially two versions of this query.
This functionality is essential for pathfinding to or from positions that may be outside pathfinding unobstructed space for the pathfinding agent shape, for example in cases where large agents chase smaller agents, or when agents move under the control of an external collision system.
And this can also be very useful as a component for constructing quite a wide variety of different movement based behaviours, for example attack target slot generation when multiple agents are assigned to attack a target and should not overlap, finding 'escape' positions outside of arbitrary danger shapes, and so on.
The collision queries are very fast,
so these can be used (in addition to managing agent movement)
for generate and test style algorithms.
The path post processing is an example of this.
In this case, curved paths are generated from a base path, and then tested for collision.
Speculative generate and test approaches can also be applied very effectively for
highly interactive behaviours,
such as dodging bullets and so on.
Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEngine | next: |