refactor(runtime): extract the live object frame

This commit is contained in:
Erik 2026-07-22 00:42:26 +02:00
parent 99a3e819c4
commit 4e4aac2c5a
27 changed files with 1217 additions and 371 deletions

View file

@ -1,5 +1,6 @@
using System.Numerics;
using AcDream.App.Input;
using AcDream.App.Streaming;
using AcDream.App.World;
using AcDream.Core.Physics;
@ -33,22 +34,23 @@ public sealed class RetailLocalPlayerFrameControllerTests
postNetwork.Add(owner.State);
});
var live = new RetailLiveFrameCoordinator(
dt =>
new TestLiveObjectFramePhase(dt =>
{
calls.Add("objects");
local.AdvanceBeforeNetwork(dt);
},
() =>
}),
new GpuWorldState(),
new TestLiveSessionFramePhase(() =>
{
calls.Add("f751");
controller.State = PlayerState.PortalSpace;
},
() =>
}),
new TestPostNetworkCommandFramePhase(() =>
{
calls.Add("commands");
local.RunPostNetworkCommandPhase();
},
() => calls.Add("spatial"));
}),
new TestLiveSpatialReconcilePhase(() => calls.Add("spatial")));
// CPhysicsObj::update_object admits manager time only after the strict
// minimum quantum. Use one admitted object tick; the test's concern is
@ -118,10 +120,12 @@ public sealed class RetailLocalPlayerFrameControllerTests
sendPreNetwork: (_, _, _) => { },
sendPostNetwork: (_, _) => { });
var live = new RetailLiveFrameCoordinator(
local.AdvanceBeforeNetwork,
() => projectedRoot = new Vector3(999f, 999f, 999f),
local.RunPostNetworkCommandPhase,
() => { });
new TestLiveObjectFramePhase(local.AdvanceBeforeNetwork),
new GpuWorldState(),
new TestLiveSessionFramePhase(
() => projectedRoot = new Vector3(999f, 999f, 999f)),
local,
new TestLiveSpatialReconcilePhase(() => { }));
live.Tick(1f / 60f);
float timeAfterOneTick = controller.SimTimeSeconds;