PathEngine home previous: iMesh::findShortestPath_WithQueryCallBack()next: iMesh::generateCollisionPreprocessFor()
Contents, API Reference, Interfaces, iMesh, firstCollision

iMesh::firstCollision()

Description

Determines the first contact, if any, for an agent with the specified collision shape moving along the specified line.

Syntax

iCollisionInfo* firstCollision(iShape* shape, const iCollisionContext* context, const cPosition& start, tSigned32 x, tSigned32 y, tSigned32& cell) 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 of the line. This position must be a valid position on this mesh
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 collision preprocess has been generated on this mesh for the collision shape specified.

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::testLineCollision(), iMesh::testLineCollision_XY(), iMesh::firstCollision()
Documentation for PathEngine release 5.17 - Copyright © 2002-2008 PathEnginenext: iMesh::generateCollisionPreprocessFor()