Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 336 vs 337 for /trunk/Source Code/Libs/src/ReCast/DetourCrowd/Include/DetourCrowd.h

Diff revisions: vs.
  @@ -42,13 +42,13 @@
42 42 /// crowd manager.
43 43 /// @ingroup crowd
44 44 /// @see dtObstacleAvoidanceParams, dtCrowd::setObstacleAvoidanceParams(), dtCrowd::getObstacleAvoidanceParams(),
45 - /// dtCrowdAgentParams::obstacleAvoidanceType
45 + /// dtCrowdAgentParams::obstacleAvoidanceType
46 46 static const int DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS = 8;
47 47
48 48 /// The maximum number of query filter types supported by the crowd manager.
49 49 /// @ingroup crowd
50 50 /// @see dtQueryFilter, dtCrowd::getFilter() dtCrowd::getEditableFilter(),
51 - /// dtCrowdAgentParams::queryFilterType
51 + /// dtCrowdAgentParams::queryFilterType
52 52 static const int DT_CROWD_MAX_QUERY_FILTER_TYPE = 16;
53 53
54 54 /// Provides neighbor data for agents managed by the crowd.
  @@ -56,127 +56,127 @@
56 56 /// @see dtCrowdAgent::neis, dtCrowd
57 57 struct dtCrowdNeighbour
58 58 {
59 - int idx; ///< The index of the neighbor in the crowd.
60 - float dist; ///< The distance between the current agent and the neighbor.
59 + int idx; ///< The index of the neighbor in the crowd.
60 + float dist; ///< The distance between the current agent and the neighbor.
61 61 };
62 62
63 63 /// The type of navigation mesh polygon the agent is currently traversing.
64 64 /// @ingroup crowd
65 65 enum CrowdAgentState
66 66 {
67 - DT_CROWDAGENT_STATE_INVALID, ///< The agent is not in a valid state.
68 - DT_CROWDAGENT_STATE_WALKING, ///< The agent is traversing a normal navigation mesh polygon.
69 - DT_CROWDAGENT_STATE_OFFMESH, ///< The agent is traversing an off-mesh connection.
67 + DT_CROWDAGENT_STATE_INVALID, ///< The agent is not in a valid state.
68 + DT_CROWDAGENT_STATE_WALKING, ///< The agent is traversing a normal navigation mesh polygon.
69 + DT_CROWDAGENT_STATE_OFFMESH, ///< The agent is traversing an off-mesh connection.
70 70 };
71 71
72 72 /// Configuration parameters for a crowd agent.
73 73 /// @ingroup crowd
74 74 struct dtCrowdAgentParams
75 75 {
76 - float radius; ///< Agent radius. [Limit: >= 0]
77 - float height; ///< Agent height. [Limit: > 0]
78 - float maxAcceleration; ///< Maximum allowed acceleration. [Limit: >= 0]
79 - float maxSpeed; ///< Maximum allowed speed. [Limit: >= 0]
76 + float radius; ///< Agent radius. [Limit: >= 0]
77 + float height; ///< Agent height. [Limit: > 0]
78 + float maxAcceleration; ///< Maximum allowed acceleration. [Limit: >= 0]
79 + float maxSpeed; ///< Maximum allowed speed. [Limit: >= 0]
80 80
81 - /// Defines how close a collision element must be before it is considered for steering behaviors. [Limits: > 0]
82 - float collisionQueryRange;
81 + /// Defines how close a collision element must be before it is considered for steering behaviors. [Limits: > 0]
82 + float collisionQueryRange;
83 83
84 - float pathOptimizationRange; ///< The path visibility optimization range. [Limit: > 0]
84 + float pathOptimizationRange; ///< The path visibility optimization range. [Limit: > 0]
85 85
86 - /// How aggresive the agent manager should be at avoiding collisions with this agent. [Limit: >= 0]
87 - float separationWeight;
86 + /// How aggresive the agent manager should be at avoiding collisions with this agent. [Limit: >= 0]
87 + float separationWeight;
88 88
89 - /// Flags that impact steering behavior. (See: #UpdateFlags)
90 - unsigned char updateFlags;
89 + /// Flags that impact steering behavior. (See: #UpdateFlags)
90 + unsigned char updateFlags;
91 91
92 - /// The index of the avoidance configuration to use for the agent.
93 - /// [Limits: 0 <= value <= #DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]
94 - unsigned char obstacleAvoidanceType;
92 + /// The index of the avoidance configuration to use for the agent.
93 + /// [Limits: 0 <= value <= #DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]
94 + unsigned char obstacleAvoidanceType;
95 95
96 - /// The index of the query filter used by this agent.
97 - unsigned char queryFilterType;
96 + /// The index of the query filter used by this agent.
97 + unsigned char queryFilterType;
98 98
99 - /// User defined data attached to the agent.
100 - void* userData;
99 + /// User defined data attached to the agent.
100 + void* userData;
101 101 };
102 102
103 103 enum MoveRequestState
104 104 {
105 - DT_CROWDAGENT_TARGET_NONE = 0,
106 - DT_CROWDAGENT_TARGET_FAILED,
107 - DT_CROWDAGENT_TARGET_VALID,
108 - DT_CROWDAGENT_TARGET_REQUESTING,
109 - DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE,
110 - DT_CROWDAGENT_TARGET_WAITING_FOR_PATH,
111 - DT_CROWDAGENT_TARGET_VELOCITY,
105 + DT_CROWDAGENT_TARGET_NONE = 0,
106 + DT_CROWDAGENT_TARGET_FAILED,
107 + DT_CROWDAGENT_TARGET_VALID,
108 + DT_CROWDAGENT_TARGET_REQUESTING,
109 + DT_CROWDAGENT_TARGET_WAITING_FOR_QUEUE,
110 + DT_CROWDAGENT_TARGET_WAITING_FOR_PATH,
111 + DT_CROWDAGENT_TARGET_VELOCITY,
112 112 };
113 113
114 114 /// Represents an agent managed by a #dtCrowd object.
115 115 /// @ingroup crowd
116 116 struct dtCrowdAgent
117 117 {
118 - /// True if the agent is active, false if the agent is in an unused slot in the agent pool.
119 - bool active;
118 + /// True if the agent is active, false if the agent is in an unused slot in the agent pool.
119 + bool active;
120 120
121 - /// The type of mesh polygon the agent is traversing. (See: #CrowdAgentState)
122 - unsigned char state;
121 + /// The type of mesh polygon the agent is traversing. (See: #CrowdAgentState)
122 + unsigned char state;
123 123
124 - /// True if the agent has valid path (targetState == DT_CROWDAGENT_TARGET_VALID) and the path does not lead to the requested position, else false.
125 - bool partial;
124 + /// True if the agent has valid path (targetState == DT_CROWDAGENT_TARGET_VALID) and the path does not lead to the requested position, else false.
125 + bool partial;
126 126
127 - /// The path corridor the agent is using.
128 - dtPathCorridor corridor;
129 -
130 - /// The local boundary data for the agent.
131 - dtLocalBoundary boundary;
132 -
133 - /// Time since the agent's path corridor was optimized.
134 - float topologyOptTime;
135 -
136 - /// The known neighbors of the agent.
137 - dtCrowdNeighbour neis[DT_CROWDAGENT_MAX_NEIGHBOURS];
138 -
139 - /// The number of neighbors.
140 - int nneis;
141 -
142 - /// The desired speed.
143 - float desiredSpeed;
144 -
145 - float npos[3]; ///< The current agent position. [(x, y, z)]
146 - float disp[3];
147 - float dvel[3]; ///< The desired velocity of the agent. [(x, y, z)]
148 - float nvel[3];
149 - float vel[3]; ///< The actual velocity of the agent. [(x, y, z)]
150 -
151 - /// The agent's configuration parameters.
152 - dtCrowdAgentParams params;
153 -
154 - /// The local path corridor corners for the agent. (Staight path.) [(x, y, z) * #ncorners]
155 - float cornerVerts[DT_CROWDAGENT_MAX_CORNERS*3];
156 -
157 - /// The local path corridor corner flags. (See: #dtStraightPathFlags) [(flags) * #ncorners]
158 - unsigned char cornerFlags[DT_CROWDAGENT_MAX_CORNERS];
159 -
160 - /// The reference id of the polygon being entered at the corner. [(polyRef) * #ncorners]
161 - dtPolyRef cornerPolys[DT_CROWDAGENT_MAX_CORNERS];
162 -
163 - /// The number of corners.
164 - int ncorners;
165 -
166 - unsigned char targetState; ///< State of the movement request.
167 - dtPolyRef targetRef; ///< Target polyref of the movement request.
168 - float targetPos[3]; ///< Target position of the movement request (or velocity in case of DT_CROWDAGENT_TARGET_VELOCITY).
169 - dtPathQueueRef targetPathqRef; ///< Path finder ref.
170 - bool targetReplan; ///< Flag indicating that the current path is being replanned.
171 - float targetReplanTime; /// <Time since the agent's target was replanned.
127 + /// The path corridor the agent is using.
128 + dtPathCorridor corridor;
129 +
130 + /// The local boundary data for the agent.
131 + dtLocalBoundary boundary;
132 +
133 + /// Time since the agent's path corridor was optimized.
134 + float topologyOptTime;
135 +
136 + /// The known neighbors of the agent.
137 + dtCrowdNeighbour neis[DT_CROWDAGENT_MAX_NEIGHBOURS];
138 +
139 + /// The number of neighbors.
140 + int nneis;
141 +
142 + /// The desired speed.
143 + float desiredSpeed;
144 +
145 + float npos[3]; ///< The current agent position. [(x, y, z)]
146 + float disp[3];
147 + float dvel[3]; ///< The desired velocity of the agent. [(x, y, z)]
148 + float nvel[3];
149 + float vel[3]; ///< The actual velocity of the agent. [(x, y, z)]
150 +
151 + /// The agent's configuration parameters.
152 + dtCrowdAgentParams params;
153 +
154 + /// The local path corridor corners for the agent. (Staight path.) [(x, y, z) * #ncorners]
155 + float cornerVerts[DT_CROWDAGENT_MAX_CORNERS*3];
156 +
157 + /// The local path corridor corner flags. (See: #dtStraightPathFlags) [(flags) * #ncorners]
158 + unsigned char cornerFlags[DT_CROWDAGENT_MAX_CORNERS];
159 +
160 + /// The reference id of the polygon being entered at the corner. [(polyRef) * #ncorners]
161 + dtPolyRef cornerPolys[DT_CROWDAGENT_MAX_CORNERS];
162 +
163 + /// The number of corners.
164 + int ncorners;
165 +
166 + unsigned char targetState; ///< State of the movement request.
167 + dtPolyRef targetRef; ///< Target polyref of the movement request.
168 + float targetPos[3]; ///< Target position of the movement request (or velocity in case of DT_CROWDAGENT_TARGET_VELOCITY).
169 + dtPathQueueRef targetPathqRef; ///< Path finder ref.
170 + bool targetReplan; ///< Flag indicating that the current path is being replanned.
171 + float targetReplanTime; /// <Time since the agent's target was replanned.
172 172 };
173 173
174 174 struct dtCrowdAgentAnimation
175 175 {
176 - bool active;
177 - float initPos[3], startPos[3], endPos[3];
178 - dtPolyRef polyRef;
179 - float t, tmax;
176 + bool active;
177 + float initPos[3], startPos[3], endPos[3];
178 + dtPolyRef polyRef;
179 + float t, tmax;
180 180 };
181 181
182 182 /// Crowd agent update flags.
  @@ -184,165 +184,165 @@
