PathEngine home previous: iMesh::addEndPoint()next: iMesh::autoGenerateConnections()
Contents, API Reference, Interfaces, iMesh, addOffMeshConnection

iMesh::addOffMeshConnection()

Description

Tells PathEngine about the possibility for agents to move 'off-mesh' between a pair of endpoints.

Syntax

tSigned32 addOffMeshConnection(tSigned32 fromEndPoint, tSigned32 toEndPoint, tSigned32 penalty);

Parameters

fromEndPoint An index (previously returned by iMesh::addEndPoint()) to specify the source endpoint for the connection.
toEndPoint An index (previously returned by iMesh::addEndPoint()) to specify the destination endpoint for the connection.
penalty Enables a penalty to be specified for movement across the connection.
This value is added to the straight line cost of movement between the endpoints, and must be in the range 0 to 10000.

Return Value

A unique index for the connection.
(Connection indices start at zero for the first connection added and are then incremented.)
This index is used to refer to this connection, for example, by iPath::connectionIndex().

Remarks

This method may not be called after collision or pathfinding preprocess has been generated or loaded for this mesh.

Any endpoints and connections on a mesh are saved out with the mesh when the mesh is saved.

See Off‑Mesh Connections for an overview of the off-mesh connection functionality, and Working with Off‑Mesh Connections for information about other methods relating to this functionality.


Documentation for PathEngine release 5.17 - Copyright © 2002-2008 PathEnginenext: iMesh::autoGenerateConnections()