Curves
📈 Easily define and evaluate eased curves, similar to Unity's AnimationCurves with modifiers akin to Blender's FCurve Modifiers.
Installation:
npm i curves
npm
documentation 📖
Live Demo 📉
Easily Define and Evaluate Curves
Constructing curves is simple, and evaluating them is even simpler.
; ; // Expected output: // time: 0, value: 0// time: 1, value: 2// time: 2, value: 1.9375// time: 3, value: 1.5// time: 4, value: 1.0625// time: 5, value: 1for ; i < 5; i += 1
Interpolate With Any Type
Curves and keyframes are generic, with 9 built-in type implementations and unlimited potential for more.
; ;;;;;
Add Modifiers to your Curve
Modifiers of any type are easy to create and add to your curve.
; // Define the curve using a builder; // Add layered noise modifierscurve.addModifiernew Modifiers.Number.Noise01, 05;curve.addModifiernew Modifiers.Number.Noise0025, 2; // Add a clamp modifiercurve.addModifiernew Modifiers.Number.Clamp0, 10;