diff --git a/tests/AcDream.Core.Tests/Physics/AnimationSequencerTests.cs b/tests/AcDream.Core.Tests/Physics/AnimationSequencerTests.cs index 55fc874..ac492dd 100644 --- a/tests/AcDream.Core.Tests/Physics/AnimationSequencerTests.cs +++ b/tests/AcDream.Core.Tests/Physics/AnimationSequencerTests.cs @@ -1174,6 +1174,37 @@ public sealed class AnimationSequencerTests Assert.Equal(1.5f, seq.CurrentSpeedMod, 3); } + [Fact] + public void CurrentOmega_ReflectsMotionDataOmega() + { + // A turn cycle with MotionData.Omega = (0, 0, 1) rad/sec (yaw) + // should surface as CurrentOmega = (0, 0, 1) after SetCycle. + // Scales with speedMod exactly like Velocity. + const uint Style = 0x003Du; + const uint Motion = 0x000Du; // TurnRight + const uint AnimId = 0x03000701u; + + var anim = Fixtures.MakeAnim(4, 1, Vector3.Zero, Quaternion.Identity); + var setup = Fixtures.MakeSetup(1); + var mt = new MotionTable(); + mt.DefaultStyle = (DRWMotionCommand)Style; + int cycleKey = (int)((Style << 16) | (Motion & 0xFFFFFFu)); + + var md = new MotionData { Flags = MotionDataFlags.HasOmega, Omega = new Vector3(0, 0, 1.0f) }; + QualifiedDataId qid = AnimId; + md.Anims.Add(new AnimData { AnimId = qid, LowFrame = 0, HighFrame = -1, Framerate = 10f }); + mt.Cycles[cycleKey] = md; + + var loader = new FakeLoader(); + loader.Register(AnimId, anim); + + var seq = new AnimationSequencer(setup, mt, loader); + seq.SetCycle(Style, Motion, speedMod: 2f); + + // Omega scales by speedMod — 1.0 × 2 = 2 rad/sec. + Assert.Equal(2.0f, seq.CurrentOmega.Z, 3); + } + [Fact] public void CurrentVelocity_PersistsThroughLinkTransition() {