checkpoint(render): preserve pre-overhaul investigation state

This commit is contained in:
Erik 2026-09-01 18:04:24 +02:00
parent e880860291
commit b3b7d922f1
45 changed files with 3168 additions and 619 deletions

View file

@ -1002,11 +1002,6 @@ public static class CellTransit
/// docs/research/2026-08-07-ap159-pseudocode.md for the derivation.
/// </para>
/// </summary>
/// <param name="worldParts">Per-part world-placed authored boxes — the
/// outdoor extent walk's input.</param>
/// <param name="worldPartSpheres">Per-part world-placed BSP root spheres —
/// the indoor residual's and the building bridge's input. Same parts, same
/// order, from the same <see cref="ShadowPartGeometry"/> values.</param>
public static IReadOnlyList<uint> BuildShadowCellSetFromParts(
PhysicsDataCache cache,
uint seedCellId,
@ -1107,27 +1102,17 @@ public static class CellTransit
}
}
// Static prune (do_not_load_cells, 0x0052b66e) — indoor-seeded ONLY.
// The outdoor rectangle is deliberately unpruned: pruning it would
// re-create #334 in a new form.
if (isStatic && seedLow >= 0x0100u)
{
var seedCell = cache.GetCellStruct(seedCellId);
if (seedCell is not null)
{
var keep = new List<uint>(candidates.Count);
foreach (uint id in candidates.OrderedIds)
{
if (id == seedCellId || seedCell.VisibleCellIds.Contains(id))
keep.Add(id);
}
if (keep.Count != candidates.Count)
{
candidates.Clear();
foreach (uint id in keep) candidates.Add(id);
}
}
}
// Do NOT apply CObjCell::find_cell_list's do_not_load_cells prune
// (0x0052b66e) here. That code belongs to the sphere/cylsphere entry
// point at 0x0052b4e0. The part-array route used here is retail
// CPhysicsObj::find_bbox_cell_list @0x00510fc0: it walks the growing
// CELLARRAY through CPartArray::calc_cross_cells_static and returns
// it directly. calc_cross_cells_static does set do_not_load_cells=1,
// but the box transit consumes that only as a no-load policy while
// resolving neighbouring cells; it does not delete the already-added
// exterior cells. Pruning here removed a static Setup's legitimate
// outdoor shadow membership after an exit portal crossing (the
// cathedral ramp 0x020009A2: collision remained, render vanished).
return candidates.OrderedIds;
}