PathEngine home previous: iAgent::findShortestPathTo_WithQueryCallBack()next: iAgent::generateCurvedPath()
Contents, API Reference, Interfaces, iAgent, firstCollisionTo

iAgent::firstCollisionTo()

Description

Determines the first contact, if any, for movement by the agent along a line to a specified target position.

Syntax

iCollisionInfo* firstCollisionTo(const iCollisionContext* context, tSigned32 x, tSigned32 y, tSigned32& cell) const;

Parameters

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.
Note that the agent is not considered to obstruct itself even if included in this context.
x X coordinate for the end of the line.
y Y coordinate for the end of the line.
cell If there is no collision then this value will be set to the cell at the end of the line.

Requirements

Requires that the agent is moveable and that collision preprocess has been generated on the agent's mesh for the agent's collision shape.

Return Value

If movement along the line is obstructed then an Interface iCollisionInfo object is returned describing the first contact, otherwise zero is returned.

Remarks

The start position passed into this query should not be obstructed.

See The PathEngine Movement Model for details about PathEngine collision.

See Also

iMesh::firstCollision(), iAgent::testCollisionTo_XY()
Documentation for PathEngine release 5.17 - Copyright © 2002-2008 PathEnginenext: iAgent::generateCurvedPath()