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

@ -619,7 +619,22 @@ public sealed class MeshExtractor {
BoundingBox = boundingBox,
SortCenter = gfxObj?.SortCenter ?? Vector3.Zero,
DIDDegrade = gfxObj != null && gfxObj.Flags.HasFlag(GfxObjFlags.HasDIDDegrade) ? gfxObj.DIDDegrade : 0,
SelectionSphere = new Sphere { Origin = boundingBox.Center, Radius = Vector3.Distance(boundingBox.Max, boundingBox.Min) / 2.0f }
// Retail CGfxObj::Serialize @ 0x00534970 stores drawing_sphere as
// BSPTREE::GetSphere(drawing_bsp), and RenderDeviceD3D::DrawMesh
// @ 0x005A0860 passes that exact sphere to viewconeCheck. The
// vertex-AABB sphere used here previously is a different shape
// (notably on long Facility Hub stair sections) and can change a
// portal-edge admission decision. Preserve the authored root
// sphere in prepared content; retain the AABB only for malformed
// or drawing-BSP-less assets which have no retail sphere to carry.
SelectionSphere = gfxObj?.DrawingBSP?.Root?.BoundingSphere
?? new Sphere
{
Origin = boundingBox.Center,
Radius = Vector3.Distance(
boundingBox.Max,
boundingBox.Min) / 2.0f,
}
};
}