Animation · function
sampleSpring
Where the mass sits at timeSec, given where its anchor has been.
Explained in Animation.
function sampleSpring(settings: SpringSettings, anchorAt: SpringAnchor, timeSec: number, out: Vec3Out): voidimport { sampleSpring } from '@driftengine/animation';Parameters
| Parameter | Type | Description |
|---|---|---|
settings | SpringSettings | |
anchorAt | SpringAnchor | |
timeSec | number | |
out | Vec3Out |
In depth
anchorAt is called many times per sample, at times before timeSec, and must be a pure
function of the time it is handed — the same contract sampleClip holds. An anchor that reads a
clock, or that answers differently on a second call for one time, breaks the property this
module exists to provide and does so silently.