PathEngine home previous: iObstacleSet::includes()next: iObstacleSet::pathfindPreprocessNeedsUpdate()
Contents, API Reference, Interfaces, iObstacleSet, loadPathfindPreprocessFor

iObstacleSet::loadPathfindPreprocessFor()

Description

Loads pathfinding preprocess from persistent storage.

Syntax

void loadPathfindPreprocessFor(const iShape* shape, const char* dataBuffer, tUnsigned32 bufferSize) const;

Parameters

shape The shape for which preprocess should be loaded.
dataBufferA byte buffer. This buffer is not retained after the call and can subsequently be safely deleted.
bufferSizeThe size of the buffer pointed to by dataBuffer, in bytes.

Requirements

Pathfind preprocess must have been generated for the shape on the mesh for which this obstacle set was created.

The pathfinding state corresponding to this obstacle set must be identical to the state against which the saved preprocess was generated, specifically:

Remarks

The buffer passed in must contain data previously saved out by iObstacleSet::savePathfindPreprocessFor().

Note that any preprocess generation attributes passed in to obstacle set creation will affect preprocess generation and not preprocess loading. Attributes of any loaded preprocess depend on the set of attributes passed in when the preprocess was originally generated.

The order of obstacles included in an obstacle set is significant.
The simplest way to ensure that obstacle ordering is identical to the state for which preprocess was saved is to ensure that obstacles are added to a newly created obstacle set in exactly the same order for loading as before generation and saving.
For more dynamic obstacle set creation scenarios, it is also possible to reconstruct an obstacle set with identical ordering, by ensuring that agents are added in the same order as the iteration provided by iObstacleSet::getNumberOfAgents() and iObstacleSet::getAgent().

The structure of PathEngine's pathfinding preproces may be changed between releases.
iPathEngine::pathfindPreprocessVersionIsCompatible() can be used to check whether preprocess saved out of an older release can be loaded into the current release.
In the case where the preprocess version is not compatible a non fatal error will be emitted and preprocess will not be loaded.


Documentation for PathEngine release 5.29 - Copyright © 2002-2012 PathEnginenext: iObstacleSet::pathfindPreprocessNeedsUpdate()