haathWebXR

Debug overlay

@treefour/haath/debug draws a small DOM panel with live signs, finger states, speeds, and spell triggers. It is useful on desktop with the emulator and in the Quest browser before entering VR.

import { initGesturePreview } from '@treefour/haath/debug';

const preview = initGesturePreview({ position: 'top-right', showKinematics: true, showSigns: true, showSpells: true });

// per frame, after haath.update(...)
preview.update(haath.state);

// later
preview.setVisible(false);
preview.destroy();

position accepts top-left, top-right, bottom-left, and bottom-right. Outside a browser (document undefined) it returns a no-op controller, so it is safe to import in tests.

Last updated 2026-11-16