refactor(runtime): close simulation ownership
Move remote-motion construction, CreateObject vector initialization, final simulation-component retirement, and the combined J5 ownership ledger into Runtime. Delete App compatibility views and moved-state reconstruction while preserving the existing graphical projection and retail update order.
This commit is contained in:
parent
c30a3efeb0
commit
cdee7a4b49
57 changed files with 1013 additions and 410 deletions
|
|
@ -246,7 +246,6 @@ internal sealed class ProjectileController
|
|||
{
|
||||
var created = new PhysicsBody
|
||||
{
|
||||
State = record.FinalPhysicsState,
|
||||
Friction = NormalizeFriction(
|
||||
physics.Friction ?? record.Snapshot.Friction),
|
||||
Elasticity = NormalizeElasticity(
|
||||
|
|
@ -254,8 +253,6 @@ internal sealed class ProjectileController
|
|||
Orientation = entity.Rotation,
|
||||
LastUpdateTime = currentTime,
|
||||
};
|
||||
SetVelocity(created, velocity, currentTime);
|
||||
created.Omega = omega;
|
||||
created.SnapToCell(
|
||||
wirePosition.LandblockId,
|
||||
entity.Position,
|
||||
|
|
@ -919,22 +916,6 @@ internal sealed class ProjectileController
|
|||
private static void Deactivate(PhysicsBody body) =>
|
||||
body.TransientState &= ~TransientStateFlags.Active;
|
||||
|
||||
private static void SetVelocity(
|
||||
PhysicsBody body,
|
||||
Vector3 velocity,
|
||||
double currentTime)
|
||||
{
|
||||
bool wasActive = (body.TransientState & TransientStateFlags.Active) != 0;
|
||||
body.set_velocity(velocity);
|
||||
if ((body.State & PhysicsStateFlags.Static) != 0)
|
||||
{
|
||||
Deactivate(body);
|
||||
return;
|
||||
}
|
||||
if (!wasActive && (body.State & PhysicsStateFlags.Static) == 0)
|
||||
body.LastUpdateTime = currentTime;
|
||||
}
|
||||
|
||||
private static float NormalizeFriction(float? value) =>
|
||||
value is >= 0f and <= 1f && float.IsFinite(value.Value)
|
||||
? value.Value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue