Body step 2.1: climbing, mantling, crawling, legs, playground, 144 Hz
- Step rule + lower-body collider: no walking onto tables, steps <= 0.35 m - Structural hand strength: two-hand mantle/pull-up works, one hand can't - Arms aim from the physical shoulder horizontally, keep True Body pose vertically - Crawl pose, crawl carry, 35 deg slope limit, ground feed-forward ignores play-space corrections (fixes a runaway feedback loop) - Grab static world (climbing), procedural visual legs - Playground sandbox; menu strength slider, spectator (old drag) and turn toggles - Physics 144 Hz with interpolation; legacy chase-body spikes pin 90 Hz - RagdollSpike: 27 phases incl. mantle, pull-up, crawl, ledge drop, ramps Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d83273dd2f
commit
2aff2b61da
26 files changed
+1243
-70
No files matched your search
+24
-11
@@ -14,6 +14,10 @@ public sealed class TrueBodySolver
|
||||
public const float ChestLeanMax = 0.75f; // rad (~43°) at a deep crouch
|
||||
public const float CrouchRange = 0.5f; // crouch factor 1 when eyes are this fraction of standing eye height lower
|
||||
public const float HeadPitchToChest = 0.25f;
|
||||
// Crawl: when the head gets so low that the hips would go through the floor, the trunk tips
|
||||
// further (pivoting at the hips, hips kicking back) up to nearly horizontal (Nimso: lower = crawl).
|
||||
public const float CrawlLeanMax = 1.45f; // rad (~83°)
|
||||
public const float HipMinHeight = 0.15f; // hip joint above the floor when crawling
|
||||
public const float PelvisFrequency = 2.5f; // Hz, critically damped follow → hip lag/sway
|
||||
public const float GirdleReachStart = 0.98f; // fraction of arm length where the shoulder starts to help
|
||||
public const float GirdleSmoothRate = 15f;
|
||||
@@ -100,18 +104,27 @@ public sealed class TrueBodySolver
|
||||
Crouch = Mathf.Clamp((standingPivot - pivotAboveFloor) / (CrouchRange * p.EyeHeight), 0f, 1f);
|
||||
float headPitchDown = Mathf.Max(0f, -Mathf.Asin(Mathf.Clamp(headFwd.Y, -1f, 1f)));
|
||||
float lean = Crouch * ChestLeanMax + headPitchDown * HeadPitchToChest;
|
||||
Lean = lean;
|
||||
ChestBasis = yawBasis * new Basis(Vector3.Right, -lean);
|
||||
|
||||
// Neck: from the head pivot down along the average of chest-up and head-up, sized so a
|
||||
// standing, level head puts the shoulder joints at the measured drop below the eyes.
|
||||
float trunk = TrunkRatio * p.Stature;
|
||||
float neckLen = Mathf.Max(0.05f, p.ShoulderDrop + EyeToNeckPivot.Y - NeckBaseAboveShoulders);
|
||||
Vector3 neckDir = (ChestBasis.Y + headBasis.Y).Normalized();
|
||||
NeckBase = NeckPivot - neckDir * neckLen;
|
||||
// Keep the shoulder line behind the eyes by the anthropometric offset (neck pivot already
|
||||
// supplies part of it).
|
||||
UpperChest = NeckBase - ChestBasis.Y * NeckBaseAboveShoulders
|
||||
+ ChestBasis * new Vector3(0f, 0f, ShouldersBehindEyes - EyeToNeckPivot.Z);
|
||||
Vector3 neckDir = Vector3.Up;
|
||||
for (int iter = 0; iter < 3; iter++)
|
||||
{
|
||||
ChestBasis = yawBasis * new Basis(Vector3.Right, -lean);
|
||||
// Neck: from the head pivot down along the average of chest-up and head-up, sized so a
|
||||
// standing, level head puts the shoulder joints at the measured drop below the eyes.
|
||||
neckDir = (ChestBasis.Y + headBasis.Y).Normalized();
|
||||
NeckBase = NeckPivot - neckDir * neckLen;
|
||||
// Keep the shoulder line behind the eyes by the anthropometric offset (neck pivot already
|
||||
// supplies part of it).
|
||||
UpperChest = NeckBase - ChestBasis.Y * NeckBaseAboveShoulders
|
||||
+ ChestBasis * new Vector3(0f, 0f, ShouldersBehindEyes - EyeToNeckPivot.Z);
|
||||
float room = (UpperChest.Y - floorY - HipMinHeight) / trunk;
|
||||
float crawl = Mathf.Acos(Mathf.Clamp(room, Mathf.Cos(CrawlLeanMax), 1f));
|
||||
if (crawl <= lean + 1e-3f)
|
||||
break;
|
||||
lean = crawl;
|
||||
}
|
||||
Lean = lean;
|
||||
|
||||
// Pelvis: hangs below the upper chest along the trunk; follows through a critically damped
|
||||
// spring so it lags quick head motion (hip sway) instead of being rigidly attached.
|
||||
|
||||
Reference in new issue
Block a user