@@ -408,20 +408,20 @@ export function createViewer(
408408 mannequin . root . updateMatrixWorld ( true ) ;
409409 applyGroundLock ( info . groundLock ) ;
410410 applyPins ( info . pins ) ;
411- // Safety net: a phase with neither ground-lock nor a pin has no
412- // per-frame anchor at all, so the root stays frozen at the base pose's
413- // grounded height while the FK animates freely on top of it — bending
414- // joints (e.g. a prone "superman" lift, a supine crunch) can then swing
415- // part of the mesh below the floor with nothing to catch it. Clamp the
416- // root up so the lowest point never dips below y=0; a no-op whenever the
417- // pose is legitimately elevated (bbox min already ≥ 0).
418- if ( info . groundLock . length === 0 && info . pins . length === 0 ) {
411+ // Safety net: nothing above ever intentionally pushes part of the body
412+ // below the floor, so clamp the root up whenever the lowest point dips
413+ // below y=0 — a no-op whenever the pose is legitimately grounded or
414+ // elevated (bbox min already ≥ 0). This also catches phases with
415+ // neither ground-lock nor a pin (the root stays frozen at the base
416+ // pose's grounded height while FK animates freely on top of it, e.g. a
417+ // prone "superman" lift), and pinned phases where a fixed-height anchor
418+ // (a low chair seat) combined with static leg FK can otherwise let the
419+ // feet sink through the floor as the arms fold (e.g. a chair dip).
420+ mannequin . root . updateMatrixWorld ( true ) ;
421+ const box = new THREE . Box3 ( ) . setFromObject ( mannequin . root ) ;
422+ if ( box . min . y < 0 ) {
423+ mannequin . root . position . y -= box . min . y ;
419424 mannequin . root . updateMatrixWorld ( true ) ;
420- const box = new THREE . Box3 ( ) . setFromObject ( mannequin . root ) ;
421- if ( box . min . y < 0 ) {
422- mannequin . root . position . y -= box . min . y ;
423- mannequin . root . updateMatrixWorld ( true ) ;
424- }
425425 }
426426 applyReaches ( info . reaches ) ;
427427 if ( info . phaseName !== lastPhaseName ) {
0 commit comments