refactor(physics): remove parsed collision graphs
Publish prepared GfxObj, Setup, CellStruct, and EnvCell collision records without retaining their parsed DAT BSP, polygon, vertex, or shape graphs. Strip temporary physics bundles at stable world commit, keep graph traversal only as an explicit test/tooling oracle, and report graph residency from actual retained fields. Validated by 115 focused collision/streaming tests, a zero-warning Release build, and 8,413 passing Release tests with five pre-existing skips. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
feb80a67d9
commit
82f8d4f82e
18 changed files with 923 additions and 104 deletions
|
|
@ -5,10 +5,12 @@ using DatReaderWriter.DBObjs;
|
|||
namespace AcDream.App.Physics;
|
||||
|
||||
/// <summary>
|
||||
/// Publishes the graph and prepared collision views for DAT objects discovered
|
||||
/// Publishes package-prepared collision views for DAT objects discovered
|
||||
/// through the live-object path. Streamed statics carry their prepared closure
|
||||
/// on <c>LandblockBuild</c>; live CreateObject/appearance data arrives outside
|
||||
/// that transaction and therefore uses this matching strict publisher.
|
||||
/// that transaction and therefore uses this matching strict publisher. The
|
||||
/// production cache consumes source metadata transiently and never retains its
|
||||
/// parsed collision graph.
|
||||
/// </summary>
|
||||
internal sealed class LiveCollisionAssetPublisher
|
||||
{
|
||||
|
|
|
|||
|
|
@ -43,11 +43,11 @@ internal sealed class LiveEntityCollisionBuilder
|
|||
PhysicsDataCache physicsData,
|
||||
LiveEntityDefaultPoseResolver defaultPose)
|
||||
: this(
|
||||
id => physicsData.GetGfxObj(id)?.FlatPhysicsBsp?.RootIndex >= 0,
|
||||
id => physicsData.GetFlatGfxObj(id)?.PhysicsBsp.RootIndex >= 0,
|
||||
id =>
|
||||
{
|
||||
FlatPhysicsBsp? flat =
|
||||
physicsData.GetGfxObj(id)?.FlatPhysicsBsp;
|
||||
physicsData.GetFlatGfxObj(id)?.PhysicsBsp;
|
||||
return flat is { RootIndex: >= 0 }
|
||||
? flat.Nodes[flat.RootIndex].BoundingSphere.Radius
|
||||
: null;
|
||||
|
|
|
|||
|
|
@ -268,7 +268,8 @@ internal sealed class LiveEntityMotionRuntimeController
|
|||
public (float Radius, float Height) GetSetupCylinder(
|
||||
uint serverGuid, AcDream.Core.World.WorldEntity entity)
|
||||
{
|
||||
var setup = _physicsDataCache.GetSetup(entity.SourceGfxObjOrSetupId);
|
||||
FlatSetupCollision? setup =
|
||||
_physicsDataCache.GetFlatSetup(entity.SourceGfxObjOrSetupId);
|
||||
if (setup is null)
|
||||
return (0f, 0f);
|
||||
// Live spawns bake ObjScale into MeshRefs and never populate
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue