Consolidate project documentation and attribution
Add public-alias credits and a tested in-game credits page, centralize project guidance and asset provenance, import the complete authored fur channel maps, and keep starter-island collision synchronized with imported props.
This commit is contained in:
parent
1940ae13e5
commit
db6074ddfa
59 changed files with 1638 additions and 1032 deletions
|
|
@ -49,6 +49,7 @@ func _run() -> void:
|
|||
runtime_terrain.get_surface_override_material(surface_index) == null,
|
||||
"Region surface %d must use its Blender material." % surface_index,
|
||||
)
|
||||
_validate_region_collision(region)
|
||||
region.free()
|
||||
_finish()
|
||||
|
||||
|
|
@ -118,6 +119,62 @@ func _validate_terrain_materials(
|
|||
)
|
||||
|
||||
|
||||
func _validate_region_collision(region: StarterIslandRegion) -> void:
|
||||
_check(
|
||||
region.rebuild_terrain_collision_on_ready,
|
||||
"Starter-island collision must rebuild from the imported GLB.",
|
||||
)
|
||||
var visual_root := region.get_node_or_null("Terrain/Visual") as Node3D
|
||||
var collision_shape := region.get_node_or_null(
|
||||
"Terrain/Collision/Shape"
|
||||
) as CollisionShape3D
|
||||
_check(visual_root != null, "Region must contain its visual hierarchy.")
|
||||
_check(collision_shape != null, "Region must contain its collision owner.")
|
||||
if visual_root == null or collision_shape == null:
|
||||
return
|
||||
var concave_shape := collision_shape.shape as ConcavePolygonShape3D
|
||||
_check(
|
||||
concave_shape != null,
|
||||
"Region collision must be a generated concave polygon shape.",
|
||||
)
|
||||
if concave_shape == null:
|
||||
return
|
||||
var expected_faces := PackedVector3Array()
|
||||
var mesh_count := _append_collision_faces(
|
||||
region,
|
||||
visual_root,
|
||||
expected_faces,
|
||||
)
|
||||
var actual_faces := concave_shape.get_faces()
|
||||
_check(mesh_count > 1, "Collision must include the imported prop meshes.")
|
||||
_check(not expected_faces.is_empty(), "Imported meshes must provide collision.")
|
||||
_check(
|
||||
actual_faces == expected_faces,
|
||||
"Generated collision must exactly match every imported mesh transform.",
|
||||
)
|
||||
|
||||
|
||||
func _append_collision_faces(
|
||||
region: StarterIslandRegion,
|
||||
node: Node,
|
||||
faces: PackedVector3Array,
|
||||
) -> int:
|
||||
var mesh_count := 0
|
||||
if node is MeshInstance3D:
|
||||
var mesh_instance := node as MeshInstance3D
|
||||
if mesh_instance.mesh != null:
|
||||
var mesh_shape := mesh_instance.mesh.create_trimesh_shape()
|
||||
if mesh_shape != null:
|
||||
mesh_count += 1
|
||||
for face_vertex: Vector3 in mesh_shape.get_faces():
|
||||
faces.append(
|
||||
region.to_local(mesh_instance.to_global(face_vertex))
|
||||
)
|
||||
for child: Node in node.get_children():
|
||||
mesh_count += _append_collision_faces(region, child, faces)
|
||||
return mesh_count
|
||||
|
||||
|
||||
func _check(condition: bool, message: String) -> void:
|
||||
if not condition:
|
||||
failures.append(message)
|
||||
|
|
@ -125,9 +182,9 @@ func _check(condition: bool, message: String) -> void:
|
|||
|
||||
func _finish() -> void:
|
||||
if failures.is_empty():
|
||||
print("Blender terrain material validation: PASS")
|
||||
print("Blender terrain and collision validation: PASS")
|
||||
quit(0)
|
||||
return
|
||||
for failure: String in failures:
|
||||
printerr("Blender terrain material validation: ", failure)
|
||||
printerr("Blender terrain and collision validation: ", failure)
|
||||
quit(1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue