Reset cutscene facing destination with original camera rotation handoff

This commit is contained in:
UnixNight committed 2026-11-05 15:44:25 -05:00
1 parent 7818cc8d64
commit dae13ace73
24 files changed
+2864 -9

No files matched your search

+25 -3
View File
@@ -681,11 +681,22 @@ internal static class Program
if (gadgetWindowSmoke) { interactions!.Inventory.SetState(0,3,1); interactions.Inventory.SelectGadget(3); }
if (controlPhaseSmoke)
{
//Enter with real airborne steering/destination state, rather
//than an upright fixture that cannot detect stale jump tilt.
for (var tick = 0; tick < 8; tick++)
playerBinding!.Step(new(true, false, true, false, true));
if (simulation.Grounded || !simulation.FacingDirty || simulation.FacingTarget.X >= 0 || simulation.FacingTarget.Z >= 0)
throw new InvalidOperationException("Control-phase fixture did not establish a banked jump");
var enteredRotation = simulation.Rotation;
interactions.Inventory.SetState(0, 3, 1); interactions.Inventory.SelectGadget(3);
simulation.ApplyRetainedLevelState(new("LV1B", 3, 1, .625f, 6.125f));
simulation.RestoreReturnRoot(simulation.ActorRoot + Vector3.UnitY * 200);
director.SyncActor(level.Player!.Tag!, simulation.ActorRoot, simulation.Rotation);
director.Trigger("neutron1a");
var preparedRotation = new Vector3(0, enteredRotation.Y, 0);
if (simulation.Rotation != preparedRotation || simulation.FacingTarget != preparedRotation || !simulation.FacingDirty)
throw new InvalidOperationException("MCA did not copy upright current/destination Euler while retaining dirty");
Console.WriteLine($"Control-phase banked entry: Euler={enteredRotation}, prepared={simulation.Rotation}, destination={simulation.FacingTarget}, dirty={simulation.FacingDirty}.");
}
if (practiceReturnSmoke && level.Code == "VR04")
{
@@ -844,6 +855,12 @@ internal static class Program
var toolsPaused = false; var toolsMoved = false; var toolsStopped = false; var toolsSaved = false; var toolsSystems = false;
var toolsEntry = simulation?.ActorRoot ?? Vector3.Zero;
var controlEntry = simulation?.ActorRoot ?? Vector3.Zero;
var controlRotation = simulation?.Rotation ?? Vector3.Zero;
var controlControllers = simulation?.ControllerSteps ?? 0;
var controlPhysics = simulation?.PhysicsSteps ?? 0;
var controlEffects = simulation?.EffectSteps ?? 0;
var controlJumps = simulation?.Jumps ?? 0;
var controlTurn = simulation?.TurnRate ?? 0;
var phasesLocked = false; var phasesResumed = false;
var gadgetChecks = new bool[7];
var gadgetEntry = simulation?.ActorRoot ?? Vector3.Zero;
@@ -1483,16 +1500,21 @@ internal static class Program
diagnostics.ObserveFrame(presentedAt - lastPresentedAt);
lastPresentedAt = presentedAt;
count++;
if (controlPhaseSmoke && (count == 1 || count == 15) && Option(args, "--screenshot") is { } phaseCapture)
renderer.SavePpm(Path.ChangeExtension(phaseCapture, count == 1 ? ".locked-start.ppm" : ".locked-fall.ppm"));
if (controlPhaseSmoke && count == 15)
{
phasesLocked = director is { Controlled: false, Playing: true }
&& simulation is { ControllerSteps: 0, PhysicsSteps: 15, EffectSteps: 15, Jumps: 0, Speed: 0, TurnRate: 0 }
&& simulation!.ControllerSteps == controlControllers && simulation.PhysicsSteps == controlPhysics + 15
&& simulation.EffectSteps == controlEffects + 15 && simulation.Jumps == controlJumps
&& simulation.Speed == 0 && simulation.TurnRate == controlTurn
&& simulation.Rotation == controlRotation && simulation.FacingTarget == controlRotation && !simulation.FacingDirty
&& simulation.ActorRoot.Y < controlEntry.Y && simulation.JetpackRemaining is > 0 and < 6.125f
&& simulation.Energy < 20 && Vector2.Distance(new(simulation.ActorRoot.X, simulation.ActorRoot.Z), new(controlEntry.X, controlEntry.Z)) < .001f;
director!.Skip();
}
if (controlPhaseSmoke && count == 30)
phasesResumed = director!.Controlled && simulation!.ControllerSteps == 15 && simulation.Travel > 1;
phasesResumed = director!.Controlled && simulation!.ControllerSteps == controlControllers + 15 && simulation.Travel > 1;
audio?.Pump();
sceneAudio?.Pump();
if (toolsSmoke)
@@ -1723,7 +1745,7 @@ internal static class Program
}
if (controlPhaseSmoke)
{
Console.WriteLine($"Control-phase fixture: locked input with body/fire/energy continuing={phasesLocked}; held-input resumption={phasesResumed}.");
Console.WriteLine($"Control-phase fixture: upright current/destination with locked input and body/fire/energy continuing={phasesLocked}; held-input resumption={phasesResumed}.");
if (!phasesLocked || !phasesResumed) return 2;
}
if (objectiveSmoke) Console.WriteLine($"Objective panel: time={objectivePanel!.Elapsed:F3}, pad={objectivePanel.PadVisible}, content={objectivePanel.ContentVisible}, offset={objectivePanel.YOffset:F3}.");