Contents, API Reference, Interfaces, iCollisionContext, getAgent
iCollisionContext::getAgent()
Description
Provided for iterating through the set of agents in a context.
Syntax
std::unique_ptr<iAgent> getAgent(int32_t index) const |
Parameters
| index | | This must be a positive integer less than the number of agents in the context. |
Return Value
The agent at the specified index.Remarks
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
iCollisionContext::getNumberOfAgents()
C# Mapping
Agent getAgent(int index); |
Java Mapping
Agent getAgent(int index);
|