Recast.js
    Preparing search index...

    Class FlockGroup

    Loose emergent group behavior using cohesion and optional alignment.

    Install via recast.withPlugin(FlockGroup), then use recast.createFlockGroup(options).

    Index

    Constructors

    Methods

    • Set the target destination for the whole flock.

      Parameters

      • x: number
      • y: number
      • z: number

      Returns void

    • Add an agent to the flock.

      Parameters

      • id: number

      Returns void

    • Remove an agent from the flock.

      Parameters

      • id: number

      Returns void

    • Stop updating and clean up event listeners.

      Returns void

    • Register this plugin on a recast instance. Called internally by withPlugin.

      Parameters

      Returns void

    Properties

    cohesionWeight: number

    Weight of the cohesion force.

    alignmentWeight: number

    Weight of the alignment force.

    cohesionRadius: number

    Cohesion radius.