using System.Numerics; using AcDream.Core.Physics; using Xunit; namespace AcDream.Core.Tests.Physics; /// /// Render Residual A — surfaces the /// FindTransitionalPosition return (retail find_valid_position != 0, /// pc:273898) so the camera SweepEye can trigger SmartBox::update_viewer's /// fallbacks when the sweep fails. Default true keeps every existing caller /// (which never reads it) unaffected. /// public class ResolveResultOkTests { [Fact] public void NoStartCell_ReportsNotOk() { var engine = new PhysicsEngine(); // cellId == 0 → FindTransitionalPosition returns false at its first guard // (TransitionTypes.cs:665) → the sweep did not find a valid position. var r = engine.ResolveWithTransition( currentPos: Vector3.Zero, targetPos: new Vector3(1f, 0f, 0f), cellId: 0u, sphereRadius: 0.3f, sphereHeight: 0f, stepUpHeight: 0f, stepDownHeight: 0f, isOnGround: false); Assert.False(r.Ok); } [Fact] public void ZeroMovementValidCell_ReportsOk() { var engine = new PhysicsEngine(); // Zero offset with a non-zero start cell → FindTransitionalPosition's // zero-step path returns true (TransitionTypes.cs:718-723), no geometry needed. var r = engine.ResolveWithTransition( currentPos: new Vector3(5f, 5f, 5f), targetPos: new Vector3(5f, 5f, 5f), cellId: 0xA9B40001u, sphereRadius: 0.3f, sphereHeight: 0f, stepUpHeight: 0f, stepDownHeight: 0f, isOnGround: false); Assert.True(r.Ok); } }