feat(mosstank): add VTank-style automation PoC
This commit is contained in:
parent
f6fe0f2a4f
commit
4e6e9bc9d9
212 changed files with 49462 additions and 416 deletions
|
|
@ -54,6 +54,40 @@ public sealed class RuntimeLocalPlayerMovementStateTests
|
|||
Assert.Equal(movement.Revision, snapshot.Revision);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ViewProjectsLiveBodyOrientationAfterLocalTurn()
|
||||
{
|
||||
var controller = new PlayerMovementController(new PhysicsEngine())
|
||||
{
|
||||
LocalEntityId = 0x50000001u,
|
||||
};
|
||||
controller.SeedPlacementForTest(
|
||||
new Vector3(11f, 12f, 13f),
|
||||
0xA9B40001u,
|
||||
new Vector3(11f, 12f, 13f));
|
||||
using var movement = new RuntimeLocalPlayerMovementState
|
||||
{
|
||||
Controller = controller,
|
||||
};
|
||||
Quaternion turned = AcDream.Core.Physics.Motion.MoveToMath.SetHeading(
|
||||
Quaternion.Identity,
|
||||
90f);
|
||||
|
||||
controller.SetBodyOrientation(turned);
|
||||
|
||||
// PhysicsBody.CellPosition deliberately retains the carried frame
|
||||
// rotation. RuntimeMovementSnapshot is the live consumer projection
|
||||
// used by plugins and must expose the body's current facing instead.
|
||||
Assert.NotEqual(turned, controller.CellPosition.Frame.Orientation);
|
||||
RuntimeMovementSnapshot snapshot = movement.View.Snapshot;
|
||||
Assert.Equal(turned, snapshot.Position.Frame.Orientation);
|
||||
Assert.Equal(
|
||||
90f,
|
||||
AcDream.Core.Physics.Motion.MoveToMath.GetHeading(
|
||||
snapshot.Position.Frame.Orientation),
|
||||
precision: 4);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GraphicalAndDirectCommandsMutateOneAutorunLatch()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue