[This is preliminary documentation and is subject to change.]

Provides local steering behaviors for a group of agents.

Namespace: org.critterai.nav
Assembly: cai-nav (in cai-nav.dll) Version: 0.4.0.0 (0.4.0.0)

Syntax

         
 C#  Visual Basic  Visual C++ 
public sealed class CrowdManager : ManagedObject
Public NotInheritable Class CrowdManager _
	Inherits ManagedObject
public ref class CrowdManager sealed : public ManagedObject

Members

            
 All Members  Fields   Properties   Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
AddAgent(Vector3, CrowdAgentParams)
Adds an agent to the manager.
AgentCount
The number of agents being managed.
Create(Int32, Single, Navmesh)
Creates a new crowd manager.
Finalize()()()()
Destructor
(Overrides Object..::..Finalize()()()().)
GetAvoidanceConfig(Int32)
Gets the shared avoidance configuration for a specified index.
GetQueryExtents()()()()
The extents used by the manager when it performs queries against the navigation mesh.
GetVelocitySampleCount()()()()
Gets the velocity sample count.
IsDisposed
True if the object has been disposed and should no longer be used.
(Overrides ManagedObject..::..IsDisposed.)
Item[([( Int32])])
The agent from the agent buffer.
MaxAgentRadius
The maximum allowed agent radius supported by the object.
MaxAgents
The maximum number agents that can be managed by the object.
MaxAvoidanceParams
The maximum number of avoidance configurations that can be associated with the manager.
Navmesh
The navigation mesh used by the object.
ProximityGrid
Gets the proximity grid.
Query
The navmesh query used by the manager.
QueryFilter
The query filter used by the manager.
RemoveAgent(CrowdAgent)
Removes an agent from the manager.
RequestDisposal()()()()
Immediately frees all unmanaged resources allocated by the object.
(Overrides ManagedObject..::..RequestDisposal()()()().)
SetAvoidanceConfig(Int32, CrowdAvoidanceParams)
Sets the shared avoidance configuration for a specified index.
Update(Single)
Updates the steering and positions for all agents.

Remarks

This is the core class for all crowd features.

The standard method for setting up the crowd is as follows:

  1. Construct the crowd object.
  2. Set the avoidance configurations using SetAvoidanceConfig(Int32, CrowdAvoidanceParams).
  3. Add agents using AddAgent(Vector3, CrowdAgentParams) and make an initial movement request using RequestMoveTarget(NavmeshPoint).

The standard process for managing the crowd is as follows:

  1. Call Update(Single) to allow the crowd to manage its agents.
  2. Use the CrowdAgent objects to retreive state, such as position.
  3. Make movement requests using RequestMoveTarget(NavmeshPoint) and AdjustMoveTarget(NavmeshPoint).
  4. Repeat every frame.

Some agent configuration settings can be updated using SetConfig(CrowdAgentParams). But the crowd owns the agent position and velocity. If agent position must be fed back into the crowd, the agent must be removed and re-added.

Notes:

  • Path related information is available for newly added agents only after an Update(Single) has been performed.
  • This class is meant to provide 'local' movement. There is a limit of 256 polygons in the path corridor. So the crowd can't provide pathfinding services over long distances.

Behavior is undefined if used after disposal.

Inheritance Hierarchy

System..::..Object
  org.critterai.interop..::..ManagedObject
    org.critterai.nav..::..CrowdManager

See Also