PathEngine home previous: iMesh::addExternalRef()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

int32_t addOffMeshConnection(int32_t fromEndPoint, int32_t toEndPoint, int32_t 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.

Note that the start and end endpoint pair for each connection added to a mesh should be unique for that mesh, i.e. no two off mesh connections on a mesh should share

the same start and end endpoint index values. (It is ok to have a pair of connections with the same endpoint index pair but reversed, and it is ok for multiple connections to share the same start or end endpoint index.)

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.

C# Mapping

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

Java Mapping

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

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