Integrate source airborne tilt and logical-root rendering

This commit is contained in:
UnixNight committed 2026-11-05 10:19:12 -05:00
1 parent a61f1b0284
commit 27be8ed630
36 files changed
+1953 -62

No files matched your search

+13 -6
View File
@@ -358,7 +358,7 @@ internal static class Program
var cameraRay = level!.Code is "LV1B" or "VR01" or "VR02" or "VR04" or "VR05" or "VR07" or "VR08" or "LEV1"
? OriginalCameraRay.FromRouteScene(world, level.Code) : null;
debugCameraRay = cameraRay;
simulation = new LabSimulation(new SceneCollision(world), standingPose, originalStart.Position, originalStart.Rotation.Y,
simulation = new LabSimulation(new SceneCollision(world), standingPose, originalStart.Position, originalStart.Rotation,
cameraRay == null ? null : (look, eye) => cameraRay.Trace(look, eye),
cameraRay == null ? null : (start, end) => cameraRay.TraceGeometry(start, end),
level.Code is "VR01" or "VR02" or "VR04" or "VR07" or "VR08" ? OriginalStaticCollision.FromRouteScene(world,level.Code) : null, energy)
@@ -664,7 +664,7 @@ internal static class Program
baseballs?.Reset();
interactions!.Reset();
mechanisms!.Reset();
director.SyncActor(level!.Player!.Tag!, simulation!.ActorRoot, new Vector3(0, simulation.Yaw, 0));
director.SyncActor(level!.Player!.Tag!, simulation!.ActorRoot, simulation.Rotation);
if (returning && director.FindActor("C3DGODDARD") is { } companion)
director.SyncActor(companion.Tag, returnRoot, companion.Rotation); //423AE3..423B1E, no offset.
if (practiceReturnSmoke && returning)
@@ -684,7 +684,7 @@ internal static class Program
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, new(0, simulation.Yaw, 0));
director.SyncActor(level.Player!.Tag!, simulation.ActorRoot, simulation.Rotation);
director.Trigger("neutron1a");
}
if (practiceReturnSmoke && level.Code == "VR04")
@@ -726,7 +726,7 @@ internal static class Program
// Move the real player away from STRT so an accidental
// restart at the authored spawn cannot pass this check.
for (var tick = 0; tick < 45; tick++) simulation.Step(new(true, false, false, false, false));
director.SyncActor(level.Player!.Tag!, simulation.ActorRoot, new(0, simulation.Yaw, 0));
director.SyncActor(level.Player!.Tag!, simulation.ActorRoot, simulation.Rotation);
}
director.Touch(level!.Player!.Tag!, level.Entities.Single(e => e.Tag == "teleportexplanation").Position);
director.Skip();
@@ -862,7 +862,7 @@ internal static class Program
director!.EnsureCompanion(ray.TraceGeometry(simulation.ActorRoot,behind)==null?behind:originalStart!.Position,Vector3.Zero);
}
interactions?.Reset(); mechanisms?.Reset(); gadgets?.Reset(); baseballs?.Reset(); mouseFire = false;
director?.SyncActor(level!.Player!.Tag!, simulation.ActorRoot, new Vector3(0, simulation.Yaw, 0));
director?.SyncActor(level!.Player!.Tag!, simulation.ActorRoot, simulation.Rotation);
}
void ToggleCamera()
{
@@ -1026,7 +1026,7 @@ internal static class Program
if (simulation == null) return;
characterModel = simulation.Model;
if (level?.Player?.Tag is { } tag)
director?.SyncActor(tag, simulation.ActorRoot, new Vector3(0, simulation.Yaw, 0));
director?.SyncActor(tag, simulation.ActorRoot, simulation.Rotation);
}
Vector2 Pointer()
{
@@ -1436,6 +1436,13 @@ internal static class Program
}
renderer.UpdateVertices(mesh.Vertices);
renderer.Render(view * projection);
if(simulation!=null&&((jetpackSmoke&&count is 74 or 109)||(walkSmoke&&count==89)))
{
var stage=jetpackSmoke?(count==74?"air-forward":"air-brake"):"air";
Console.WriteLine($"Movement {stage}: step={simulation.Steps}, Euler={simulation.Rotation}, target={simulation.FacingTarget}, speed={simulation.Speed:F3}, velocity={simulation.Velocity}.");
if(Option(args,"--screenshot") is{} capture)
renderer.SavePpm(Path.ChangeExtension(capture,$".{stage}.ppm"));
}
if(scooterFixture!=null)
{
scooterFixture.AfterFrame(count);