PathEngine home previous: iMesh::get3DFaceVertex()next: iMesh::getBurntInObstacleRoot()
Contents, API Reference, Interfaces, iMesh, getAllAgentsOverlapped

iMesh::getAllAgentsOverlapped()

Description

Fills a buffer with the set of agents in a given context overlapped by the given shape at the given position.

Syntax

void getAllAgentsOverlapped(iShape* shape, const iCollisionContext* context, const cPosition& position, iAgent** resultsBuffer, tSigned32& numberOverlapped) 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.
position The position to be tested. This position must be a valid position on this mesh
resultsBufferA pointer to a buffer to be filled with the results of the query. The buffer must be large enough to hold the maximum number of agents that could potentially be returned by the query.
numberOverlappedReturns the number of agents overlapped.

Requirements

Requires that collision preprocess has been generated on this mesh for the collision shape specified.

Remarks

This query is useful for implementing logic depending on collision between agents, in the case where the agents don't need to actually impede each other's movement.
For example the context passed in may contain a set of floor switches in the world.
Once you have the set of overlapped agents a common technique is to use the 'user data' stored with those agents to trigger any relevant consequences.
(See iAgent::setUserData() and iAgent::getUserData().)

The simplest way to guarantee that the results buffer is large enough for the set of overlapped agents is to allocate a buffer the size of the context passed in.

See Also

iMesh::generateCollisionPreprocessFor(), iMesh::shapeCanCollide(), iMesh::testPointCollision()
Documentation for PathEngine release 5.17 - Copyright © 2002-2008 PathEnginenext: iMesh::getBurntInObstacleRoot()