PathEngine home previous: iMesh::get3DFaceVertexIndexInMesh()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(const iShape& shape, const iCollisionContext* context, const cPosition& position, tVector& overlappedAgents) 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 nullptr for this argument.
position The position to be tested. This position must be a valid position on this mesh
overlappedAgents (See Passing Arrays.) Returns the set of agents overlapped by the query shape. Note that this result set can't be larger than the number of agents in the context passed in.

Requirements

Requires that unobstructed space 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().)

See Also

iMesh::generateUnobstructedSpaceFor(), iMesh::shapeCanCollide(), iMesh::testPointCollision()

C# Mapping

void getAllAgentsOverlapped(Shape shape, CollisionContext context, PathEngine.Position position, out Agent[] overlappedAgents);

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