ICrowd

Crowd Interface. A Crowd is a collection of moving agents constrained by a navigation mesh

Hierarchy

  • ICrowd

Implemented by

Index

Methods

addAgent

Find examples in Playground
  • 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

agentGoto

Find examples in Playground
  • agentGoto(index: number, destination: Vector3): void
  • 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

dispose

Find examples in Playground
  • dispose(): void
  • Release all resources

    Returns void

getAgentPosition

Find examples in Playground
  • getAgentPosition(index: number): Vector3
  • Returns the agent position in world space

    Parameters

    • index: number

      agent index returned by addAgent

    Returns Vector3

    world space position

getAgentVelocity

Find examples in Playground
  • getAgentVelocity(index: number): Vector3
  • Gets the agent velocity in world space

    Parameters

    • index: number

      agent index returned by addAgent

    Returns Vector3

    world space velocity

getAgents

Find examples in Playground
  • getAgents(): number[]
  • get the list of all agents attached to this crowd

    Returns number[]

    list of agent indices

removeAgent

Find examples in Playground
  • removeAgent(index: number): void
  • remove a particular agent previously created

    Parameters

    • index: number

      agent index returned by addAgent

    Returns void

update

Find examples in Playground
  • update(deltaTime: number): void
  • Tick update done by the Scene. Agent position/velocity/acceleration is updated by this function

    Parameters

    • deltaTime: number

      in seconds

    Returns void

Generated using TypeDoc