fix(runtime): align portal and movement presentation
Port retail portal viewport projection and reveal behavior, preserve outbound combat style, drive remote and local grounded movement from authored CSequence root frames, and reuse the local prepared pose so animation hooks advance once. User-verified portal, observer movement, combat stance, and short-tap locomotion gates. Release build passed with 5,767 tests and five intentional skips. Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
e95f55f25b
commit
124e046976
30 changed files with 1362 additions and 348 deletions
|
|
@ -0,0 +1,51 @@
|
|||
using System.Buffers.Binary;
|
||||
using AcDream.App.Input;
|
||||
using AcDream.App.Rendering;
|
||||
using AcDream.Core.Net.Messages;
|
||||
using AcDream.Core.Net.Packets;
|
||||
using AcDream.Core.Physics;
|
||||
|
||||
namespace AcDream.App.Tests.Input;
|
||||
|
||||
public sealed class LocalPlayerOutboundCombatStyleTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(0x8000003Cu)] // HandCombat
|
||||
[InlineData(0x8000003Eu)] // Magic
|
||||
[InlineData(0x8000003Fu)] // BowCombat
|
||||
[InlineData(0x80000041u)] // CrossbowCombat
|
||||
public void CaptureAndBuild_PreservesCanonicalRawCombatStyle(uint combatStyle)
|
||||
{
|
||||
var controller = new PlayerMovementController(new PhysicsEngine());
|
||||
controller.Motion.RawState.CurrentStyle = combatStyle;
|
||||
|
||||
MovementResult movement = controller.CaptureMovementResult(
|
||||
mouseLookEvent: false);
|
||||
RawMotionState outbound = GameWindow.BuildOutboundRawMotionState(
|
||||
movement);
|
||||
|
||||
Assert.Equal(combatStyle, movement.CurrentStyle);
|
||||
Assert.Equal(combatStyle, outbound.CurrentStyle);
|
||||
|
||||
var writer = new PacketWriter(16);
|
||||
RawMotionStatePacker.Pack(writer, outbound);
|
||||
byte[] bytes = writer.ToArray();
|
||||
|
||||
uint flags = BinaryPrimitives.ReadUInt32LittleEndian(bytes);
|
||||
Assert.NotEqual(0u, flags & 0x2u);
|
||||
Assert.Equal(
|
||||
combatStyle,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(bytes.AsSpan(4)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CaptureAndBuild_NonCombatRetainsRetailDefault()
|
||||
{
|
||||
var controller = new PlayerMovementController(new PhysicsEngine());
|
||||
|
||||
RawMotionState outbound = GameWindow.BuildOutboundRawMotionState(
|
||||
controller.CaptureMovementResult(mouseLookEvent: false));
|
||||
|
||||
Assert.Equal(RawMotionState.Default.CurrentStyle, outbound.CurrentStyle);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue