From 21ed762d35eae34f2cc4bab5d49d7560c8bb1a60 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 20 Nov 2026 15:32:09 +0100 Subject: [PATCH] Smoke: the camera keeps a transform written between frames; CameraChecks: the pole is crossed in small steps Pins that the camera writes on input only (a per-frame placement mutant survived without it) and that no clamp stops the orbit near the pole (a clamp mutant survived a single large motion). Co-Authored-By: Claude Sonnet 5.5 --- client/tests/CameraChecks.cs | 6 ++++-- client/tests/Smoke.cs | 8 ++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/client/tests/CameraChecks.cs b/client/tests/CameraChecks.cs index 0dc9b3b..639ebfb 100644 --- a/client/tests/CameraChecks.cs +++ b/client/tests/CameraChecks.cs @@ -78,8 +78,10 @@ public static class CameraChecks Check(Near(camera.Transform, orbited, 1e-5f), $"Alt+left-drag gave {camera.Transform}, not the middle-drag's {orbited}"); Back(); - // Over the top: a drag down of 400 px pitches 160 degrees, past the pole, and the view turns upside down rather than stopping. - Drag(MouseButton.Middle, new Vector2(0, 400)); + // Over the top: a drag down of 400 px in 40 motions pitches 160 degrees, past the pole, and the view turns upside down rather than stopping. + Button(MouseButton.Middle, true); + for (int i = 0; i < 40; i++) Motion(new Vector2(0, 10), MouseButtonMask.Middle); // many small steps: a clamp near the pole would stop here + Button(MouseButton.Middle, false); Check(camera.Basis.Y.Dot(Vector3.Up) < 0, "an orbit of 160 degrees over the top did not carry the view over"); // Upside down, a drag to the right still turns the scene with the cursor: the yaw reverses (Blender's turntable does). var flipped = camera.Transform; diff --git a/client/tests/Smoke.cs b/client/tests/Smoke.cs index 96aed29..6be0f3a 100644 --- a/client/tests/Smoke.cs +++ b/client/tests/Smoke.cs @@ -77,6 +77,14 @@ public partial class Smoke : Node for (ulong seed = 1; seed <= 3; seed++) { PressReset(seed); await Frame(); } Check(_main.Bodies.PuppetMeshBuilds == 1, $"the puppet mesh was built {_main.Bodies.PuppetMeshBuilds} times by the third Reset; the signature never changed, so once"); CameraChecks.Run(failure => Check(false, "camera: " + failure), _main); + // The camera writes its transform on input only: one written between frames stays through them. + var orbit = _main.GetNode("Camera"); + var home = orbit.Transform; + var moved = new Transform3D(home.Basis.Rotated(Vector3.Up, 1f), home.Origin + new Vector3(0.1f, 0, 0)); + orbit.Transform = moved; + for (int i = 0; i < 3; i++) await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame); + Check(orbit.Transform == moved, $"the camera moved itself from {moved.Origin} to {orbit.Transform.Origin} between frames"); + orbit.Transform = home; if (_failures.Count > 0) return; // Seed 1 at the default intensity against the headless run: events, and the hand at ticks 240 and 1500.