| … | … | @@ -53,12 +53,18 @@ func _init() -> void: |
| 53 | 53 | _check("box is not inverted", hi.x > lo.x and hi.y > lo.y and hi.z > lo.z) |
| 54 | 54 | # Blender's up is z; after M it must be Godot's y. The mountain is much |
| 55 | 55 | # 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()) |
| 62 | 68 | |
| 63 | 69 | # An unbounded graph must say so rather than guess a box. |
| 64 | 70 | var g2: ProcNodeGraph = GraphImporter.import_from_json(FileAccess.get_file_as_string(a[0])) |