feat(*): Add orientation-readable team-coloured ship meshes, smooth the ball-cam orbit, and hide arena walls the camera is outside of

This commit is contained in:
Josh Creek
2026-07-19 22:18:21 +01:00
parent dfb7285704
commit 4f075b352f
5 changed files with 171 additions and 52 deletions
+22
View File
@@ -11,3 +11,25 @@ const INNER_HEIGHT := 12.0
# Goal-centre distance from arena centre; the end walls sit 1 m behind, so a
# ball pinned against them still overlaps the goal sensor.
const GOAL_LINE_Z := 17.0
@onready var _wall_pos_x: MeshInstance3D = $WallPosXMesh
@onready var _wall_neg_x: MeshInstance3D = $WallNegXMesh
@onready var _wall_pos_z: MeshInstance3D = $WallPosZMesh
@onready var _wall_neg_z: MeshInstance3D = $WallNegZMesh
@onready var _ceiling: MeshInstance3D = $CeilingMesh
func _process(_delta: float) -> void:
# The translucent field material tints everything behind it, so any face
# the camera has crossed to the outside of is hidden entirely — looking
# into the arena from outside stays clear, while faces seen from inside
# keep their tint. Collision is untouched; only the meshes toggle.
var camera := get_viewport().get_camera_3d()
if camera == null:
return # headless (RL/CI) has no camera
var p := to_local(camera.global_position)
_wall_pos_x.visible = p.x < INNER_HALF_X
_wall_neg_x.visible = p.x > -INNER_HALF_X
_wall_pos_z.visible = p.z < INNER_HALF_Z
_wall_neg_z.visible = p.z > -INNER_HALF_Z
_ceiling.visible = p.y < INNER_HEIGHT