Restore turning clips and attach jetpack fire to full player transform

This commit is contained in:
UnixNight committed 2026-11-05 15:25:50 -05:00
1 parent fafb54730a
commit f0be8504dd
14 files changed
+362 -9

No files matched your search

+4 -3
View File
@@ -24,8 +24,9 @@ public sealed class JetpackVisuals
{
draw.Visible = owner.JetpackEffectVisible;
if (!draw.Visible) return;
var model = Matrix4x4.CreateRotationY(-owner.Yaw * MathF.PI / 180)
* Matrix4x4.CreateTranslation(owner.ActorRoot);
clip.Sample(owner.Steps / 60d, destination.Vertices.AsSpan(offset, clip.Base.Vertices.Length), model);
//42204C..4220B6 copies the owner's full root/Euler. Share the owner's
//local visual correction too, keeping the original relative attachment
//when the port aligns Jimmy's upright soles with the floor.
clip.Sample(owner.Steps / 60d, destination.Vertices.AsSpan(offset, clip.Base.Vertices.Length), owner.Model);
}
}
@@ -47,14 +47,16 @@ public sealed class PreviewAnimationLibrary
if (ReferenceEquals(clip, Current)) Name = label;
}
foreach (var (pose, folder) in new[] { (PlayerPose.Idle, "jimstop"), (PlayerPose.Run, "jimrun"),
(PlayerPose.Backpedal, "jimbackpedal"), (PlayerPose.Jump, "jimjump"), (PlayerPose.Fall, "jimfall"), (PlayerPose.Fly, "jimfly"), (PlayerPose.Shoot, "jimshoot") })
(PlayerPose.Backpedal, "jimbackpedal"), (PlayerPose.Jump, "jimjump"), (PlayerPose.Fall, "jimfall"), (PlayerPose.Fly, "jimfly"), (PlayerPose.Shoot, "jimshoot"),
(PlayerPose.TurnLeft,"jimleft"),(PlayerPose.TurnRight,"jimright") })
{
var path = Path.Combine(parent, folder, "animation.json");
if (!File.Exists(path)) continue;
movement[pose] = Load(path);
}
foreach (var (action, folder) in new[] { ("STOP", "jimstop"), ("TALK", "jimtalk"), ("RUN", "jimrun"),
("JUMP", "jimjump"), ("FALL", "jimfall"), ("SCRATCH", "jimscratch"), ("FLY", "jimfly"), ("SHOOT", "jimshoot") })
("JUMP", "jimjump"), ("FALL", "jimfall"), ("SCRATCH", "jimscratch"), ("FLY", "jimfly"), ("SHOOT", "jimshoot"),
("LEFT","jimleft"),("RIGHT","jimright") })
{
var path = Path.Combine(parent, folder, "animation.json");
if (File.Exists(path)) actions[action] = Load(path);
+10 -2
View File
@@ -6,7 +6,7 @@ namespace GamePort.Game;
public readonly record struct PlayerInput(bool Forward, bool Backward, bool Left, bool Right, bool Jump,
bool Rise = false, bool Descend = false, bool StrafeLeft = false, bool StrafeRight = false, bool Fast = false, bool Fire = false,
bool RocketTurn = false, bool RocketRoll = false, bool RocketMouseRise = false,bool GrapplerEnter=false);
public enum PlayerPose { Idle, Run, Backpedal, Jump, Fall, Fly, Shoot, Swing }
public enum PlayerPose { Idle, Run, Backpedal, Jump, Fall, Fly, Shoot, Swing, TurnLeft, TurnRight }
/// <summary>
/// Walking, airborne steering and jetpack checkpoint. Recovered arithmetic is described in
@@ -35,6 +35,8 @@ public sealed class LabSimulation
private JetpackBurstState jumpState;
private bool forceFall;
private bool keyboardTurn, hasSupportPolygon;
private sbyte groundTurnDirection;
private bool primaryHeld;
private Vector3 noclipEntry;
private float noclipEntryYaw;
private int gadgetMode = -1;
@@ -127,7 +129,9 @@ public sealed class LabSimulation
: Grappler?.SwingPose==true ? PlayerPose.Swing
: GadgetMode == 0 ? bubblePose
: pendingImpulse.Y > 0 ? PlayerPose.Jump
: Grounded ? Shooting ? PlayerPose.Shoot : Speed < -1 ? PlayerPose.Backpedal : Speed > 1 ? PlayerPose.Run : PlayerPose.Idle
: Grounded ? Shooting ? PlayerPose.Shoot : Speed < -1 ? PlayerPose.Backpedal : Speed > 10 ? PlayerPose.Run
: Speed>=0&&!primaryHeld&&groundTurnDirection<0 ? PlayerPose.TurnLeft
: Speed>=0&&!primaryHeld&&groundTurnDirection>0 ? PlayerPose.TurnRight : PlayerPose.Idle
: jumpState.JumpState == 3 && jumpState.EffectRemaining > 0 ? PlayerPose.Fly
: !forceFall && Velocity.Y > 0 ? PlayerPose.Jump : PlayerPose.Fall;
public int Steps { get; private set; }
@@ -205,6 +209,7 @@ public sealed class LabSimulation
Speed = PublishedSpeed = TurnRate = extraAirAcceleration = shadowDistance = 0;
lateralContribution = 0; pendingImpulse = Vector3.Zero; movementMode = 0;
keyboardTurn=false;hasSupportPolygon=false;
groundTurnDirection=0;primaryHeld=false;
jumpState = default;
forceFall = JetpackEffectVisible = false;
Shooting = false;
@@ -426,6 +431,7 @@ public sealed class LabSimulation
if (gadgetMode==0) { GadgetMode=-1; DefaultGadgetRequested?.Invoke(); }
Shooting = false;
Velocity = pendingImpulse = Vector3.Zero;
groundTurnDirection=0;primaryHeld=false;
Speed = PublishedSpeed = TurnRate = extraAirAcceleration = lateralContribution = 0;
jumpState = default; movementMode = 0; forceFall = JetpackEffectVisible = false;
//Modern debug stop freezes the retained facing request as well as body
@@ -464,9 +470,11 @@ public sealed class LabSimulation
{
const float dt = FixedStepClock.Step;
lateralContribution = 0;
primaryHeld=input.Fire;
//438A60 dispatches by stored movement mode, not current support.
if (movementMode == 0)
{
groundTurnDirection=(sbyte)(input.Left?-1:input.Right?1:0); //complete82A: keyboard Left wins.
//The830 backward clock owner remains unresolved; ordinary state0
//does not invent a hold timer or admit its seeded auto-turn branch.
var ground=JimmyGroundMotion.Input(new(Speed,targetYaw),Yaw,input,MaximumSpeed,