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

Connectivity Queries

Connectivity queries can be very important for getting the best performance, in many situations, since these can enable you to completely avoid potentially expensive failed pathfinding queries.
And because these queries are much faster than full pathfinding queries, this can also make it possible to implement different types of game logic, that wouldn't normally be considered if full pathfinding queries were required for each reachability test.

Preprocess requirements

Connectivity queries require the generation of connected regions preprocess, with iMesh::generateConnectedRegionPreprocessFor().
(But this is generally very fast, and the resulting preprocess data much more lightweight than full pathfind preprocess.)

Note that the base mesh connected region queries relate specifically to pathfinding unobstructed space, i.e. no collision context argument is supplied, and dynamic obstacle state is not taken into account for these queries.

In order to get obstacles state taken into account by connected region queries you need to assign the desired set of obstacles to a 'preprocess obstacle set'.
(This then enables you to get fast query connected region query support that takes into account situations such as narrow passages being blocked by movable obstacles, and is then quite a powerful feature of the SDK.)

API details

Base mesh connected region queries can be performed with iMesh::getConnectedRegionFor() and iMesh::getConnectedRegionForAgent().

Connected region queries against preprocessed obstacle sets can be performed with iObstacleSet::getConnectedRegionFor() and iObstacleSet::getConnectedRegionForAgent().

In each case the queries enable you to obtain a 'connected region ID' for a specific position.
You can then test for reachability between multiple points by comparing these region ID values.


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