build: make release restore reproducible

This commit is contained in:
Erik 2026-08-18 10:29:00 +02:00
parent b459e0cf0c
commit c38f6b8852
129 changed files with 16810 additions and 188 deletions

View file

@ -388,21 +388,26 @@ public class DoorSetupGfxObjInspectionTests
_out.WriteLine($" CellStruct polygons = {cellStruct.Polygons?.Count ?? 0} (visible)");
_out.WriteLine($" CellStruct physicsPolys = {cellStruct.PhysicsPolygons?.Count ?? 0}");
var physicsPolygons = cellStruct.PhysicsPolygons
?? throw new InvalidDataException("CellStruct has no physics polygons collection.");
var vertices = cellStruct.VertexArray?.Vertices
?? throw new InvalidDataException("CellStruct has no vertex array.");
// Dump ALL physics polygons (collision walls/floor) in world frame
// so we can see what blocks a sphere at world (133.655, 17.59).
_out.WriteLine($" CellStruct PHYSICS polys (world frame):");
var cellOrigin = envCell.Position.Origin;
var cellRot = envCell.Position.Orientation;
for (int pi = 0; pi < cellStruct.PhysicsPolygons.Count; pi++)
for (int pi = 0; pi < physicsPolygons.Count; pi++)
{
var (pid, poly) = (cellStruct.PhysicsPolygons.Keys.ElementAt(pi),
cellStruct.PhysicsPolygons.Values.ElementAt(pi));
var (pid, poly) = (physicsPolygons.Keys.ElementAt(pi),
physicsPolygons.Values.ElementAt(pi));
float wxMin = float.MaxValue, wxMax = float.MinValue;
float wyMin = float.MaxValue, wyMax = float.MinValue;
float wzMin = float.MaxValue, wzMax = float.MinValue;
foreach (var vid in poly.VertexIds)
{
if (!cellStruct.VertexArray.Vertices.TryGetValue((ushort)vid, out var sv)) continue;
if (!vertices.TryGetValue((ushort)vid, out var sv)) continue;
var rotated = System.Numerics.Vector3.Transform(sv.Origin, cellRot);
var world = cellOrigin + rotated;
if (world.X < wxMin) wxMin = world.X; if (world.X > wxMax) wxMax = world.X;
@ -425,7 +430,7 @@ public class DoorSetupGfxObjInspectionTests
continue;
}
// Resolve vertex positions.
var vs = poly.VertexIds.Select(vid => cellStruct.VertexArray.Vertices[(ushort)vid].Origin).ToList();
var vs = poly.VertexIds.Select(vid => vertices[(ushort)vid].Origin).ToList();
string vlist = string.Join(",", vs.Select(v => $"({v.X:F2},{v.Y:F2},{v.Z:F2})"));
// Compute the plane using the first three verts (normal = (v1-v0) x (v2-v0), d = -dot(n, v0)).