Restore tutorial return placement and source terrain collision eligibility
This commit is contained in:
1 parent
ca08c468ba
commit
8d60a68511
36 files changed
+991
-69
No files matched your search
@@ -162,6 +162,12 @@ static void SourcePolicy()
|
||||
var scene = new SceneCollision(mesh);
|
||||
Check(scene.TriangleCount == 2, "unrendered source proxy retained");
|
||||
Check(scene.Move(Vector3.Zero, new Vector3(100, 0, 0), 1, 4).HitWall, "proxy blocks under provisional policy");
|
||||
var source = mesh with { CollisionPolygons = [new(1, 0, Vector3.UnitX, "wall", "NcWater"), new(1, 1, Vector3.UnitX, "wall", "NcWater")] };
|
||||
var excluded = new SceneCollision(source);
|
||||
Check(excluded.TriangleCount == 0 && !excluded.Move(Vector3.Zero, new(100, 0, 0), 1, 4).HitWall,
|
||||
"NC shape is drawn separately but omitted from terrain registration");
|
||||
var materialOnly = source with { CollisionPolygons = source.CollisionPolygons.Select(p => p with { ShapeName = "wall", MaterialName = "ncwater" }).ToArray() };
|
||||
Check(new SceneCollision(materialOnly).TriangleCount == 2, "NC material name alone does not disable collision");
|
||||
var degenerate = new SceneCollision(new Builder().Triangle(Vector3.Zero, Vector3.One, Vector3.One).Build());
|
||||
Check(degenerate.TriangleCount == 0, "degenerate triangles skipped");
|
||||
Throws<ArgumentOutOfRangeException>(() => scene.Move(Vector3.Zero, Vector3.Zero, 0, 4));
|
||||
@@ -179,8 +185,13 @@ static void OriginalLab()
|
||||
var root = FindRoot();
|
||||
var file = Path.Combine(root, "artifacts/extracted/level1b/scene.json");
|
||||
Check(File.Exists(file), "prepared original lab required (run extractors/prepare.py)");
|
||||
var scene = new SceneCollision(Mesh.LoadSceneJson(file));
|
||||
Check(scene.TriangleCount == 2869, "all original lab triangles included");
|
||||
var mesh = Mesh.LoadSceneJson(file);
|
||||
var scene = new SceneCollision(mesh);
|
||||
Check(mesh.Indices.Length / 3 == 2869 && mesh.CollisionPolygons.Count(p => !p.TerrainCollision) == 18,
|
||||
"NC registration exclusion preserves all render/source polygons");
|
||||
Check(mesh.CollisionPolygons.Where(p => !p.TerrainCollision).All(p => p.ShapeId == 94 && p.ShapeName == "ncwater"),
|
||||
"Actual shape names are recovered from prepared mesh records");
|
||||
Check(scene.TriangleCount == 2851, "source terrain registration excludes18 NC-shape triangles while retaining proxies");
|
||||
var originalRoot = new Vector3(5071.933105f, 26.661896f, 824.103943f);
|
||||
var floor = scene.GroundHeight(originalRoot, 100)!.Value;
|
||||
Near(floor, .5486332f, .001f, "actual lab floor below GAM root");
|
||||
|
||||
Reference in new issue
Block a user