PathEngine home | previous: | next: |
Tells PathEngine about the possibility for agents to move 'off-mesh' between a pair of endpoints, with this movement possibility specified completely dynamically at run-time.
int32_t addRunTimeOffMeshConnection(const cPosition& fromPosition, const cPosition& toPosition, int32_t forwardPenalty, int32_t backPenalty, int32_t forwardConnectionID, int32_t backConnectionID); |
fromPosition |
The start position for the off-mesh connection. This must be a valid | ||
toPosition |
The end position for the off-mesh connection. This must be a valid | ||
forwardPenalty |
A penalty value for traversing the off-mesh connection forward, so from fromPosition to toPosition. This value is added to the straight line cost of movement between the endpoints, and must be in the range 0 to 10000. | ||
backPenalty |
A penalty value for traversing the off-mesh connection in reverse, so from toPosition to fromPosition. A special value of -1 may be specified for this parameter, to indicate that the connection may not be traversed in the reverse direction. Otherwise, this value is added to the straight line cost of movement between the endpoints, and must be in the range 0 to 10000. | ||
forwardConnectionID |
Some application defined value to identify forward movement along this connection.
Any value other than -1 may be specified here (but see the note about potential collisions with static off mesh connection indexes, below). | ||
backConnectionID |
Some application defined value to identify backward movement along this connection.
Any value other than -1 may be specified here (but see the note about potential collisions with static off mesh connection indexes, below). |
A run time off mesh connection 'handle', that can later be passed in to
The values specified for forwardConnectionID and backConnectionID will be reported back for the connection by the iPath interface in the case where a path uses this run-time off mesh connection (in the relevant direction).
Note that connection ID values are distinct from the 'handle' value returned by this method
to identify the connection for the removal.
There is no requirement, then, for these connection IDs to be unique.
In some cases run-time connection IDs can be used just to specify a type of movement for the off-mesh connection.
When run-time off-mesh connections are used together with static off-mesh connections (i.e. off-mesh connections added through the iMesh interface) it is up to the application code to avoid ID collision between these different types of off-mesh connections (for example by offsetting all run-time connection IDs values by the total number of off-mesh connections on the base mesh, or by using negative values other than -1 for run-time connection IDs).
See
int addRunTimeOffMeshConnection(PathEngine.Position fromPosition, PathEngine.Position toPosition, int forwardPenalty, int backPenalty, int forwardConnectionID, int backConnectionID); |
int addRunTimeOffMeshConnection(Position fromPosition, Position toPosition, int forwardPenalty, int backPenalty, int forwardConnectionID, int backConnectionID); |
Documentation for PathEngine release 6.04 - Copyright © 2002-2024 PathEngine | next: |