diag(phys): [cyl-test] probe — log every Cylinder shadow collision test

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) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-05-24 18:14:29 +02:00
parent 3e5dc8ce4c
commit 1498697bc5

View file

@ -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.