Class RecastJSCrowd
Hierarchy
- RecastJSCrowd
Implements
Index
Constructors
Properties
Methods
- add
Agent - agent
Goto - agent
Teleport - dispose
- get
Agent Next Target Path - get
Agent Next Target Path ToRef - get
Agent Position - get
Agent Position ToRef - get
Agent State - get
Agent Velocity - get
Agent Velocity ToRef - get
Agents - get
Corners - get
Default Query Extent - get
Default Query Extent ToRef - over
Offmesh Connection - remove
Agent - set
Default Query Extent - update
- update
Agent Parameters
Constructors
constructor
-
Constructor
Parameters
-
plugin: RecastJSPlugin
recastJS plugin
-
maxAgents: number
the maximum agent count in the crowd
-
maxAgentRadius: number
the maximum radius an agent can have
-
scene: Scene
to attach the crowd to
Returns RecastJSCrowd
the crowd you can add agents to
-
Properties
agentsSearch playground for agents
All agents created
bjsRECASTPluginSearch playground for bjsRECASTPlugin
Recast/detour plugin
on Reach Target ObservableSearch playground for onReachTargetObservable
Fires each time an agent is in reach radius of its destination
reach RadiiSearch playground for reachRadii
agents reach radius
recast CrowdSearch playground for recastCrowd
Link to the detour crowd
transformsSearch playground for transforms
One transform per agent
Methods
add AgentSearch playground for addAgent
-
Add a new agent to the crowd with the specified parameter a corresponding transformNode. You can attach anything to that node. The node position is updated in the scene update tick.
Parameters
-
pos: Vector3
world position that will be constrained by the navigation mesh
-
parameters: IAgentParameters
agent parameters
-
transform: TransformNode
hooked to the agent that will be update by the scene
Returns number
agent index
-
agent GotoSearch playground for agentGoto
-
Asks a particular agent to go to a destination. That destination is constrained by the navigation mesh
Parameters
-
index: number
agent index returned by addAgent
-
destination: Vector3
targeted world position
Returns void
-
agent TeleportSearch playground for agentTeleport
-
Teleport the agent to a new position
Parameters
-
index: number
agent index returned by addAgent
-
destination: Vector3
targeted world position
Returns void
-
disposeSearch playground for dispose
-
Release all resources
Returns void
get Agent Next Target PathSearch playground for getAgentNextTargetPath
-
Returns the agent next target point on the path
Parameters
-
index: number
agent index returned by addAgent
Returns Vector3
world space position
-
get Agent Next Target Path ToRefSearch playground for getAgentNextTargetPathToRef
-
Returns the agent next target point on the path
Parameters
-
index: number
agent index returned by addAgent
-
result: Vector3
output world space position
Returns void
-
get Agent PositionSearch playground for getAgentPosition
-
Returns the agent position in world space
Parameters
-
index: number
agent index returned by addAgent
Returns Vector3
world space position
-
get Agent Position ToRefSearch playground for getAgentPositionToRef
-
Returns the agent position result in world space
Parameters
-
index: number
agent index returned by addAgent
-
result: Vector3
output world space position
Returns void
-
get Agent StateSearch playground for getAgentState
-
Gets the agent state
Parameters
-
index: number
agent index returned by addAgent
Returns number
agent state
-
get Agent VelocitySearch playground for getAgentVelocity
-
Returns the agent velocity in world space
Parameters
-
index: number
agent index returned by addAgent
Returns Vector3
world space velocity
-
get Agent Velocity ToRefSearch playground for getAgentVelocityToRef
-
Returns the agent velocity result in world space
Parameters
-
index: number
agent index returned by addAgent
-
result: Vector3
output world space velocity
Returns void
-
get AgentsSearch playground for getAgents
-
get the list of all agents attached to this crowd
Returns number[]
list of agent indices
get CornersSearch playground for getCorners
-
Get the next corner points composing the path (max 4 points)
Parameters
-
index: number
agent index returned by addAgent
Returns Vector3[]
array containing world position composing the path
-
get Default Query ExtentSearch playground for getDefaultQueryExtent
-
Get the Bounding box extent specified by setDefaultQueryExtent
Returns Vector3
the box extent values
get Default Query Extent ToRefSearch playground for getDefaultQueryExtentToRef
-
Get the Bounding box extent result specified by setDefaultQueryExtent
Parameters
-
result: Vector3
output the box extent values
Returns void
-
over Offmesh ConnectionSearch playground for overOffmeshConnection
-
returns true if the agent in over an off mesh link connection
Parameters
-
index: number
agent index returned by addAgent
Returns boolean
true if over an off mesh link connection
-
remove AgentSearch playground for removeAgent
-
remove a particular agent previously created
Parameters
-
index: number
agent index returned by addAgent
Returns void
-
set Default Query ExtentSearch playground for setDefaultQueryExtent
-
Set the Bounding box extent for doing spatial queries (getClosestPoint, getRandomPointAround, ...) The queries will try to find a solution within those bounds default is (1,1,1)
Parameters
-
extent: Vector3
x,y,z value that define the extent around the queries point of reference
Returns void
-
updateSearch playground for update
-
Tick update done by the Scene. Agent position/velocity/acceleration is updated by this function
Parameters
-
deltaTime: number
in seconds
Returns void
-
update Agent ParametersSearch playground for updateAgentParameters
-
Update agent parameters
Parameters
-
index: number
agent index returned by addAgent
-
parameters: IAgentParameters
agent parameters
Returns void
-
Recast detour crowd implementation