fix(world): wind terrain triangles clockwise so the seabed is a front face
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b1d32f7d81
commit
bbf1dc9990
2 files changed
+13
-3
No files matched your search
@@ -15,7 +15,7 @@ const ReferenceBathymetryAcquisition = preload(
|
||||
)
|
||||
const DIVE_SITE_SCENE = preload("res://game/world/sites/dive_site.tscn")
|
||||
|
||||
const TEST_COUNT := 23
|
||||
const TEST_COUNT := 24
|
||||
|
||||
var _failures: Array[String] = []
|
||||
|
||||
@@ -68,6 +68,16 @@ func _test_actor_matches_field() -> void:
|
||||
await physics_frame
|
||||
|
||||
_expect(actor.tile_count() == 4, "80 cells per side split into 2 x 2 tiles of 64")
|
||||
var first_tile := actor.get_node("Tiles").get_child(0) as MeshInstance3D
|
||||
var arrays: Array = first_tile.mesh.surface_get_arrays(0)
|
||||
var tile_vertices: PackedVector3Array = arrays[Mesh.ARRAY_VERTEX]
|
||||
var tile_indices: PackedInt32Array = arrays[Mesh.ARRAY_INDEX]
|
||||
var first_face := Plane(
|
||||
tile_vertices[tile_indices[0]],
|
||||
tile_vertices[tile_indices[1]],
|
||||
tile_vertices[tile_indices[2]]
|
||||
)
|
||||
_expect(first_face.normal.y > 0.0, "tile triangles are wound clockwise from above (front face up)")
|
||||
var space := actor.get_world_3d().direct_space_state
|
||||
var worst_error := 0.0
|
||||
for cell: Vector2i in [
|
||||
|
||||
Reference in new issue
Block a user