Contents, API Reference, Interfaces, iObstacleSet, getAgent
iObstacleSet::getAgent()
Description
Provided for iterating through the agents in the set.
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 set. |
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 set.
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 iObstacleSet::refAgent().
See Also
iObstacleSet::getNumberOfAgents()
C# Mapping
Agent getAgent(int index); |
Java Mapping
Agent getAgent(int index);
|