From 1498697bc59152cfb93c251db99623a6c78e331f Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 24 May 2026 18:14:29 +0200 Subject: [PATCH] =?UTF-8?q?diag(phys):=20[cyl-test]=20probe=20=E2=80=94=20?= =?UTF-8?q?log=20every=20Cylinder=20shadow=20collision=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a one-line diagnostic per Cylinder ShadowEntry tested in FindObjCollisions, gated on ProbeBuildingEnabled. Useful for the door-collision investigation surfaced 2026-05-24: tells us whether the broadphase returned a candidate door AND what CylinderCollision decided (OK / Collided / Adjusted / Slid). Off in normal play (probe flag off by default). General-purpose; not door-specific. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/AcDream.Core/Physics/TransitionTypes.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/AcDream.Core/Physics/TransitionTypes.cs b/src/AcDream.Core/Physics/TransitionTypes.cs index 9749fdf..297edbf 100644 --- a/src/AcDream.Core/Physics/TransitionTypes.cs +++ b/src/AcDream.Core/Physics/TransitionTypes.cs @@ -2308,6 +2308,19 @@ public sealed class Transition // the same 6-path dispatcher. For now we keep the swept-sphere // cylinder test which matches the retail CylSphere behavior. result = CylinderCollision(obj, sp); + + // A6.P4 door investigation (2026-05-24): log every Cylinder + // shadow tested. Tells us whether the broadphase returned + // the door AND what CylinderCollision decided. Greppable + // alongside [entity-source] (which logs the door's radius + // / height at registration). Gated on ProbeBuildingEnabled. + if (PhysicsDiagnostics.ProbeBuildingEnabled) + { + Vector3 dxy = obj.Position - sp.GlobalCurrCenter[0].Origin; + float distXY = MathF.Sqrt(dxy.X * dxy.X + dxy.Y * dxy.Y); + Console.WriteLine(System.FormattableString.Invariant( + $"[cyl-test] obj=0x{obj.EntityId:X8} state=0x{obj.State:X8} radius={obj.Radius:F3} height={obj.CylHeight:F3} pos=({obj.Position.X:F2},{obj.Position.Y:F2},{obj.Position.Z:F2}) distXY={distXY:F3} result={result}")); + } } // L.2a slice 3: attribute the collision (if any) to this entity.