more small fixes

This commit is contained in:
Nitwel 2024-01-25 12:36:33 +01:00
parent 13157c9f84
commit 43ad4ecbab
2 changed files with 16 additions and 3 deletions

View File

@ -20,6 +20,7 @@ func _on_enter():
height_edge.visible = true
room.room_ceiling.get_node("CollisionShape3D").disabled = (floor_corner == null && height_corner == null)
room.room_floor.get_node("CollisionShape3D").disabled = false
var ceiling_shape = WorldBoundaryShape3D.new()
ceiling_shape.plane = Plane(Vector3.DOWN, 0)
@ -39,6 +40,9 @@ func _on_leave():
height_corner.visible = false
height_edge.visible = false
room.room_ceiling.get_node("CollisionShape3D").disabled = true
room.room_floor.get_node("CollisionShape3D").disabled = true
room.room_ceiling.get_node("Clickable").on_click.disconnect(_on_click_ceiling)
room.room_floor.get_node("Clickable").on_click.disconnect(_on_click_floor)

View File

@ -20,10 +20,16 @@ func _on_enter():
if room.wall_mesh.mesh == null:
return
var ceiling_shape = room.room_ceiling.get_node("CollisionShape3D")
var floor_shape = room.room_floor.get_node("CollisionShape3D")
ceiling_shape.disabled = false
floor_shape.disabled = false
room.ceiling_mesh.mesh = generate_ceiling_mesh()
room.room_ceiling.get_node("CollisionShape3D").shape = room.ceiling_mesh.mesh.create_trimesh_shape()
room.room_floor.get_node("CollisionShape3D").shape = room.ceiling_mesh.mesh.create_trimesh_shape()
room.room_ceiling.get_node("CollisionShape3D").shape.backface_collision = true
ceiling_shape.shape = room.ceiling_mesh.mesh.create_trimesh_shape()
floor_shape.shape = room.ceiling_mesh.mesh.create_trimesh_shape()
ceiling_shape.shape.backface_collision = true
var collisions = generate_collision()
@ -41,6 +47,9 @@ func _on_leave():
room.wall_mesh.visible = false
room.ceiling_mesh.visible = false
room.room_ceiling.get_node("CollisionShape3D").disabled = true
room.room_floor.get_node("CollisionShape3D").disabled = true
for collision in room.wall_collisions.get_children():
collision.queue_free()