184 184 /// @see dtCrowdAgentParams::updateFlags
185 185 enum UpdateFlags
186 186 {
187 - DT_CROWD_ANTICIPATE_TURNS = 1,
188 - DT_CROWD_OBSTACLE_AVOIDANCE = 2,
189 - DT_CROWD_SEPARATION = 4,
190 - DT_CROWD_OPTIMIZE_VIS = 8, ///< Use #dtPathCorridor::optimizePathVisibility() to optimize the agent path.
191 - DT_CROWD_OPTIMIZE_TOPO = 16, ///< Use dtPathCorridor::optimizePathTopology() to optimize the agent path.
187 + DT_CROWD_ANTICIPATE_TURNS = 1,
188 + DT_CROWD_OBSTACLE_AVOIDANCE = 2,
189 + DT_CROWD_SEPARATION = 4,
190 + DT_CROWD_OPTIMIZE_VIS = 8, ///< Use #dtPathCorridor::optimizePathVisibility() to optimize the agent path.
191 + DT_CROWD_OPTIMIZE_TOPO = 16, ///< Use dtPathCorridor::optimizePathTopology() to optimize the agent path.
192 192 };
193 193
194 194 struct dtCrowdAgentDebugInfo
195 195 {
196 - int idx;
197 - float optStart[3], optEnd[3];
198 - dtObstacleAvoidanceDebugData* vod;
196 + int idx;
197 + float optStart[3], optEnd[3];
198 + dtObstacleAvoidanceDebugData* vod;
199 199 };
200 200
201 201 /// Provides local steering behaviors for a group of agents.
202 202 /// @ingroup crowd
203 203 class dtCrowd
204 204 {
205 - int m_maxAgents;
206 - dtCrowdAgent* m_agents;
207 - dtCrowdAgent** m_activeAgents;
208 - dtCrowdAgentAnimation* m_agentAnims;
209 -
210 - dtPathQueue m_pathq;
205 + int m_maxAgents;
206 + dtCrowdAgent* m_agents;
207 + dtCrowdAgent** m_activeAgents;
208 + dtCrowdAgentAnimation* m_agentAnims;
209 +
210 + dtPathQueue m_pathq;
211 211
212 - dtObstacleAvoidanceParams m_obstacleQueryParams[DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS];
213 - dtObstacleAvoidanceQuery* m_obstacleQuery;
214 -
215 - dtProximityGrid* m_grid;
216 -
217 - dtPolyRef* m_pathResult;
218 - int m_maxPathResult;
219 -
220 - float m_ext[3];
212 + dtObstacleAvoidanceParams m_obstacleQueryParams[DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS];
213 + dtObstacleAvoidanceQuery* m_obstacleQuery;
214 +
215 + dtProximityGrid* m_grid;
216 +
217 + dtPolyRef* m_pathResult;
218 + int m_maxPathResult;
219 +
220 + float m_ext[3];
221 221
222 - dtQueryFilter m_filters[DT_CROWD_MAX_QUERY_FILTER_TYPE];
222 + dtQueryFilter m_filters[DT_CROWD_MAX_QUERY_FILTER_TYPE];
223 223
224 - float m_maxAgentRadius;
224 + float m_maxAgentRadius;
225 225
226 - int m_velocitySampleCount;
226 + int m_velocitySampleCount;
227 227
228 - dtNavMeshQuery* m_navquery;
228 + dtNavMeshQuery* m_navquery;
229 229
230 - void updateTopologyOptimization(dtCrowdAgent** agents, const int nagents, const float dt);
231 - void updateMoveRequest(const float dt);
232 - void checkPathValidity(dtCrowdAgent** agents, const int nagents, const float dt);
230 + void updateTopologyOptimization(dtCrowdAgent** agents, const int nagents, const float dt);
231 + void updateMoveRequest(const float dt);
232 + void checkPathValidity(dtCrowdAgent** agents, const int nagents, const float dt);
233 233
234 - inline int getAgentIndex(const dtCrowdAgent* agent) const { return (int)(agent - m_agents); }
234 + inline int getAgentIndex(const dtCrowdAgent* agent) const { return (int)(agent - m_agents); }
235 235
236 - bool requestMoveTargetReplan(const int idx, dtPolyRef ref, const float* pos);
236 + bool requestMoveTargetReplan(const int idx, dtPolyRef ref, const float* pos);
237 237
238 - void purge();
239 -
238 + void purge();
239 +
240 240 public:
241 - dtCrowd();
242 - ~dtCrowd();
243 -
244 - /// Initializes the crowd.
245 - /// @param[in] maxAgents The maximum number of agents the crowd can manage. [Limit: >= 1]
246 - /// @param[in] maxAgentRadius The maximum radius of any agent that will be added to the crowd. [Limit: > 0]
247 - /// @param[in] nav The navigation mesh to use for planning.
248 - /// @return True if the initialization succeeded.
249 - bool init(const int maxAgents, const float maxAgentRadius, dtNavMesh* nav);
250 -
251 - /// Sets the shared avoidance configuration for the specified index.
252 - /// @param[in] idx The index. [Limits: 0 <= value < #DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]
253 - /// @param[in] params The new configuration.
254 - void setObstacleAvoidanceParams(const int idx, const dtObstacleAvoidanceParams* params);
255 -
256 - /// Gets the shared avoidance configuration for the specified index.
257 - /// @param[in] idx The index of the configuration to retreive.
258 - /// [Limits: 0 <= value < #DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]
259 - /// @return The requested configuration.
260 - const dtObstacleAvoidanceParams* getObstacleAvoidanceParams(const int idx) const;
261 -
262 - /// Gets the specified agent from the pool.
263 - /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
264 - /// @return The requested agent.
265 - const dtCrowdAgent* getAgent(const int idx);
266 -
267 - /// Gets the specified agent from the pool.
268 - /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
269 - /// @return The requested agent.
270 - dtCrowdAgent* getEditableAgent(const int idx);
271 -
272 - /// The maximum number of agents that can be managed by the object.
273 - /// @return The maximum number of agents.
274 - int getAgentCount() const;
275 -
276 - /// Adds a new agent to the crowd.
277 - /// @param[in] pos The requested position of the agent. [(x, y, z)]
278 - /// @param[in] params The configutation of the agent.
279 - /// @return The index of the agent in the agent pool. Or -1 if the agent could not be added.
280 - int addAgent(const float* pos, const dtCrowdAgentParams* params);
281 -
282 - /// Updates the specified agent's configuration.
283 - /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
284 - /// @param[in] params The new agent configuration.
285 - void updateAgentParameters(const int idx, const dtCrowdAgentParams* params);
286 -
287 - /// Removes the agent from the crowd.
288 - /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
289 - void removeAgent(const int idx);
290 -
291 - /// Submits a new move request for the specified agent.
292 - /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
293 - /// @param[in] ref The position's polygon reference.
294 - /// @param[in] pos The position within the polygon. [(x, y, z)]
295 - /// @return True if the request was successfully submitted.
296 - bool requestMoveTarget(const int idx, dtPolyRef ref, const float* pos);
297 -
298 - /// Submits a new move request for the specified agent.
299 - /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
300 - /// @param[in] vel The movement velocity. [(x, y, z)]
301 - /// @return True if the request was successfully submitted.
302 - bool requestMoveVelocity(const int idx, const float* vel);
303 -
304 - /// Resets any request for the specified agent.
305 - /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
306 - /// @return True if the request was successfully reseted.
307 - bool resetMoveTarget(const int idx);
308 -
309 - /// Gets the active agents int the agent pool.
310 - /// @param[out] agents An array of agent pointers. [(#dtCrowdAgent *) * maxAgents]
311 - /// @param[in] maxAgents The size of the crowd agent array.
312 - /// @return The number of agents returned in @p agents.
313 - int getActiveAgents(dtCrowdAgent** agents, const int maxAgents);
314 -
315 - /// Updates the steering and positions of all agents.
316 - /// @param[in] dt The time, in seconds, to update the simulation. [Limit: > 0]
317 - /// @param[out] debug A debug object to load with debug information. [Opt]
318 - void update(const float dt, dtCrowdAgentDebugInfo* debug);
319 -
320 - /// Gets the filter used by the crowd.
321 - /// @return The filter used by the crowd.
322 - inline const dtQueryFilter* getFilter(const int i) const { return (i >= 0 && i < DT_CROWD_MAX_QUERY_FILTER_TYPE) ? &m_filters[i] : 0; }
323 -
324 - /// Gets the filter used by the crowd.
325 - /// @return The filter used by the crowd.
326 - inline dtQueryFilter* getEditableFilter(const int i) { return (i >= 0 && i < DT_CROWD_MAX_QUERY_FILTER_TYPE) ? &m_filters[i] : 0; }
327 -
328 - /// Gets the search extents [(x, y, z)] used by the crowd for query operations.
329 - /// @return The search extents used by the crowd. [(x, y, z)]
330 - const float* getQueryExtents() const { return m_ext; }
331 -
332 - /// Gets the velocity sample count.
333 - /// @return The velocity sample count.
334 - inline int getVelocitySampleCount() const { return m_velocitySampleCount; }
335 -
336 - /// Gets the crowd's proximity grid.
337 - /// @return The crowd's proximity grid.
338 - const dtProximityGrid* getGrid() const { return m_grid; }
339 -
340 - /// Gets the crowd's path request queue.
341 - /// @return The crowd's path request queue.
342 - const dtPathQueue* getPathQueue() const { return &m_pathq; }
241 + dtCrowd();
242 + ~dtCrowd();
243 +
244 + /// Initializes the crowd.
245 + /// @param[in] maxAgents The maximum number of agents the crowd can manage. [Limit: >= 1]
246 + /// @param[in] maxAgentRadius The maximum radius of any agent that will be added to the crowd. [Limit: > 0]
247 + /// @param[in] nav The navigation mesh to use for planning.
248 + /// @return True if the initialization succeeded.
249 + bool init(const int maxAgents, const float maxAgentRadius, dtNavMesh* nav);
250 +
251 + /// Sets the shared avoidance configuration for the specified index.
252 + /// @param[in] idx The index. [Limits: 0 <= value < #DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]
253 + /// @param[in] params The new configuration.
254 + void setObstacleAvoidanceParams(const int idx, const dtObstacleAvoidanceParams* params);
255 +
256 + /// Gets the shared avoidance configuration for the specified index.
257 + /// @param[in] idx The index of the configuration to retreive.
258 + /// [Limits: 0 <= value < #DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]
259 + /// @return The requested configuration.
260 + const dtObstacleAvoidanceParams* getObstacleAvoidanceParams(const int idx) const;
261 +
262 + /// Gets the specified agent from the pool.
263 + /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
264 + /// @return The requested agent.
265 + const dtCrowdAgent* getAgent(const int idx);
266 +
267 + /// Gets the specified agent from the pool.
268 + /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
269 + /// @return The requested agent.
270 + dtCrowdAgent* getEditableAgent(const int idx);
271 +
272 + /// The maximum number of agents that can be managed by the object.
273 + /// @return The maximum number of agents.
274 + int getAgentCount() const;
275 +
276 + /// Adds a new agent to the crowd.
277 + /// @param[in] pos The requested position of the agent. [(x, y, z)]
278 + /// @param[in] params The configutation of the agent.
279 + /// @return The index of the agent in the agent pool. Or -1 if the agent could not be added.
280 + int addAgent(const float* pos, const dtCrowdAgentParams* params);
281 +
282 + /// Updates the specified agent's configuration.
283 + /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
284 + /// @param[in] params The new agent configuration.
285 + void updateAgentParameters(const int idx, const dtCrowdAgentParams* params);
286 +
287 + /// Removes the agent from the crowd.
288 + /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
289 + void removeAgent(const int idx);
290 +
291 + /// Submits a new move request for the specified agent.
292 + /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
293 + /// @param[in] ref The position's polygon reference.
294 + /// @param[in] pos The position within the polygon. [(x, y, z)]
295 + /// @return True if the request was successfully submitted.
296 + bool requestMoveTarget(const int idx, dtPolyRef ref, const float* pos);
297 +
298 + /// Submits a new move request for the specified agent.
299 + /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
300 + /// @param[in] vel The movement velocity. [(x, y, z)]
301 + /// @return True if the request was successfully submitted.
302 + bool requestMoveVelocity(const int idx, const float* vel);
303 +
304 + /// Resets any request for the specified agent.
305 + /// @param[in] idx The agent index. [Limits: 0 <= value < #getAgentCount()]
306 + /// @return True if the request was successfully reseted.
307 + bool resetMoveTarget(const int idx);
308 +
309 + /// Gets the active agents int the agent pool.
310 + /// @param[out] agents An array of agent pointers. [(#dtCrowdAgent *) * maxAgents]
311 + /// @param[in] maxAgents The size of the crowd agent array.
312 + /// @return The number of agents returned in @p agents.
313 + int getActiveAgents(dtCrowdAgent** agents, const int maxAgents);
314 +
315 + /// Updates the steering and positions of all agents.
316 + /// @param[in] dt The time, in seconds, to update the simulation. [Limit: > 0]
317 + /// @param[out] debug A debug object to load with debug information. [Opt]
318 + void update(const float dt, dtCrowdAgentDebugInfo* debug);
319 +
320 + /// Gets the filter used by the crowd.
321 + /// @return The filter used by the crowd.
322 + inline const dtQueryFilter* getFilter(const int i) const { return (i >= 0 && i < DT_CROWD_MAX_QUERY_FILTER_TYPE) ? &m_filters[i] : 0; }
323 +
324 + /// Gets the filter used by the crowd.
325 + /// @return The filter used by the crowd.
326 + inline dtQueryFilter* getEditableFilter(const int i) { return (i >= 0 && i < DT_CROWD_MAX_QUERY_FILTER_TYPE) ? &m_filters[i] : 0; }
327 +
328 + /// Gets the search extents [(x, y, z)] used by the crowd for query operations.
329 + /// @return The search extents used by the crowd. [(x, y, z)]
330 + const float* getQueryExtents() const { return m_ext; }
331 +
332 + /// Gets the velocity sample count.
333 + /// @return The velocity sample count.
334 + inline int getVelocitySampleCount() const { return m_velocitySampleCount; }
335 +
336 + /// Gets the crowd's proximity grid.
337 + /// @return The crowd's proximity grid.
338 + const dtProximityGrid* getGrid() const { return m_grid; }
339 +
340 + /// Gets the crowd's path request queue.
341 + /// @return The crowd's path request queue.
342 + const dtPathQueue* getPathQueue() const { return &m_pathq; }
343 343
344 - /// Gets the query object used by the crowd.
345 - const dtNavMeshQuery* getNavMeshQuery() const { return m_navquery; }
344 + /// Gets the query object used by the crowd.
345 + const dtNavMeshQuery* getNavMeshQuery() const { return m_navquery; }
346 346 };
347 347
348 348 /// Allocates a crowd object using the Detour allocator.
  @@ -351,7 +351,7 @@
351 351 dtCrowd* dtAllocCrowd();
352 352
353 353 /// Frees the specified crowd object using the Detour allocator.
354 - /// @param[in] ptr A crowd object allocated using #dtAllocCrowd
354 + /// @param[in] ptr A crowd object allocated using #dtAllocCrowd
355 355 /// @ingroup crowd
356 356 void dtFreeCrowd(dtCrowd* ptr);
357 357
  @@ -423,7 +423,7 @@
423 423 is the index of the #dtObstacleAvoidanceParams within the crowd.
424 424
425 425 @see dtObstacleAvoidanceParams, dtCrowd::setObstacleAvoidanceParams(),
426 - dtCrowd::getObstacleAvoidanceParams()
426 + dtCrowd::getObstacleAvoidanceParams()
427 427
428 428 @var dtCrowdAgentParams::collisionQueryRange
429 429 @par