recast-navigation-js
    Preparing search index...

    Class CrowdAgent

    Implements

    Index
    • Parameters

      • crowd: Crowd
      • agentIndex: number

      Returns CrowdAgent

    agentIndex: number
    crowd: Crowd
    interpolatedPosition: Vector3

    The interpolated position of the agent.

    Use this if stepping the crowd with interpolation. This will not be updated if stepping the crowd without interpolation.

    • get collisionQueryRange(): number

      Defines how close a collision element must be before it is considered for steering behaviors. [Limits: > 0]

      Returns number

      2.5
      
    • set collisionQueryRange(value: number): void

      Defines how close a collision element must be before it is considered for steering behaviors. [Limits: > 0]

      Parameters

      • value: number

      Returns void

      2.5
      
    • get height(): number

      The height of the agent.

      Returns number

      1
      
    • set height(value: number): void

      The height of the agent.

      Parameters

      • value: number

      Returns void

      1
      
    • get maxAcceleration(): number

      The maximum allowed acceleration for the agent.

      Returns number

      20
      
    • set maxAcceleration(value: number): void

      The maximum allowed acceleration for the agent.

      Parameters

      • value: number

      Returns void

      20
      
    • get maxSpeed(): number

      The maximum allowed speed for the agent.

      Returns number

      6
      
    • set maxSpeed(value: number): void

      The maximum allowed speed for the agent.

      Parameters

      • value: number

      Returns void

      6
      
    • get obstacleAvoidanceType(): number

      The index of the avoidance configuration to use for the agent. [Limits: 0 <= value <= #DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]

      Returns number

      0
      
    • set obstacleAvoidanceType(value: number): void

      The index of the avoidance configuration to use for the agent. [Limits: 0 <= value <= #DT_CROWD_MAX_OBSTAVOIDANCE_PARAMS]

      Parameters

      • value: number

      Returns void

      0
      
    • get pathOptimizationRange(): number

      The path visibility optimization range. [Limit: > 0]

      Returns number

      0
      
    • set pathOptimizationRange(value: number): void

      The path visibility optimization range. [Limit: > 0]

      Parameters

      • value: number

      Returns void

      0
      
    • get queryFilterType(): number

      The index of the query filter used by this agent.

      Returns number

      0
      
    • set queryFilterType(value: number): void

      The index of the query filter used by this agent.

      Parameters

      • value: number

      Returns void

      0
      
    • get radius(): number

      The radius of the agent.

      Returns number

      0.5
      
    • set radius(value: number): void

      The radius of the agent.

      Parameters

      • value: number

      Returns void

      0.5
      
    • get separationWeight(): number

      How aggresive the agent manager should be at avoiding collisions with this agent. [Limit: >= 0]

      Returns number

      0
      
    • set separationWeight(value: number): void

      How aggresive the agent manager should be at avoiding collisions with this agent. [Limit: >= 0]

      Parameters

      • value: number

      Returns void

      0
      
    • get updateFlags(): number

      Flags that impact steering behavior.

      Returns number

      7
      
    • set updateFlags(value: number): void

      Flags that impact steering behavior.

      Parameters

      • value: number

      Returns void

      7
      
    • get userData(): unknown

      User defined data attached to the agent.

      Returns unknown

      0
      
    • set userData(value: unknown): void

      User defined data attached to the agent.

      Parameters

      • value: unknown

      Returns void

      0
      
    • Returns the local path corridor corners for the agent

      Returns Vector3[]

    • The desired velocity of the agent. Based on the current path, calculated from scratch each frame.

      Returns Vector3

    • The desired velocity adjusted by obstacle avoidance, calculated from scratch each frame.

      Returns Vector3

    • Returns the next target position on the path to the target

      Returns Vector3

    • Returns whether the agent is over an off-mesh connection.

      Returns boolean

    • The position of the agent.

      Returns Vector3

    • Updates the agent's target.

      Parameters

      • position: Vector3

        The new target position.

      Returns boolean

      True if the request was successful.

    • Submits a new move request for the specified agent.

      Parameters

      • velocity: Vector3

        The desired velocity of the agent.

      Returns boolean

      True if the request was successful.

    • Resets the current move request for the specified agent.

      Returns void

    • Sets the agent's parameters. Any parameters not specified in the crowdAgentParams object will be set to their default values.

      Parameters

      Returns void

    • Returns the state of the agent.

      0 = DT_CROWDAGENT_STATE_INVALID 1 = DT_CROWDAGENT_STATE_WALKING 2 = DT_CROWDAGENT_STATE_OFFMESH

      Returns number

    • Returns the next target position on the path to the target

      Returns Vector3

    • Teleports the agent to the specified position.

      Parameters

      Returns void

    • Updates the agent's parameters. Any parameters not specified in the crowdAgentParams object will be unchanged.

      Parameters

      Returns void

    • The actual velocity of the agent. The change from velocityDesiredObstacleAdjusted -> velocity is constrained by max acceleration.

      Returns Vector3