refactor(physics #145): Slice 1 — rename Frame->CellFrame to avoid DatReaderWriter.Types.Frame collision
The new value type collided with DatReaderWriter.Types.Frame (used in physics-adjacent code like ShadowShapeBuilder), which the structural fix (per-file using-aliases across 6 files) would have re-incurred in every later physics slice. Renamed the TYPE to CellFrame; the Position.Frame MEMBER keeps retail's name. Restored the 5 alias-only files to their pre-Slice-1 state; synced spec + plan. Core 1522 passed / 0 failed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
438bb681a5
commit
c980763322
8 changed files with 51 additions and 47 deletions
|
|
@ -10,7 +10,6 @@ using Xunit;
|
|||
// Alias the DatReaderWriter enum so it doesn't clash with
|
||||
// AcDream.Core.Physics.MotionCommand (which is a static class of uint constants).
|
||||
using DRWMotionCommand = DatReaderWriter.Enums.MotionCommand;
|
||||
using DatFrame = DatReaderWriter.Types.Frame;
|
||||
|
||||
namespace AcDream.Core.Tests.Physics;
|
||||
|
||||
|
|
@ -66,7 +65,7 @@ file static class Fixtures
|
|||
{
|
||||
var pf = new AnimationFrame((uint)numParts);
|
||||
for (int p = 0; p < numParts; p++)
|
||||
pf.Frames.Add(new DatFrame { Origin = origin, Orientation = orientation });
|
||||
pf.Frames.Add(new Frame { Origin = origin, Orientation = orientation });
|
||||
anim.PartFrames.Add(pf);
|
||||
}
|
||||
return anim;
|
||||
|
|
@ -87,8 +86,8 @@ file static class Fixtures
|
|||
var pf1 = new AnimationFrame((uint)numParts);
|
||||
for (int p = 0; p < numParts; p++)
|
||||
{
|
||||
pf0.Frames.Add(new DatFrame { Origin = fromOrigin, Orientation = fromRot });
|
||||
pf1.Frames.Add(new DatFrame { Origin = toOrigin, Orientation = toRot });
|
||||
pf0.Frames.Add(new Frame { Origin = fromOrigin, Orientation = fromRot });
|
||||
pf1.Frames.Add(new Frame { Origin = toOrigin, Orientation = toRot });
|
||||
}
|
||||
anim.PartFrames.Add(pf0);
|
||||
anim.PartFrames.Add(pf1);
|
||||
|
|
@ -397,7 +396,7 @@ public sealed class AnimationSequencerTests
|
|||
{
|
||||
var pf = new AnimationFrame(1);
|
||||
float y = 10f - 5f * f; // 10, 5, 0
|
||||
pf.Frames.Add(new DatFrame { Origin = new Vector3(0, y, 0), Orientation = Quaternion.Identity });
|
||||
pf.Frames.Add(new Frame { Origin = new Vector3(0, y, 0), Orientation = Quaternion.Identity });
|
||||
linkAnim.PartFrames.Add(pf);
|
||||
}
|
||||
|
||||
|
|
@ -594,7 +593,7 @@ public sealed class AnimationSequencerTests
|
|||
for (int f = 0; f < 4; f++)
|
||||
{
|
||||
var pf = new AnimationFrame(1);
|
||||
pf.Frames.Add(new DatFrame { Origin = new Vector3(0, 0, f), Orientation = Quaternion.Identity });
|
||||
pf.Frames.Add(new Frame { Origin = new Vector3(0, 0, f), Orientation = Quaternion.Identity });
|
||||
anim.PartFrames.Add(pf);
|
||||
}
|
||||
|
||||
|
|
@ -1007,7 +1006,7 @@ public sealed class AnimationSequencerTests
|
|||
anim.Flags = AnimationFlags.PosFrames;
|
||||
for (int f = 0; f < 4; f++)
|
||||
{
|
||||
anim.PosFrames.Add(new DatFrame
|
||||
anim.PosFrames.Add(new Frame
|
||||
{
|
||||
Origin = new Vector3(1f, 0f, 0f),
|
||||
Orientation = Quaternion.Identity,
|
||||
|
|
@ -1154,7 +1153,7 @@ public sealed class AnimationSequencerTests
|
|||
for (int f = 0; f < 10; f++)
|
||||
{
|
||||
var pf = new AnimationFrame(1);
|
||||
pf.Frames.Add(new DatFrame { Origin = new Vector3(0, 0, f), Orientation = Quaternion.Identity });
|
||||
pf.Frames.Add(new Frame { Origin = new Vector3(0, 0, f), Orientation = Quaternion.Identity });
|
||||
anim.PartFrames.Add(pf);
|
||||
}
|
||||
|
||||
|
|
@ -1205,7 +1204,7 @@ public sealed class AnimationSequencerTests
|
|||
for (int f = 0; f < 10; f++)
|
||||
{
|
||||
var pf = new AnimationFrame(1);
|
||||
pf.Frames.Add(new DatFrame { Origin = new Vector3(0, 0, f), Orientation = Quaternion.Identity });
|
||||
pf.Frames.Add(new Frame { Origin = new Vector3(0, 0, f), Orientation = Quaternion.Identity });
|
||||
anim.PartFrames.Add(pf);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ using DatReaderWriter.DBObjs;
|
|||
using DatReaderWriter.Enums;
|
||||
using DatReaderWriter.Types;
|
||||
using Xunit;
|
||||
using DatFrame = DatReaderWriter.Types.Frame;
|
||||
|
||||
namespace AcDream.Core.Tests.Physics;
|
||||
|
||||
|
|
@ -38,9 +37,9 @@ public class ShadowShapeBuilderTests
|
|||
{
|
||||
Frames =
|
||||
{
|
||||
new DatFrame { Origin = Vector3.Zero, Orientation = Quaternion.Identity },
|
||||
new DatFrame { Origin = Vector3.Zero, Orientation = Quaternion.Identity },
|
||||
new DatFrame { Origin = Vector3.Zero, Orientation = Quaternion.Identity }
|
||||
new Frame { Origin = Vector3.Zero, Orientation = Quaternion.Identity },
|
||||
new Frame { Origin = Vector3.Zero, Orientation = Quaternion.Identity },
|
||||
new Frame { Origin = Vector3.Zero, Orientation = Quaternion.Identity }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ using AcDream.Core.World;
|
|||
using DatReaderWriter.Types;
|
||||
using Xunit;
|
||||
using DatPhysicsScript = DatReaderWriter.DBObjs.PhysicsScript;
|
||||
using DatFrame = DatReaderWriter.Types.Frame;
|
||||
|
||||
namespace AcDream.Core.Tests.Rendering.Vfx;
|
||||
|
||||
|
|
@ -141,7 +140,7 @@ public sealed class EntityScriptActivatorTests
|
|||
var hookSink = new ParticleHookSink(system);
|
||||
|
||||
// Hook offset = (1, 0, 0) in entity-local frame.
|
||||
var hookOffset = new DatFrame
|
||||
var hookOffset = new Frame
|
||||
{
|
||||
Origin = new Vector3(1f, 0f, 0f),
|
||||
Orientation = Quaternion.Identity,
|
||||
|
|
@ -195,7 +194,7 @@ public sealed class EntityScriptActivatorTests
|
|||
var system = new ParticleSystem(registry);
|
||||
var hookSink = new ParticleHookSink(system);
|
||||
|
||||
var script = BuildScript((0.0, new CreateParticleHook { EmitterInfoId = 100u, Offset = new DatFrame() }));
|
||||
var script = BuildScript((0.0, new CreateParticleHook { EmitterInfoId = 100u, Offset = new Frame() }));
|
||||
var table = new Dictionary<uint, DatPhysicsScript> { [0xAAu] = script };
|
||||
var runner = new PhysicsScriptRunner(
|
||||
id => table.TryGetValue(id, out var s) ? s : null,
|
||||
|
|
@ -258,7 +257,7 @@ public sealed class EntityScriptActivatorTests
|
|||
var system = new ParticleSystem(registry);
|
||||
var hookSink = new ParticleHookSink(system);
|
||||
|
||||
var hookOffset = new DatFrame { Origin = new Vector3(1f, 0, 0), Orientation = Quaternion.Identity };
|
||||
var hookOffset = new Frame { Origin = new Vector3(1f, 0, 0), Orientation = Quaternion.Identity };
|
||||
var script = BuildScript(
|
||||
(0.0, new CreateParticleHook { EmitterInfoId = 100u, Offset = hookOffset, PartIndex = 1 }));
|
||||
var table = new Dictionary<uint, DatPhysicsScript> { [0xAAu] = script };
|
||||
|
|
@ -298,7 +297,7 @@ public sealed class EntityScriptActivatorTests
|
|||
var system = new ParticleSystem(registry);
|
||||
var hookSink = new ParticleHookSink(system);
|
||||
|
||||
var script = BuildScript((0.0, new CreateParticleHook { EmitterInfoId = 100u, Offset = new DatFrame() }));
|
||||
var script = BuildScript((0.0, new CreateParticleHook { EmitterInfoId = 100u, Offset = new Frame() }));
|
||||
var table = new Dictionary<uint, DatPhysicsScript> { [0xAAu] = script };
|
||||
var runner = new PhysicsScriptRunner(
|
||||
id => table.TryGetValue(id, out var s) ? s : null,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ using DatReaderWriter.DBObjs;
|
|||
using DatReaderWriter.Types;
|
||||
using Xunit;
|
||||
using DatPhysicsScript = DatReaderWriter.DBObjs.PhysicsScript;
|
||||
using DatFrame = DatReaderWriter.Types.Frame;
|
||||
|
||||
namespace AcDream.Core.Tests.Streaming;
|
||||
|
||||
|
|
@ -44,7 +43,7 @@ public sealed class GpuWorldStateActivatorTests
|
|||
script.ScriptData.Add(new PhysicsScriptData
|
||||
{
|
||||
StartTime = 0.0,
|
||||
Hook = new CreateParticleHook { EmitterInfoId = 100u, Offset = new DatFrame() },
|
||||
Hook = new CreateParticleHook { EmitterInfoId = 100u, Offset = new Frame() },
|
||||
});
|
||||
var table = new Dictionary<uint, DatPhysicsScript> { [scriptId] = script };
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue