PathEngine home previous: iMesh::autoGenerateConnections()next: iMesh::burnContextIntoMesh()
Contents, API Reference, Interfaces, iMesh, buildCollideAndSlidePath

iMesh::buildCollideAndSlidePath()

Description

Builds a path for movement in the specified direction through direct collision tests with sliding against any obstructions encountered.

Syntax

iPath* buildCollideAndSlidePath(iShape* shape, const iCollisionContext* context, const cPosition& start, tSigned32 directionVectorX, tSigned32 directionVectorY, tSigned32 distance) const;

Parameters

shape The collision shape to use for this query.
context The state of dynamic collision that will apply for this query.
An empty context can be specified by passing a value of zero for this argument.
start The start point for the path. This position must be a valid position on this mesh and must not be obstructed (either by static or dynamic obstacles).
directionVectorX X coordinate of the direction vector for agent movement.
directionVectorY Y coordinate of the direction vector for agent movement.
distance Total distance to move.
This is applied approximately, with the total length of the resulting path roughly matching the value given for this parameter when movement is not blocked.

Requirements

Requires that collision preprocess has been generated on this mesh for the collision shape specified.
(Pathfind preprocess is not required for this method.)

Return Value

Always returns a newly created Interface iPath object.
(In cases where movement in the desired direction is blocked immediately, a single position path will be returned, as in the case of pathfinding with identical start and goal positions.)

Remarks

The path generated is similar to the effect of an agent attempting to move continuously in the given direction and sliding against obstruction boundaries.
Note that the method doesn't cut corners at changes in movement direction, with the resulting path then generally not the shortest path to its end position.


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