Skip to content

v0.12.0 - Under the Hood

Choose a tag to compare

@kvvasuu kvvasuu released this 30 Sep 09:33
· 155 commits to main since this release

v0.12.0 - Under the Hood

A rewrite of the engine. The core now runs on math as plain data and functions, with no three.js or React. The React components and their props work as before.

✨ New Features

  • Framework-agnostic core - @kvvasuu/klipp has no dependencies beyond math. Every Body, Aim, Extension and Noise is also available as a function (updateFollow, updateHardLookAt, ...), so klipp works with any engine, an ECS or your own loop.
  • One entry point per layer - @kvvasuu/klipp (core), /three, /react and /dom. three is now an optional peer dependency too, needed only by /three and /react.
  • Each target is read once per frame, however many cameras and pieces use it.
  • DebugOverlay in /dom draws composer and framing zones without React.
  • Runs in Node without a bundler - the build is now valid ESM.

⚠️ Breaking Changes

  • three.js classes moved to @kvvasuu/klipp/three - FollowBody, HardLookAtAim and the other Bodies/Aims, applyCameraState, copyCameraStateFromCamera, resolveTarget*, Vector3Damper and QuaternionDamper. @kvvasuu/klipp/camera-controls is now @kvvasuu/klipp/three/camera-controls.
  • Vectors are arrays - CameraState and class fields like offset use [x, y, z] and [x, y, z, w] instead of Vector3 and Quaternion. Props still accept both.
  • BlendCurves.hardIn / hardOut renamed to cubicIn / cubicOut, matching math.

🔄 Behavior Changes

  • Damping uses math's exact spring. Motion is slightly different from 0.11 (about 1% of a typical move), most noticeably after large jumps.

🐛 Bug Fixes

  • ImpulseField no longer grows without bound - expired impulses are now also dropped on generate, not only while a listener samples the field.

🔧 Internal Changes

  • No per-frame allocations in the camera loop.
  • Simpler docs and example scenes; the examples cap the canvas DPR at 1.5.
  • Layer boundaries enforced by lint.
  • Golden trajectory tests guard camera motion frame by frame.
  • TypeScript 7, Vitest 5, three 0.186.

What's Changed

Full Changelog: v0.11.0...v0.12.0