only generate floor for region looked from inside

This commit is contained in:
veclav talica 2024-08-02 03:50:35 +03:00
parent d9cf3be232
commit 59384ce345

View File

@ -19,12 +19,13 @@ func _generate_geometry(space: Space, looked_from_inside: bool) -> Node3D:
var mesh := ArrayMesh.new() var mesh := ArrayMesh.new()
mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, _generate_wall_arrays(space, looked_from_inside)) mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, _generate_wall_arrays(space, looked_from_inside))
mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, _generate_floor_arrays(space))
var wall_material := StandardMaterial3D.new() var wall_material := StandardMaterial3D.new()
wall_material.albedo_texture = wall_texture wall_material.albedo_texture = wall_texture
mesh.surface_set_material(0, wall_material) mesh.surface_set_material(0, wall_material)
if (looked_from_inside):
mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, _generate_floor_arrays(space))
var floor_material := StandardMaterial3D.new() var floor_material := StandardMaterial3D.new()
floor_material.albedo_texture = floor_texture floor_material.albedo_texture = floor_texture
mesh.surface_set_material(1, floor_material) mesh.surface_set_material(1, floor_material)