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
+23
-3
@@ -38,6 +38,21 @@ public partial class PlayerRig : Node
|
||||
private bool _rebuild = true;
|
||||
|
||||
public PlayerRagdoll Ragdoll => _ragdoll;
|
||||
public static bool Spectator { get; private set; }
|
||||
|
||||
// Spectator = no body (fly with the old grab-drag movement); leaving it rebuilds the body at
|
||||
// the current pose.
|
||||
public static void SetSpectator(bool on)
|
||||
{
|
||||
Spectator = on;
|
||||
AnchorMoveMode.Enabled = on;
|
||||
if (_instance == null)
|
||||
return;
|
||||
if (on)
|
||||
_instance._ragdoll.Clear();
|
||||
_instance._rebuild = true;
|
||||
GD.Print($"PlayerRig: spectator {(on ? "on" : "off")}");
|
||||
}
|
||||
|
||||
public static RigidBody3D GetHandBody(XRController3D controller)
|
||||
{
|
||||
@@ -46,7 +61,7 @@ public partial class PlayerRig : Node
|
||||
return _instance._ragdoll.Hand(controller == _instance._left ? 0 : 1);
|
||||
}
|
||||
|
||||
public static void SetHeld(XRController3D controller, RigidBody3D prop)
|
||||
public static void SetHeld(XRController3D controller, PhysicsBody3D prop)
|
||||
{
|
||||
if (_instance != null)
|
||||
_instance._ragdoll.SetHeld(controller == _instance._left ? 0 : 1, prop);
|
||||
@@ -65,7 +80,9 @@ public partial class PlayerRig : Node
|
||||
_trueBody.ExternallySolved = true;
|
||||
TrueBody.ShowDebug = false;
|
||||
}
|
||||
_ragdoll = new PlayerRagdoll { Name = "Ragdoll" };
|
||||
// PlayerRig itself is excluded from physics interpolation (ghosts follow controllers per
|
||||
// frame); the body is simulated, so it interpolates.
|
||||
_ragdoll = new PlayerRagdoll { Name = "Ragdoll", PhysicsInterpolationMode = PhysicsInterpolationModeEnum.On };
|
||||
AddChild(_ragdoll);
|
||||
BodyProfile.Changed += _ => _rebuild = true;
|
||||
for (int i = 0; i < 2; i++)
|
||||
@@ -93,8 +110,11 @@ public partial class PlayerRig : Node
|
||||
{
|
||||
float dt = (float)delta;
|
||||
BodyProfile profile = BodyProfile.Current;
|
||||
if (profile == null)
|
||||
if (profile == null || Spectator)
|
||||
{
|
||||
_haveLastOrigin = false;
|
||||
return;
|
||||
}
|
||||
|
||||
// 1. Someone else moved the play space discretely: bring the body along.
|
||||
Transform3D origin = _origin.GlobalTransform;
|
||||
|
||||
Reference in new issue
Block a user