Finger signs
Fist, open palm, palm up and down, finger gun, poke, pinch, thumbs up and down, horns, shaka, and more, from bone-segment curl that works at any hand size or angle.
Open source · MIT · v0.0.4
update() call.haath is a zero-dependency JavaScript library that turns WebXR hand joints into game input: finger signs, punches and slaps, claps, circles, and two-hand spells. Built for Meta Quest and battle-tested in DunJun.
npm i @treefour/haathNo headset needed. These are synthetic 25-joint hands going through the real haath engine via updateFromPoses(), in your browser.
Left hand
Right hand
Motion
Loading haath…
Fist, open palm, palm up and down, finger gun, poke, pinch, thumbs up and down, horns, shaka, and more, from bone-segment curl that works at any hand size or angle.
Velocity-gated strikes with real m/s speed and a velocity vector, so hits carry momentum.
Palm, wrist, fingertip, and swept-palm collision against targets, with per-target cooldowns. Fast hands cannot tunnel through.
Double clap, hands crossed, finger counting from 0 to 10, triangle laser, and a charged two-palm blast.
3D circle traces in any plane, fitted with Newell's method, plus laser and disc hit helpers.
Hold-to-confirm timers, a debug overlay, a PC hand emulator, and a v2 engine with ASL poses and micro-gestures.
One instance, one call per frame. Everything else is a field read.
import { Haath } from '@treefour/haath';
const haath = new Haath();
renderer.setAnimationLoop((_t, frame) => {
if (frame) {
const xr = renderer.xr;
const state = haath.update(frame, xr.getReferenceSpace(), xr.getSession()?.inputSources, dt);
if (state.right.gesture === 'punch') hit(state.right.velocity);
if (state.twoHand.clap.doubleClap) pause();
}
renderer.render(scene, camera);
});haath reads the standard WebXR XRFrame and XRHand API and never imports an engine.
The per-frame path allocates nothing. State is reused, so there are no garbage collection hitches mid-punch.
Runs on the main thread in the same XR frame. No worker round trip, no dropped contacts.
No engine, no physics library, no pose files to download. TypeScript types and ESM plus CJS builds.
haath powers every punch, slap, spell, and menu in DunJun, a hand-tracked WebXR brawler on Meta Quest, built by Tree Four Studio.