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

@ -35,6 +35,47 @@ public sealed class MeshExtractorSolidFaceExtractionTests
private const uint SurfaceTextureId = 0x05000001u;
private const uint RenderSurfaceId = 0x06000001u;
[Fact]
public void PrepareMeshData_CarriesAuthoredDrawingBspSphereInsteadOfVertexAabbSphere()
{
var authored = new Sphere
{
Origin = new Vector3(-0.25f, 0.125f, 0.5f),
Radius = 3.125f,
};
GfxObj gfxObj = BuildQuadGfxObj(SolidSurfaceId, noPos: true);
gfxObj.DrawingBSP = new DrawingBSPTree
{
Root = new DrawingBSPNode { BoundingSphere = authored },
};
var dats = new FakeMeshExtractorDats();
dats.RegisterRootGfxObj(GfxObjId, gfxObj);
dats.Register(SolidSurfaceId, new Surface
{
Type = SurfaceType.Base1Solid,
ColorValue = new ColorARGB
{
Alpha = 255,
Red = 12,
Green = 34,
Blue = 56,
},
});
var extractor = new MeshExtractor(
dats,
NullLogger.Instance,
sideStagedSink: null);
ObjectMeshData? mesh = extractor.PrepareMeshData(
GfxObjId,
isSetup: false);
Assert.NotNull(mesh);
Assert.NotNull(mesh!.SelectionSphere);
Assert.Equal(authored.Origin, mesh.SelectionSphere.Origin);
Assert.Equal(authored.Radius, mesh.SelectionSphere.Radius);
}
/// <summary>
/// One quad polygon, NoPos + Base1Solid: the exact shape of the windmill
/// axle's own polygons. Must now extract to 4 vertices / 6 indices in a