Body step 1: one-time T-pose calibration (prefs.json, forced gate) + True Body solver + shared ArmSolver
- BodyProfile (Winter anthropometry, T-pose: arm = (span - shoulder width)/2 - 1.5 cm) and Prefs (gitignored prefs.json next to the executable / project folder in editor builds) - Calibration node: loads prefs, else head-locked prompt + jitter-proof TPoseDetector; body systems wait for BodyProfile.Current; Recalibrate() in group "calibration"; recal rebuilds arms - ArmSolver: PhysicsArms' elbow solve extracted (behaviour-identical) + min reach |U-F| fix - TrueBody: derived real-body pose (neck, chest yaw + crouch lean at neck pivot, lagging pelvis, moving shoulder girdle with scapulohumeral shrug, arms) + debug skeleton - PhysicsArms/PhysicsTorso/BodyRig now profile-driven (arm length no longer from head height) - TrueBodySpike PASS x3; all spikes PASS x3 (arm spike thresholds re-based for correct 0.57 m arms; CollapseSpike uses a fixed standing profile) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3a990c6dbe
commit
81a9b1fca2
15 files changed
+994
-106
No files matched your search
@@ -6,7 +6,6 @@ public partial class PhysicsTorso : Node
|
||||
private const float MaxForce = 2400f;
|
||||
private const float MaxSpeed = 6f;
|
||||
public const float SnapDistance = 2f;
|
||||
private const float TorsoDrop = 0.42f;
|
||||
private const float TorsoBackOffset = 0.06f;
|
||||
private const float HeadBackOffset = 0.06f;
|
||||
public const float YawHandsWeight = 0.6f;
|
||||
@@ -82,12 +81,20 @@ public partial class PhysicsTorso : Node
|
||||
Node3D head = HeadSource != null ? HeadSource : (Node3D)_camera;
|
||||
if (head == null || _body == null)
|
||||
return;
|
||||
// Main scene: wait for the calibrated profile (the T-pose gate). Headless spikes inject
|
||||
// HeadSource and get the anthropometric estimate from their head height instead.
|
||||
BodyProfile profile = BodyProfile.Current ?? (HeadSource != null ? BodyProfile.Estimate(head.GlobalPosition.Y) : null);
|
||||
if (profile == null)
|
||||
return;
|
||||
// Chest centre sits so that its shoulder line (centre + ShoulderRise) is at the
|
||||
// measured shoulder height below the eyes.
|
||||
float torsoDrop = profile.ShoulderDrop + PhysicsArms.ShoulderRise;
|
||||
float dt = (float)delta;
|
||||
|
||||
_yawBasis = FlatYawBasis(head.GlobalTransform.Basis);
|
||||
Vector3 headPos = head.GlobalPosition - _yawBasis * Vector3.Forward * HeadBackOffset;
|
||||
UpdateTorsoYaw(headPos, dt);
|
||||
NominalTarget = headPos + _torsoBasis * new Vector3(0f, -TorsoDrop, TorsoBackOffset);
|
||||
NominalTarget = headPos + _torsoBasis * new Vector3(0f, -torsoDrop, TorsoBackOffset);
|
||||
Vector3 target = NominalTarget + ReachOffset;
|
||||
TargetPosition = target;
|
||||
|
||||
|
||||
Reference in new issue
Block a user