Previously checked both feet's X displacement for step-left/right
reset, so a persistent offset in the non-stepping foot prevented
reset. Now tracks which foot triggered the step and only checks
that foot's displacement on the triggering axis.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
stepsReset now checks only the X axis for left/right steps and only
the Z axis for forward/back steps. Previously used Euclidean distance
of both axes, so a persistent offset in the non-triggering axis
prevented reset indefinitely.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy Log now exports unbounded StepLogEntry array from session start,
including: raw toe XZ (hip-relative), current baseline XZ, displacement
XZ, and active step signal per frame.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Applies 0.99/0.01 EMA to heelBaseL/R X and Z when no step is active,
same approach as the ankle Y baseline adaptation. Prevents the resting
position from drifting away from the threshold over time.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Framing stage now checks toes are above 90% of frame height,
ensuring the person stands far enough back for room below feet.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pauses when landmarks are lost during gameplay. Resumes when head,
ankles, toes are visible and arms-out is detected. Adds 100px
bottom bar below the video feed for the stage text.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collect toe (31/32) X/Z positions during the 5s calibration and
average them for the step detection baseline. More stable than a
single snapshot. Switched from heels (29/30) to toes (31/32) for
step detection.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Yellow background highlights the time range when a step is active
(from detection until reset). L/R graph highlights step-left and
step-right, F/B graph highlights step-forward and step-back.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two graphs on the left side:
- LEFT/RIGHT (X): shows heel X displacement, L=cyan, R=magenta
- FORWARD/BACK (Z): shows heel Z displacement, same colors
Each graph shows threshold (red dashed) and reset (orange dashed)
lines symmetrically around zero. Updates live with settings sliders.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Exposes L/R threshold, F/B threshold, and reset hysteresis as
sliders in settings. Uses a ref so changes apply immediately
without restarting the MediaPipe pipeline.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Step detection now uses worldToCamera-converted coordinates instead
of hip-relative worldLandmarks. Camera coords: X+ = right, Z+ = into
scene (forward for subject facing camera). Fixed forward/back mapping.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove AR squares and multi-step positioning. Simplify to:
1. 5s calibration → center confirm with arms-out → ready
2. Detect directional steps by comparing heel worldLandmarks XZ
displacement from baseline (>12cm threshold, 8cm hysteresis)
3. Show step direction as text label
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Detects both wrists at shoulder height using worldLandmarks Y.
Replaces palms-together as the positioning confirmation signal.
Both gestures remain available during gameplay.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Measures 3D distance between heels in worldLandmarks during the 5s
calibration, averages it, adds 10cm margin. Uses this as the tile
size for both preview and placed squares.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Estimates hip depth from camera using hip-to-ankle height ratio
(pinhole model), then offsets all worldLandmarks into camera space.
Displays both hip-relative (cyan) and camera-relative (orange)
coordinates for ankles and toes.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The dynamic camera height from worldLandmarks was breaking the
raycast-in/render-out cancellation — squares placed at one camera
height rendered wrong when the height shifted later. With multi-step
calibration, a fixed camera is correct: any projection error cancels
out since the same camera does both placement and rendering.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replaces single-position lock with 5-step calibration:
1. Stand at center → palms
2. Step left → palms
3. Step forward → palms
4. Step right → palms
5. Step back → palms
Each confirmed foot position is raycasted to 3D and a square is
placed there. Since raycast-in and render-out use the same camera,
squares appear exactly at the calibrated screen positions regardless
of camera parameter accuracy.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Detects palms touching when wrists are <15cm apart in 3D space.
Works as both a gameplay gesture and a positioning confirmation
(alternative to standing still 3s).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Exposes webcam H-FOV and camera height offset as tunable sliders
in settings. Adds a subtle floor grid to the AR scene for spatial
reference.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Compute proper vertical FOV from assumed 63° horizontal (was incorrectly
using 63° as vertical, making depth ~2x off)
- Dynamically set camera height from worldLandmarks leg length instead of
hardcoded 1.1m — adapts to actual person proportions
- Pass worldLandmarks from MediaPipe result to AR scene
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace left-leg-raise confirmation with stand-still detection.
User walks to center, stops moving, and a 3-2-1 countdown confirms
the position. Uses EMA-smoothed ankle positions to detect stillness.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace jump-to-lock with a positioning flow: after calibration,
user walks to center of play zone and raises left leg to confirm.
That foot position becomes the locked AR square center.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>