perf(physics): cut production traversal to flat assets
Make prepared flat BSP data authoritative for gameplay while retaining the parsed graph only as an exact sampled referee. Fail production publication when collision package data is genuinely absent, keep idempotent already-cached publication valid, and move cell membership, floor lookup, camera diagnostics, and live/static shape bounds onto the flat representation. Validated by 8,402 Release tests, a strict dense-Arwic connected gate with 46,309/46,309 exact referee matches, and graceful shutdown. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
d9446030e6
commit
068a06518d
13 changed files with 743 additions and 43 deletions
|
|
@ -191,7 +191,11 @@ public static class ShadowShapeBuilder
|
|||
foreach (var meshRef in meshRefs)
|
||||
{
|
||||
var phys = getGfxObj(meshRef.GfxObjId);
|
||||
if (phys?.BSP?.Root is null) continue; // no physics BSP → nothing to collide
|
||||
if (phys is null) continue;
|
||||
FlatPhysicsBsp? flat = phys.FlatPhysicsBsp;
|
||||
bool hasFlat = flat is { RootIndex: >= 0 };
|
||||
if (!hasFlat && phys.BSP?.Root is null)
|
||||
continue; // graph-only fixture seam until I6 referee removal
|
||||
|
||||
// PartTransform is root-relative; decompose to local pos/rot/scale.
|
||||
if (!Matrix4x4.Decompose(meshRef.PartTransform,
|
||||
|
|
@ -205,7 +209,9 @@ public static class ShadowShapeBuilder
|
|||
}
|
||||
|
||||
float partScale = pScale.X > 0f ? pScale.X : 1f; // AC objects are uniformly scaled
|
||||
float localRadius = phys.BoundingSphere?.Radius ?? 1f;
|
||||
float localRadius = hasFlat
|
||||
? flat!.Nodes[flat.RootIndex].BoundingSphere.Radius
|
||||
: phys.BoundingSphere?.Radius ?? 1f;
|
||||
|
||||
shapes.Add(new ShadowShape(
|
||||
GfxObjId: meshRef.GfxObjId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue