Terrain des sites de plongée : champ de hauteur authoré, Banc du Vigilant, formes variées et rendu sous-marin #4
No files matched your search
@@ -92,8 +92,8 @@ func _build_tile(start_column: int, end_column: int, start_row: int, end_row: in
|
|||||||
var top_right := top_left + 1
|
var top_right := top_left + 1
|
||||||
var bottom_left := top_left + columns_in_tile
|
var bottom_left := top_left + columns_in_tile
|
||||||
var bottom_right := bottom_left + 1
|
var bottom_right := bottom_left + 1
|
||||||
indices.append_array([top_left, bottom_left, top_right])
|
indices.append_array([top_left, top_right, bottom_left])
|
||||||
indices.append_array([top_right, bottom_left, bottom_right])
|
indices.append_array([top_right, bottom_right, bottom_left])
|
||||||
var arrays: Array = []
|
var arrays: Array = []
|
||||||
arrays.resize(Mesh.ARRAY_MAX)
|
arrays.resize(Mesh.ARRAY_MAX)
|
||||||
arrays[Mesh.ARRAY_VERTEX] = vertices
|
arrays[Mesh.ARRAY_VERTEX] = vertices
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const ReferenceBathymetryAcquisition = preload(
|
|||||||
)
|
)
|
||||||
const DIVE_SITE_SCENE = preload("res://game/world/sites/dive_site.tscn")
|
const DIVE_SITE_SCENE = preload("res://game/world/sites/dive_site.tscn")
|
||||||
|
|
||||||
const TEST_COUNT := 23
|
const TEST_COUNT := 24
|
||||||
|
|
||||||
var _failures: Array[String] = []
|
var _failures: Array[String] = []
|
||||||
|
|
||||||
@@ -68,6 +68,16 @@ func _test_actor_matches_field() -> void:
|
|||||||
await physics_frame
|
await physics_frame
|
||||||
|
|
||||||
_expect(actor.tile_count() == 4, "80 cells per side split into 2 x 2 tiles of 64")
|
_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 space := actor.get_world_3d().direct_space_state
|
||||||
var worst_error := 0.0
|
var worst_error := 0.0
|
||||||
for cell: Vector2i in [
|
for cell: Vector2i in [
|
||||||
|
|||||||
Reference in new issue
Block a user