mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 20:53:43 +00:00
c75e142c8a
Adds a [layer_names] section to project.godot (Ships/Ball/Arena/
GoalSensor) and sets collision_layer/collision_mask on the 4 physics
body roots (Ship, Ball, Goal Area3D, ArenaBoundary StaticBody3D),
which previously all sat on the default layer 1 / mask 1 so every
body broadphase-tested against every other.
Ships collide with ships/ball/arena but no longer test against the
goal sensor; the goal's mask (Ball only) is the physics-level fix for
what goal.gd's is_in_group("ball") check was doing defensively in
code (left in place, now a no-op guard). ArenaBoundary's runtime-
generated CollisionShape3D children inherit layer/mask from the
StaticBody3D root automatically.
Verified live via godot-mcp under Jolt Physics: ship-vs-ship and
ship-vs-ball collisions still transfer momentum, the ball still
bounces off arena walls, a ball entering a goal still fires
goal_scored (score updates / HUD reset), and a ship teleported into a
goal recess produces zero overlapping bodies on the goal Area3D (was
reachable before, physics-level fix confirmed, not just the code
guard). Headless smoke test (free_play.tscn) is clean.
42 lines
1.5 KiB
Plaintext
42 lines
1.5 KiB
Plaintext
[gd_scene load_steps=5 format=3]
|
|
|
|
[ext_resource type="Script" path="res://scripts/arena_boundary.gd" id="1_bndry"]
|
|
|
|
[sub_resource type="BoxShape3D" id="BoxShape3D_slab"]
|
|
size = Vector3(28, 1, 40)
|
|
|
|
[sub_resource type="BoxShape3D" id="BoxShape3D_side_wall"]
|
|
size = Vector3(1, 13, 38)
|
|
|
|
[sub_resource type="BoxShape3D" id="BoxShape3D_end_wall"]
|
|
size = Vector3(26, 13, 1)
|
|
|
|
[node name="ArenaBoundary" type="StaticBody3D"]
|
|
collision_layer = 4
|
|
collision_mask = 3
|
|
script = ExtResource("1_bndry")
|
|
|
|
[node name="FloorShape" type="CollisionShape3D" parent="."]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.5, 0)
|
|
shape = SubResource("BoxShape3D_slab")
|
|
|
|
[node name="WallPosXShape" type="CollisionShape3D" parent="."]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 12.5, 5.5, 0)
|
|
shape = SubResource("BoxShape3D_side_wall")
|
|
|
|
[node name="WallNegXShape" type="CollisionShape3D" parent="."]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -12.5, 5.5, 0)
|
|
shape = SubResource("BoxShape3D_side_wall")
|
|
|
|
[node name="WallPosZShape" type="CollisionShape3D" parent="."]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5.5, 18.5)
|
|
shape = SubResource("BoxShape3D_end_wall")
|
|
|
|
[node name="WallNegZShape" type="CollisionShape3D" parent="."]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5.5, -18.5)
|
|
shape = SubResource("BoxShape3D_end_wall")
|
|
|
|
[node name="CeilingShape" type="CollisionShape3D" parent="."]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 12.5, 0)
|
|
shape = SubResource("BoxShape3D_slab")
|