Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ICrowd

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

Hierarchy

  • ICrowd

Implemented by

Index

Methods

addAgentSearch 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

agentGotoSearch playground for agentGoto

  • 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

agentTeleportSearch playground for agentTeleport

  • agentTeleport(index: number, destination: Vector3): void
  • 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

  • dispose(): void
  • Release all resources

    Returns void

getAgentNextTargetPathSearch playground for getAgentNextTargetPath

  • getAgentNextTargetPath(index: number): Vector3
  • Gets the agent next target point on the path

    Parameters

    • index: number

      agent index returned by addAgent

    Returns Vector3

    world space position

getAgentNextTargetPathToRefSearch playground for getAgentNextTargetPathToRef

  • getAgentNextTargetPathToRef(index: number, result: Vector3): void
  • Gets the agent next target point on the path

    Parameters

    • index: number

      agent index returned by addAgent

    • result: Vector3

      output world space position

    Returns void

getAgentPositionSearch playground for getAgentPosition

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

    Parameters

    • index: number

      agent index returned by addAgent

    Returns Vector3

    world space position

getAgentPositionToRefSearch playground for getAgentPositionToRef

  • getAgentPositionToRef(index: number, result: Vector3): void
  • Gets the agent position result in world space

    Parameters

    • index: number

      agent index returned by addAgent

    • result: Vector3

      output world space position

    Returns void

getAgentStateSearch playground for getAgentState

  • getAgentState(index: number): number
  • Gets the agent state

    Parameters

    • index: number

      agent index returned by addAgent

    Returns number

    agent state

getAgentVelocitySearch playground for getAgentVelocity

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

    Parameters

    • index: number

      agent index returned by addAgent

    Returns Vector3

    world space velocity

getAgentVelocityToRefSearch playground for getAgentVelocityToRef

  • getAgentVelocityToRef(index: number, result: Vector3): void
  • Gets the agent velocity result in world space

    Parameters

    • index: number

      agent index returned by addAgent

    • result: Vector3

      output world space velocity

    Returns void

getAgentsSearch playground for getAgents

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

    Returns number[]

    list of agent indices

getDefaultQueryExtentSearch playground for getDefaultQueryExtent

  • Get the Bounding box extent specified by setDefaultQueryExtent

    Returns Vector3

    the box extent values

getDefaultQueryExtentToRefSearch playground for getDefaultQueryExtentToRef

  • getDefaultQueryExtentToRef(result: Vector3): void
  • Get the Bounding box extent result specified by setDefaultQueryExtent

    Parameters

    • result: Vector3

      output the box extent values

    Returns void

overOffmeshConnectionSearch playground for overOffmeshConnection

  • overOffmeshConnection(index: number): boolean
  • 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

removeAgentSearch playground for removeAgent

  • removeAgent(index: number): void
  • remove a particular agent previously created

    Parameters

    • index: number

      agent index returned by addAgent

    Returns void

setDefaultQueryExtentSearch playground for setDefaultQueryExtent

  • setDefaultQueryExtent(extent: Vector3): void
  • 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

  • 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

updateAgentParametersSearch playground for updateAgentParameters

  • Update agent parameters

    Parameters

    • index: number

      agent index returned by addAgent

    • parameters: IAgentParameters

      agent parameters

    Returns void

Legend

  • Property
  • Method
  • Constructor
  • Property
  • Static method