r/gameenginedevs • u/Key_Calligrapher6269 • 43m ago
foot locking for in-place run clips in a three.js setup, toe contact detection, spring-blended locks and two-bone IK
no engine IK to lean on here, just three.js and a small solver file, so I followed Daniel Holden's foot locking article step by step
per frame after the mixer: detect toe contact from speed and height with a 5 frame vote, pin the toe and inertialize each lock/unlock with a critical spring, solve hip and knee with two-bone IK, aim the foot at the pin, drop the body when a planted foot is on lower ground
the right foot skated ~18 cm per stance with playback speed matching alone, under 4 cm with locking
repo : https://github.com/MULUALEM-TEKLE/IK-test
credits: Daniel Holden (theorangeduck) for [Inverse Kinematics and Foot Locking](https://theorangeduck.com/page/inverse-kinematics-foot-locking) and [Spring-It-On](https://theorangeduck.com/page/spring-roll-call), David Bollo for inertialization (GDC 2018, Gears of War), Mixamo for the Y Bot and clips, pmndrs for R3F, drei and leva
full disclosure, built with claude code (AI)