Body, Mind & Soul — API Reference
    Preparing search index...

    Function computeFollowerUpdates

    • Compute the position updates for the group members that must follow a move. Members listed in movedIds are skipped because they already moved in the same operation. This function has no side effects.

      Parameters

      • group: TokenDocument[] | object[]

        Group members. Each needs id, x, y, and optionally elevation (default 0).

      • movedIds: string[] | Set<string>

        Ids of tokens that moved in this operation.

      • delta: { elevation?: number; x: number; y: number }

        The movement applied to the leader.

        • Optionalelevation?: number

          Change in elevation. Defaults to 0.

        • x: number

          Change in x (pixels).

        • y: number

          Change in y (pixels).

      Returns { _id: string; elevation: number; x: number; y: number }[]

      One update per follower, or an empty array when the delta is zero.