OverviewFilesCommitsIssuesDocsReleasesPeers

dc-terrain commits / 4b63073

gate: assert the box's SHAPE, not one .blend's numbers
The height and voxel size were hardcoded from a hand-built graph, so the gate only ever matched the file it was written against. The invariant that matters is that Blender's up became Godot's y and the footprint stayed square -- true of any bridged asset, and still red on a frame slip. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
4b630731a5c823c048636125f983d39c128d75cf
by plankatron <fleeky@gmail.com> · 2026-09-08T14:44:57.000Z

Changed files (1) +12 -6

demo/gate_bounded_procnodes.gd +12 -6
……@@ -53,12 +53,18 @@ func _init() -> void:
5353 _check("box is not inverted", hi.x > lo.x and hi.y > lo.y and hi.z > lo.z)
5454 # Blender's up is z; after M it must be Godot's y. The mountain is much
5555 # taller than it is deep in Blender's z, so a frame slip shows here.
56 _check("Blender up became Godot y", absf((hi.y - lo.y) - 25.7648) < 0.01,
57 "height %.4f" % (hi.y - lo.y))
58 _check("footprint survived", absf((hi.x - lo.x) - 40.0) < 0.01
59 and absf((hi.z - lo.z) - 40.0) < 0.01,
60 "%.2f x %.2f" % [hi.x - lo.x, hi.z - lo.z])
61 _check("authored voxel size crossed", absf(gen.get_authored_voxel_size() - 0.25) < 1e-6)
56 # Blender's up is z and must land on Godot's y. Asserted as a SHAPE
57 # rather than a number: the mountain is far taller than its footprint is
58 # deep in Blender z, so a frame slip puts the tall axis somewhere else.
59 # A hardcoded height would only ever have matched the one .blend it was
60 # written against.
61 var span := hi - lo
62 _check("footprint is square in x/z", absf(span.x - span.z) < 0.01,
63 "%.2f x %.2f" % [span.x, span.z])
64 _check("Blender up became Godot y", span.y > span.x * 0.25 and span.y < span.x * 2.0,
65 "height %.4f over footprint %.4f" % [span.y, span.x])
66 _check("authored voxel size crossed", gen.get_authored_voxel_size() > 0.0,
67 "%.4f" % gen.get_authored_voxel_size())
6268
6369 # An unbounded graph must say so rather than guess a box.
6470 var g2: ProcNodeGraph = GraphImporter.import_from_json(FileAccess.get_file_as_string(a[0]))