mwg API
    Preparing search index...

    Class ArticulatedChain

    A serpent's spine as pure positions.

    import { ArticulatedChain } from '@datamoc/mwg/two-d/render';

    const spine = new ArticulatedChain({ segments: 8, length: 12, bendLimit: 45 });
    spine.pull(100, 0);
    spine.update(1); // the body starts following the head
    Index
    points: { x: number; y: number }[] = []
    • one tick of the follower rule: ease toward the parent's previous position, then bend-limit

      Parameters

      • _dt: number

      Returns void