Planeshift
|
Provides local steering behaviors for a group of agents. More...
#include <DetourCrowd.h>
Public Member Functions | |
int | addAgent (const float *pos, const dtCrowdAgentParams *params) |
Adds a new agent to the crowd. | |
dtCrowd () | |
int | getActiveAgents (dtCrowdAgent **agents, const int maxAgents) |
Gets the active agents int the agent pool. | |
const dtCrowdAgent * | getAgent (const int idx) |
Gets the specified agent from the pool. | |
const int | getAgentCount () const |
The maximum number of agents that can be managed by the object. | |
dtQueryFilter * | getEditableFilter () |
Gets the filter used by the crowd. | |
const dtQueryFilter * | getFilter () const |
Gets the filter used by the crowd. | |
const dtProximityGrid * | getGrid () const |
Gets the crowd's proximity grid. | |
const dtNavMeshQuery * | getNavMeshQuery () const |
Gets the query object used by the crowd. | |
const dtObstacleAvoidanceParams * | getObstacleAvoidanceParams (const int idx) const |
Gets the shared avoidance configuration for the specified index. | |
const dtPathQueue * | getPathQueue () const |
Gets the crowd's path request queue. | |
const float * | getQueryExtents () const |
Gets the search extents [(x, y, z)] used by the crowd for query operations. | |
int | getVelocitySampleCount () const |
Gets the velocity sample count. | |
bool | init (const int maxAgents, const float maxAgentRadius, dtNavMesh *nav) |
Initializes the crowd. | |
void | removeAgent (const int idx) |
Removes the agent from the crowd. | |
bool | requestMoveTarget (const int idx, dtPolyRef ref, const float *pos) |
Submits a new move request for the specified agent. | |
bool | requestMoveVelocity (const int idx, const float *vel) |
Submits a new move request for the specified agent. | |
bool | resetMoveTarget (const int idx) |
Resets any request for the specified agent. | |
void | setObstacleAvoidanceParams (const int idx, const dtObstacleAvoidanceParams *params) |
Sets the shared avoidance configuration for the specified index. | |
void | update (const float dt, dtCrowdAgentDebugInfo *debug) |
Updates the steering and positions of all agents. | |
void | updateAgentParameters (const int idx, const dtCrowdAgentParams *params) |
Updates the specified agent's configuration. | |
~dtCrowd () |
Provides local steering behaviors for a group of agents.
Definition at line 191 of file DetourCrowd.h.
dtCrowd::dtCrowd | ( | ) |
dtCrowd::~dtCrowd | ( | ) |
int dtCrowd::addAgent | ( | const float * | pos, |
const dtCrowdAgentParams * | params | ||
) |
Adds a new agent to the crowd.
[in] | pos | The requested position of the agent. [(x, y, z)] |
[in] | params | The configutation of the agent. |
int dtCrowd::getActiveAgents | ( | dtCrowdAgent ** | agents, |
const int | maxAgents | ||
) |
Gets the active agents int the agent pool.
[out] | agents | An array of agent pointers. [(dtCrowdAgent *) * maxAgents] |
[in] | maxAgents | The size of the crowd agent array. |
agents
. const dtCrowdAgent* dtCrowd::getAgent | ( | const int | idx | ) |
Gets the specified agent from the pool.
[in] | idx | The agent index. [Limits: 0 <= value < getAgentCount()] |
const int dtCrowd::getAgentCount | ( | ) | const |
The maximum number of agents that can be managed by the object.
dtQueryFilter* dtCrowd::getEditableFilter | ( | ) | [inline] |
Gets the filter used by the crowd.
Definition at line 308 of file DetourCrowd.h.
const dtQueryFilter* dtCrowd::getFilter | ( | ) | const [inline] |
Gets the filter used by the crowd.
Definition at line 304 of file DetourCrowd.h.
const dtProximityGrid* dtCrowd::getGrid | ( | ) | const [inline] |
Gets the crowd's proximity grid.
Definition at line 320 of file DetourCrowd.h.
const dtNavMeshQuery* dtCrowd::getNavMeshQuery | ( | ) | const [inline] |
Gets the query object used by the crowd.
Definition at line 327 of file DetourCrowd.h.
const dtObstacleAvoidanceParams* dtCrowd::getObstacleAvoidanceParams | ( | const int | idx | ) | const |
Gets the shared avoidance configuration for the specified index.
[in] | idx | The index of the configuration to retreive. [Limits: 0 <= value < DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS] |
const dtPathQueue* dtCrowd::getPathQueue | ( | ) | const [inline] |
Gets the crowd's path request queue.
Definition at line 324 of file DetourCrowd.h.
const float* dtCrowd::getQueryExtents | ( | ) | const [inline] |
Gets the search extents [(x, y, z)] used by the crowd for query operations.
Definition at line 312 of file DetourCrowd.h.
int dtCrowd::getVelocitySampleCount | ( | ) | const [inline] |
Gets the velocity sample count.
Definition at line 316 of file DetourCrowd.h.
Initializes the crowd.
[in] | maxAgents | The maximum number of agents the crowd can manage. [Limit: >= 1] |
[in] | maxAgentRadius | The maximum radius of any agent that will be added to the crowd. [Limit: > 0] |
[in] | nav | The navigation mesh to use for planning. |
void dtCrowd::removeAgent | ( | const int | idx | ) |
Removes the agent from the crowd.
[in] | idx | The agent index. [Limits: 0 <= value < getAgentCount()] |
Submits a new move request for the specified agent.
[in] | idx | The agent index. [Limits: 0 <= value < getAgentCount()] |
[in] | ref | The position's polygon reference. |
[in] | pos | The position within the polygon. [(x, y, z)] |
Submits a new move request for the specified agent.
[in] | idx | The agent index. [Limits: 0 <= value < getAgentCount()] |
[in] | vel | The movement velocity. [(x, y, z)] |
bool dtCrowd::resetMoveTarget | ( | const int | idx | ) |
Resets any request for the specified agent.
[in] | idx | The agent index. [Limits: 0 <= value < getAgentCount()] |
void dtCrowd::setObstacleAvoidanceParams | ( | const int | idx, |
const dtObstacleAvoidanceParams * | params | ||
) |
Sets the shared avoidance configuration for the specified index.
[in] | idx | The index. [Limits: 0 <= value < DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS] |
[in] | params | The new configuration. |
void dtCrowd::update | ( | const float | dt, |
dtCrowdAgentDebugInfo * | debug | ||
) |
Updates the steering and positions of all agents.
[in] | dt | The time, in seconds, to update the simulation. [Limit: > 0] |
[out] | debug | A debug object to load with debug information. [Opt] |
void dtCrowd::updateAgentParameters | ( | const int | idx, |
const dtCrowdAgentParams * | params | ||
) |
Updates the specified agent's configuration.
[in] | idx | The agent index. [Limits: 0 <= value < getAgentCount()] |
[in] | params | The new agent configuration. |