fix(render): stop spline overshoot and ground floor-planted hands/feet - #51
Merged
Merged
Conversation
Two root causes behind several movement artifacts, fixed generically so
every movement benefits rather than patching individual examples.
1. Squad spline overshoot at loop-boundary anchors
The squad control-point formula was fed a clamped neighbour at the
start-pose and reset keyframes, yielding a backward-biased tangent
instead of a rest tangent. Large rest-to-rest moves flung the joint
the wrong way then snapped back:
- biceps curl: forearm sat still ~0.2s then snapped 135 deg in one
frame ("curl happens suddenly")
- box squat: the "Sit back" start overshoot threw the torso forward
off the chair ("goes forward / looks stupid")
Fix: mark the structural anchors (start + reset) as rest points so
their segments collapse to a clean slerp. Smooths transitions for all
movements. Adds a red/green regression test.
2. Contact solving missed floor-planted hands/feet
- plank feet floated: ground-lock pivoted the body about the feet to
plant the forearms without grounding the feet first, so the pivot
sat wherever the toes happened to be. Fix: drop the feet to the
floor before pivoting so both ends land.
- plank / mountain-climber hands clawed: the flatten-palm / flat-
fingers logic only recognised hands planted via reach/pin floor. A
high plank uses ground-lock: hands, so those hands were treated as
idle and given the inward resting hook. Fix: treat ground-locked
hands as floor-planted (palms down, fingers flat).
Verified: 248 tests pass (incl. eval grounding invariants), typecheck
clean, and the moves confirmed in the playground.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ot-and-floor-contacts # Conflicts: # packages/posecode-eval/src/probe.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes several movement artifacts by addressing two root causes in the render engine, generically — so every movement benefits, not just the reported examples.
1. Squad spline overshoot at loop-boundary anchors
The squad quaternion spline was fed a clamped neighbour into its control-point formula at the start-pose and reset keyframes, producing a backward-biased tangent instead of a rest tangent. Large rest-to-rest moves flung the joint the wrong way, then snapped back:
Fix (
timeline.ts): mark the structural anchors (start + reset) as rest points, collapsing their segments to a clean slerp. The curl now progresses smoothly through every angle (0→28→52→…→135°) and the squat's hips travel back monotonically. Smooths transitions across all movements.2. Contact solving missed floor-planted hands/feet
groundlock.ts): drop the feet to the floor before pivoting, so both ends land.reach/pin: hands floor. A high plank usesground-lock: hands, so those hands were mis-read as idle and given the inward resting hook. Fix (contacts.ts+index.ts): treat ground-locked hands as floor-planted → palms down, fingers flat.Why
These were reported as: weird plank/mountain-climber hands, plank feet off the ground, biceps curl snapping instead of curling, and box squat lurching forward. Rather than tweak each example, the fixes target the shared root causes so the whole movement library improves.
Testing
render.test.ts): asserts the biceps forearm sweeps in bounded steps — fails without the fix (2.37 rad snap), passes with it.Reviewer notes
plankpose for a flatter look is a possible cosmetic follow-up.probe.tsupdated to passgroundLockthroughalignFloorPalmsso the headless eval pipeline stays faithful to the viewer.