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 Copy
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
Readonly
move the head; the body follows on the next update
update
one tick of the follower rule: ease toward the parent's previous position, then bend-limit
A serpent's spine as pure positions.
Example