143 float cornerVerts[DT_CROWDAGENT_MAX_CORNERS*3];
165 float initPos[3], startPos[3], endPos[3];
185 float optStart[3], optEnd[3];
211 float m_maxAgentRadius;
213 int m_velocitySampleCount;
217 void updateTopologyOptimization(
dtCrowdAgent** agents,
const int nagents,
const float dt);
218 void updateMoveRequest(
const float dt);
219 void checkPathValidity(
dtCrowdAgent** agents,
const int nagents,
const float dt);
221 inline int getAgentIndex(
const dtCrowdAgent* agent)
const {
return agent - m_agents; }
223 bool requestMoveTargetReplan(
const int idx,
dtPolyRef ref,
const float* pos);
236 bool init(
const int maxAgents,
const float maxAgentRadius,
dtNavMesh* nav);
256 const int getAgentCount()
const;
271 void removeAgent(
const int idx);
278 bool requestMoveTarget(
const int idx,
dtPolyRef ref,
const float* pos);
284 bool requestMoveVelocity(
const int idx,
const float* vel);
289 bool resetMoveTarget(
const int idx);
295 int getActiveAgents(
dtCrowdAgent** agents,
const int maxAgents);
341 #endif // DETOURCROWD_H float maxSpeed
Maximum allowed speed. [Limit: >= 0].
Represents an agent managed by a dtCrowd object.
dtCrowdAgentParams params
The agent's configuration parameters.
float dist
The distance between the current agent and the neighbor.
unsigned int dtPolyRef
A handle to a polygon within a navigation mesh tile.
The agent is traversing an off-mesh connection.
int nneis
The number of neighbors.
Represents a dynamic polygon corridor used to plan agent movement. ,.
static const int DT_CROWDAGENT_MAX_CORNERS
The maximum number of corners a crowd agent will look ahead in the path. This value is used for sizin...
Provides local steering behaviors for a group of agents.
float pathOptimizationRange
The path visibility optimization range. [Limit: > 0].
int ncorners
The number of corners.
dtPathQueueRef targetPathqRef
Path finder ref.
int idx
The index of the neighbor in the crowd.
dtPolyRef targetRef
Target polyref of the movement request.
static const int DT_CROWDAGENT_MAX_NEIGHBOURS
The maximum number of neighbors that a crowd agent can take into account for steering decisions...
Provides neighbor data for agents managed by the crowd.
unsigned char targetState
State of the movement request.
The agent is traversing a normal navigation mesh polygon.
dtQueryFilter * getEditableFilter()
Gets the filter used by the crowd.
Defines polygon filtering and traversal costs for navigation mesh query operations.
const float * getQueryExtents() const
Gets the search extents [(x, y, z)] used by the crowd for query operations.
A navigation mesh based on tiles of convex polygons.
UpdateFlags
Crowd agent update flags.
unsigned char obstacleAvoidanceType
The index of the avoidance configuration to use for the agent. [Limits: 0 <= value <= DT_CROWD_MAX_OB...
The agent is not in a valid state.
float height
Agent height. [Limit: > 0].
dtCrowd * dtAllocCrowd()
Allocates a crowd object using the Detour allocator.
unsigned int dtPathQueueRef
unsigned char active
1 if the agent is active, or 0 if the agent is in an unused slot in the agent pool.
const dtProximityGrid * getGrid() const
Gets the crowd's proximity grid.
Use dtPathCorridor::optimizePathVisibility() to optimize the agent path.
const dtQueryFilter * getFilter() const
Gets the filter used by the crowd.
bool targetReplan
Flag indicating that the current path is being replanned.
Use dtPathCorridor::optimizePathTopology() to optimize the agent path.
float desiredSpeed
The desired speed.
unsigned char updateFlags
Flags that impact steering behavior. (See: UpdateFlags)
float collisionQueryRange
Defines how close a collision element must be before it is considered for steering behaviors...
float separationWeight
How aggresive the agent manager should be at avoiding collisions with this agent. [Limit: >= 0]...
unsigned char state
The type of mesh polygon the agent is traversing. (See: CrowdAgentState)
const dtPathQueue * getPathQueue() const
Gets the crowd's path request queue.
float topologyOptTime
Time since the agent's path corridor was optimized.
void dtFreeCrowd(dtCrowd *ptr)
Frees the specified crowd object using the Detour allocator.
dtObstacleAvoidanceDebugData * vod
dtLocalBoundary boundary
The local boundary data for the agent.
Configuration parameters for a crowd agent.
dtPathCorridor corridor
The path corridor the agent is using.
static const int DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS
The maximum number of crowd avoidance configurations supported by the crowd manager.
void * userData
User defined data attached to the agent.
CrowdAgentState
The type of navigation mesh polygon the agent is currently traversing.
Provides the ability to perform pathfinding related queries against a navigation mesh.
float radius
Agent radius. [Limit: >= 0].
const dtNavMeshQuery * getNavMeshQuery() const
Gets the query object used by the crowd.
float maxAcceleration
Maximum allowed acceleration. [Limit: >= 0].
int getVelocitySampleCount() const
Gets the velocity sample count.