Recast.js
    Preparing search index...

    Class Formation

    Directed geometric formation where each agent holds a numbered slot. The formation rotates to face the direction of travel.

    Install via recast.withPlugin(Formation), then use recast.createFormation(options).

    Index

    Constructors

    Methods

    • Set the target destination for the whole formation.

      Parameters

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

      Returns void

    • Add an agent to the next available slot.

      Parameters

      • id: number

      Returns void

    • Remove an agent by ID, freeing its slot.

      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

    Formation shape.

    spacing: number

    Slot spacing in world units.