Skip to documentation
CranberryClock.Ideas / Systems / Design

INDEPENDENT TOOL / v0.1.0

SpringOverview

Three mechanical friends. One identical nudge. Find the feeling between wobbly and wonderfully calm.

Analytic spring motion for the frame loop you already own.

@cranberry-forge/spring provides a scalar spring, an XYZ vector spring, and a pure stepping function. Change a target without dropping momentum; add an impulse without teleporting. Use the output for camera recoil, UI motion, or secondary animation.

Spring has zero runtime dependencies. It imports no Three.js, React, DOM, clock, renderer, storage, or other Cranberry Forge package. The Jellyworks showcase uses ordinary Three.js meshes to display its values.

Where it fits

Springs and damping are established tools; this package does not claim new physics or the absence of alternatives.

Alternative Useful when
React Spring You want its animation controllers, animated components, interpolation, and React integration. Its configuration already supports spring tuning and initial velocity.
maath/easing and its evolving pmndrs/math repository You want an existing graphics-math toolkit. The former maath repository now redirects to math, whose math/time module includes scalar and vector spring utilities. Check the documentation for the version you use.
Spring You want this small dependency-free ES module, explicit value/velocity/target state, additive velocity impulses, bounded validation, and a frame loop you control.

The distinction is scope and API preference, not unique spring capability or a performance claim. Spring intentionally omits quaternion interpolation, framework bindings, animation scheduling, collision, maximum-speed clamps, and full rigid-body simulation.

View versioned source on GitHub ↗