diff --git a/src/AcDream.Core/Physics/PhysicsDataCache.cs b/src/AcDream.Core/Physics/PhysicsDataCache.cs index 9bcda0b..ae40c63 100644 --- a/src/AcDream.Core/Physics/PhysicsDataCache.cs +++ b/src/AcDream.Core/Physics/PhysicsDataCache.cs @@ -215,8 +215,29 @@ public sealed class PhysicsDataCache var worldOrigin = Vector3.Transform(Vector3.Zero, worldTransform); + // A6.P3 slice 4 (2026-05-22): also dump portal targets so we + // can see which cells the player should be able to transition + // to (issue #98 investigation: cellar-up stuck at top of ramp). + string portalTargets; + if (portals.Count == 0) + { + portalTargets = "portalTargets=[]"; + } + else + { + var sb = new System.Text.StringBuilder("portalTargets=["); + for (int i = 0; i < portals.Count; i++) + { + if (i > 0) sb.Append(','); + sb.Append(System.FormattableString.Invariant( + $"(cell=0x{portals[i].OtherCellId:X4},poly=0x{portals[i].PolygonId:X4},flags=0x{portals[i].Flags:X4})")); + } + sb.Append(']'); + portalTargets = sb.ToString(); + } + Console.WriteLine(System.FormattableString.Invariant( - $"[cell-cache] envCellId=0x{envCellId:X8} physicsPolyCount={cellStruct.PhysicsPolygons?.Count ?? 0} resolvedCount={resolved.Count} bspTotalLeafPolys={bspTotalLeafPolys} bspUnmatchedIds={bspUnmatchedIds} {bsStr} portalCount={portals.Count} visibleCells={visibleCellIds.Count} cellBspRoot={(cellStruct.CellBSP?.Root is null ? "null" : "ok")} worldOrigin=({worldOrigin.X:F2},{worldOrigin.Y:F2},{worldOrigin.Z:F2})")); + $"[cell-cache] envCellId=0x{envCellId:X8} physicsPolyCount={cellStruct.PhysicsPolygons?.Count ?? 0} resolvedCount={resolved.Count} bspTotalLeafPolys={bspTotalLeafPolys} bspUnmatchedIds={bspUnmatchedIds} {bsStr} portalCount={portals.Count} visibleCells={visibleCellIds.Count} cellBspRoot={(cellStruct.CellBSP?.Root is null ? "null" : "ok")} worldOrigin=({worldOrigin.X:F2},{worldOrigin.Y:F2},{worldOrigin.Z:F2}) {portalTargets}")); } if (PhysicsDiagnostics.ProbeWalkMissEnabled)