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>
42 lines
1.7 KiB
C#
42 lines
1.7 KiB
C#
using System.Collections.Generic;
|
|
using DatReaderWriter.DBObjs;
|
|
// Environment collides with System.Environment under implicit usings — alias it.
|
|
using DatEnvironment = DatReaderWriter.DBObjs.Environment;
|
|
|
|
namespace AcDream.Core.World;
|
|
|
|
/// <summary>
|
|
/// Parsed DAT closure produced by <c>LandblockBuildFactory</c> under the shared
|
|
/// reader gate and consumed by the render-thread presentation publishers.
|
|
/// Publication makes zero DatCollection calls, so the update thread never
|
|
/// blocks on worker DAT access. Entries retain their original DAT IDs.
|
|
/// </summary>
|
|
public sealed record PhysicsDatBundle(
|
|
LandBlockInfo? Info,
|
|
IReadOnlyDictionary<uint, EnvCell> EnvCells,
|
|
IReadOnlyDictionary<uint, DatEnvironment> Environments,
|
|
IReadOnlyDictionary<uint, Setup> Setups,
|
|
IReadOnlyDictionary<uint, GfxObj> GfxObjs)
|
|
{
|
|
/// <summary>Empty bundle for far-tier landblocks (no cells / buildings /
|
|
/// entities) and for non-streaming <see cref="LoadedLandblock"/> construction.</summary>
|
|
public static readonly PhysicsDatBundle Empty = new(
|
|
null,
|
|
new Dictionary<uint, EnvCell>(),
|
|
new Dictionary<uint, DatEnvironment>(),
|
|
new Dictionary<uint, Setup>(),
|
|
new Dictionary<uint, GfxObj>());
|
|
|
|
/// <summary>
|
|
/// Drops parsed collision-bearing GfxObj and Environment/CellStruct graphs
|
|
/// after their immutable package assets have been resolved. The remaining
|
|
/// records are the small publication facts still consumed by building,
|
|
/// placement, and static-light owners.
|
|
/// </summary>
|
|
public PhysicsDatBundle WithoutCollisionGraphs() => new(
|
|
Info,
|
|
EnvCells,
|
|
Empty.Environments,
|
|
Setups,
|
|
Empty.GfxObjs);
|
|
}
|