Files
VR-Mess/research/vr-body-physics-hugs.md
T

12 KiB

Research: physics player bodies + hugging/contact in VR

Fourth research pass for VR Messs (Godot 4.7, C#, physics hands = force-clamped rigid palms chasing controllers at 90 N; placeholder box rig = procedural torso + 2-bone analytic arms, no Skeleton3D yet; Box3D physics server, joints: pin/hinge/slider/cone-twist→weld-patched). Goal: player arms+chest react physically — hugging characters, body reacting when grabbed. Label: [S] = sourced, [I] = inference. See also vr-arm-ik.md, vr-arm-ik-deep.md, vr-grabbing.md, vr-two-handed-grab.md.

1. Prior art — player body physics in VR

2. Active ragdoll / puppet techniques (how pose-tracking-on-physics is done)

3. Hugging / close contact with characters in VR

4. What sells contact — full sim vs pseudo-physics

  • [S] Boneworks' GDC claim in essence: physics contact sells because forces are CONSISTENT (one 82 kg budget, no infinite forces) — not because bones are individually simulated.
  • [S] Alyx cut arm physics and shipped the best-feeling hands of its generation; Stormland faked arms entirely and scored on body presence. Both prove partial approaches can carry immersion.
  • [S] But neither can HUG: pseudo-physics limbs clip through characters by design, and clip = no hug, no lean, no tug. Boneworks CAN be leaned on things and shove bodies with its chest.
  • [I] Decision rule: pseudo-physics (kinematic torso collider + IK arms) is enough for self-presence, NOT enough for contact mechanics. The minimum real-physics set for hugging is exactly: one physics torso/chest collider + two physical arm segments (we already have palms) with weak pose drives — i.e. an active-ragdoll-torso, not a full skeleton sim.

Constraints: Box3D (pin/hinge/slider/weld-patched-cone-twist), placeholder box rig, no Skeleton3D, physics hands exist. [I] throughout this section unless noted.

  1. Torso = one RigidBody3D (capsule/box), PD-driven toward an HMD-derived target — position from HMD, yaw from the torso-yaw spring already specced in vr-arm-ik-deep.md. Force-CLAMPED chase (same 90 N-class budget pattern as the palms). This body grounds all contact: hug pressure, tug response, door pushes. DO NOT weld the HMD to it — camera stays kinematic (Boneworks' sickness lesson, §1); torso chases the camera, never the reverse.
  2. Arms phase 1 = visual-only 2-bone analytic IK (existing) + existing palm bodies. Chest contact comes from the torso body; arms don't need physics to hug at chest height. Palms colliding with the NPC's body already provide "arms resist contact" below the face.
  3. Arms phase 2 (only if phase 1 reads as clipping) = active-ragdoll upper-arm/forearm segments: rigidbodies per segment, hinge joints, hinge MOTOR targets = the analytic IK solution's angles, low gain + velocity cap (§2 recipe, adapted to Box3D's hinge motors). Joint motors beat per-frame force application — let the solver own it (same lesson as vr-grabbing.md). Skip self-collision entirely (torso↔arm excluded pairs); nobody notices.
  4. Hug detection = contact events, not force analysis: both palms (or forearm segments) in contact with NPC torso + player chest collider touching NPC torso + sustained ≥0.5 s → "embracing" state; read total contact impulse for a pressure value. NPC response = squeeze force ramp on the player torso body + reaction gestures (HuggieBot reactivity finding, §3). Optional: fade the visual arms into a scripted wrap pose during the state — VRChat proves players forgive clipped/faked hugs if the reaction is right.
  5. Grabbed/tugged: free — any joint from an NPC/prop to the torso body makes the whole body react, because the torso is now the anchored mass the palms were implicitly missing. Cap the coupling force below the torso chase budget so tugs can't yank the camera frame (sickness).
  6. Box3D-specific risks: [I] cone-twist is weld-patched → use hinge+motor for limb drives and pin for torso coupling; verify hinge motor max-impulse behavior at 90 Hz before building on it (the godot-box3d-weld.md patch is the precedent for upstreaming what's missing).
  7. Explicitly rejected: full per-bone simulated player skeleton (§1 — nobody ships it; comfort + tuning cost), VRChat-style event-only hugs (no mutual force = no resistance = hollow), Go-Go stretch arms (rejected before in vr-arm-ik.md).