using System.Numerics; using AcDream.App.Rendering; using Xunit; namespace AcDream.App.Tests.Rendering; public class DollCameraTests { [Fact] public void Eye_position_frames_the_doll_from_the_front() { var cam = new DollCamera { Aspect = 100f / 214f }; Assert.True(Matrix4x4.Invert(cam.View, out var inv)); var eye = inv.Translation; // Tuned at the visual gate: aim at mid-body (z≈0.95) and stand back ~3.7 m so the whole // figure fits (model origin is at the feet, so aiming at the origin framed only the legs). Assert.Equal(0.12f, eye.X, 3); Assert.Equal(-3.7f, eye.Y, 3); Assert.Equal(0.95f, eye.Z, 3); } [Fact] public void Projection_is_finite_and_uses_aspect() { var cam = new DollCamera { Aspect = 1.5f }; Assert.True(float.IsFinite(cam.Projection.M11)); Assert.NotEqual(0f, cam.Projection.M34); // perspective w = -z term } }