PathEngine home previous: iMesh::generateRandomPositionLocally()next: iMesh::generateUnobstructedSpaceFor_WithPreExpanded()
Contents, API Reference, Interfaces, iMesh, generateUnobstructedSpaceFor

iMesh::generateUnobstructedSpaceFor()

Description

Generates a representation of (expanded) unobstructed space boundaries for the specified agent shape, on this mesh.

Syntax

void generateUnobstructedSpaceFor(const iShape& shape, bool combine, const char *const* options);

Parameters

shape The shape for which unobstructed space should be generated.
combine Controls whether unobstructed space boundary elements are combined into a single boundary representation.
This must be set if generating additional preprocess for pathfinding or connected region queries.
options

This parameter enables optional attributes to be passed in to control aspects of the unobstructed space generation, if special behaviour is desired.

If special bevaviour is desired, then see Handling Attributes for general information about passing attributes, and Unobstructed Space Generation Attributes for a list of the attributes that can be passed in specifically to this method.

If no special behaviour is desired then you can just pass zero in for this parameter, to indicate no attributes.

Requirements

Unobstructed space must not already be present for the shape on this mesh.

Remarks

In most cases (except when using the unpreprocess collision queries feature), preprocess needs to be generated in order to make queries about collision or movement possibilities for a given shape.

This preprocess is then based on a minkowski expansion of the external edges of the mesh by the specified agent shape, i.e. an 'unobstructed space' for the agent origin.

At a minimum this enables fast point and line collision queries (based on just the coordinates of the agent origin), but additional preprocess information can then be added, if necessary, to support connectivity checking and pathfinding queries.
(See iMesh::generatePathfindPreprocessFor() and iMesh::generateConnectedRegionPreprocessFor().)

You can avoid the overhead of generating unobstructed space at runtime by using iMesh::saveUnobstructedSpaceFor() and iMesh::loadUnobstructedSpaceFor() to save and load the data to and from a persistent store.

NOTE: Unobstructed space generation is for queries against a shape as an 'agent shape', and does not need to be generated for a shape in order for that shape to be placed as an obstruction.
Obstruction shapes can also be moved by removing and replacing at a new position without preprocess being required.

Multithreading details: Base mesh preprocess generation operations are non-blocking between shapes, so preprocess can be generated for multiple shapes simultaneously.
(See Using PathEngine with Multithreaded Applications.)

See Also

iMesh::generateUnobstructedSpaceFor_WithPreExpanded(), iMesh::releaseUnobstructedSpaceFor(), iMesh::shapeCanCollide(), iMesh::shapeHasCombinedUnobstructedSpace()

C# Mapping

void generateUnobstructedSpaceFor(Shape shape, bool combine, string[] options);

Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEnginenext: iMesh::generateUnobstructedSpaceFor_WithPreExpanded()