Planeshift
Public Member Functions

dtCrowd Class Reference

Provides local steering behaviors for a group of agents. More...

#include <DetourCrowd.h>

List of all members.

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 dtCrowdAgentgetAgent (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.
dtQueryFiltergetEditableFilter ()
 Gets the filter used by the crowd.
const dtQueryFiltergetFilter () const
 Gets the filter used by the crowd.
const dtProximityGridgetGrid () const
 Gets the crowd's proximity grid.
const dtNavMeshQuerygetNavMeshQuery () const
 Gets the query object used by the crowd.
const dtObstacleAvoidanceParamsgetObstacleAvoidanceParams (const int idx) const
 Gets the shared avoidance configuration for the specified index.
const dtPathQueuegetPathQueue () const
 Gets the crowd's path request queue.
const floatgetQueryExtents () 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 ()

Detailed Description

Provides local steering behaviors for a group of agents.

Definition at line 191 of file DetourCrowd.h.


Constructor & Destructor Documentation

dtCrowd::dtCrowd ( )
dtCrowd::~dtCrowd ( )

Member Function Documentation

int dtCrowd::addAgent ( const float pos,
const dtCrowdAgentParams params 
)

Adds a new agent to the crowd.

Parameters:
[in]posThe requested position of the agent. [(x, y, z)]
[in]paramsThe configutation of the agent.
Returns:
The index of the agent in the agent pool. Or -1 if the agent could not be added.
int dtCrowd::getActiveAgents ( dtCrowdAgent **  agents,
const int  maxAgents 
)

Gets the active agents int the agent pool.

Parameters:
[out]agentsAn array of agent pointers. [(dtCrowdAgent *) * maxAgents]
[in]maxAgentsThe size of the crowd agent array.
Returns:
The number of agents returned in agents.
const dtCrowdAgent* dtCrowd::getAgent ( const int  idx)

Gets the specified agent from the pool.

Parameters:
[in]idxThe agent index. [Limits: 0 <= value < getAgentCount()]
Returns:
The requested agent.
const int dtCrowd::getAgentCount ( ) const

The maximum number of agents that can be managed by the object.

Returns:
The maximum number of agents.
dtQueryFilter* dtCrowd::getEditableFilter ( ) [inline]

Gets the filter used by the crowd.

Returns:
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.

Returns:
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.

Returns:
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.

Parameters:
[in]idxThe index of the configuration to retreive. [Limits: 0 <= value < DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]
Returns:
The requested configuration.
const dtPathQueue* dtCrowd::getPathQueue ( ) const [inline]

Gets the crowd's path request queue.

Returns:
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.

Returns:
The search extents used by the crowd. [(x, y, z)]

Definition at line 312 of file DetourCrowd.h.

int dtCrowd::getVelocitySampleCount ( ) const [inline]

Gets the velocity sample count.

Returns:
The velocity sample count.

Definition at line 316 of file DetourCrowd.h.

bool dtCrowd::init ( const int  maxAgents,
const float  maxAgentRadius,
dtNavMesh nav 
)

Initializes the crowd.

Parameters:
[in]maxAgentsThe maximum number of agents the crowd can manage. [Limit: >= 1]
[in]maxAgentRadiusThe maximum radius of any agent that will be added to the crowd. [Limit: > 0]
[in]navThe navigation mesh to use for planning.
Returns:
True if the initialization succeeded.
void dtCrowd::removeAgent ( const int  idx)

Removes the agent from the crowd.

Parameters:
[in]idxThe agent index. [Limits: 0 <= value < getAgentCount()]
bool dtCrowd::requestMoveTarget ( const int  idx,
dtPolyRef  ref,
const float pos 
)

Submits a new move request for the specified agent.

Parameters:
[in]idxThe agent index. [Limits: 0 <= value < getAgentCount()]
[in]refThe position's polygon reference.
[in]posThe position within the polygon. [(x, y, z)]
Returns:
True if the request was successfully submitted.
bool dtCrowd::requestMoveVelocity ( const int  idx,
const float vel 
)

Submits a new move request for the specified agent.

Parameters:
[in]idxThe agent index. [Limits: 0 <= value < getAgentCount()]
[in]velThe movement velocity. [(x, y, z)]
Returns:
True if the request was successfully submitted.
bool dtCrowd::resetMoveTarget ( const int  idx)

Resets any request for the specified agent.

Parameters:
[in]idxThe agent index. [Limits: 0 <= value < getAgentCount()]
Returns:
True if the request was successfully reseted.
void dtCrowd::setObstacleAvoidanceParams ( const int  idx,
const dtObstacleAvoidanceParams params 
)

Sets the shared avoidance configuration for the specified index.

Parameters:
[in]idxThe index. [Limits: 0 <= value < DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]
[in]paramsThe new configuration.
void dtCrowd::update ( const float  dt,
dtCrowdAgentDebugInfo debug 
)

Updates the steering and positions of all agents.

Parameters:
[in]dtThe time, in seconds, to update the simulation. [Limit: > 0]
[out]debugA debug object to load with debug information. [Opt]
void dtCrowd::updateAgentParameters ( const int  idx,
const dtCrowdAgentParams params 
)

Updates the specified agent's configuration.

Parameters:
[in]idxThe agent index. [Limits: 0 <= value < getAgentCount()]
[in]paramsThe new agent configuration.

The documentation for this class was generated from the following file: