PathEngine home previous: iCollisionContext::clearRunTimeOffMeshConnections()next: iCollisionContext::getConnectedRegionFor()
Contents, API Reference, Interfaces, iCollisionContext, getAgent



Provided for iterating through the set of agents in a context.


iAgent* getAgent(int32_t index) const;


indexThis must be a positive integer less than the number of agents in the context.

Return Value

The agent at the specified index.


The agent index here is only an iteration mechanism.
The order of these indices should not be assumed to coincide with the order in which agents were added, and may be different across different releases.
Also, indices should not be assumed to refer consistently to a single agent after changes to the context.

Note that this method gives you an API object reference to the agent, with the API object reference count for the returned agent incremented accordingly. You need to ensure that delete is called for the returned agent pointer (or it's release() method), when it is no longer required.

If you want to access agent mesh object temporarily, without incrementing the API object reference count, use iCollisionContext::refAgent().

See Also


C# Mapping

Agent getAgent(int index);

Java Mapping

Agent getAgent(int index);

Documentation for PathEngine release 6.00 - Copyright © 2002-2016 PathEnginenext: iCollisionContext::getConnectedRegionFor()