Files
godot-demo-projects/3d/physics_tests/tests/functional/test_rigidbody_ground_check.tscn
Hugo Locurcio a531235db3 Use Jolt Physics in all 3D demos that use physics, improve physics tests demos (#1195)
- Add options for physics ticks per second, time scale, max physics steps per frame
  and physics interpolation to the 2D and 3D physics tests demos.
  - Physics ticks per second are always multiplied by time scale so that
    time scale does not affect the physics simulation quality.
- Enable 4× MSAA for better debug shape display. Remove meshes/lights as
  the debug collision fill make these unnecessary.
  - Switch to the Mobile rendering method in the 2D physics tests demo
    to allow for 2D MSAA, as it's not implemented in Compatibility yet.
- Improve collision shapes color in the 2D and 3D physics tests demos
  for better visibility. Each PhysicsBody type now has its own collision
  shape color.
2025-04-21 21:59:31 +02:00

261 lines
9.3 KiB
Plaintext

[gd_scene load_steps=23 format=3 uid="uid://se7gyhmygqul"]
[ext_resource type="Script" uid="uid://4rx7rkakkj28" path="res://utils/rigidbody_ground_check.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://b1ihqm3x8jru" path="res://tests/test_options.tscn" id="2"]
[ext_resource type="Script" uid="uid://dhh0chau7tu87" path="res://tests/functional/test_rigidbody_ground_check.gd" id="3"]
[ext_resource type="Script" uid="uid://cx8vo58lobtgu" path="res://utils/camera_orbit.gd" id="4"]
[sub_resource type="PhysicsMaterial" id="1"]
friction = 0.0
[sub_resource type="BoxShape3D" id="2"]
[sub_resource type="PhysicsMaterial" id="5"]
friction = 0.0
[sub_resource type="CapsuleShape3D" id="6"]
[sub_resource type="PhysicsMaterial" id="9"]
friction = 0.0
[sub_resource type="CylinderShape3D" id="10"]
[sub_resource type="PhysicsMaterial" id="13"]
friction = 0.0
[sub_resource type="ConvexPolygonShape3D" id="14"]
points = PackedVector3Array(-0.7, 0, -0.7, -0.3, 0, 0.8, 0.8, 0, -0.3, 0, -1, 0)
[sub_resource type="PhysicsMaterial" id="17"]
friction = 0.0
[sub_resource type="SphereShape3D" id="18"]
[sub_resource type="PlaneMesh" id="23"]
size = Vector2(50, 20)
[sub_resource type="ConvexPolygonShape3D" id="24"]
points = PackedVector3Array(25, 0, 10, -25, 0, 10, 25, 0, -10, -25, 0, -10)
[sub_resource type="ConvexPolygonShape3D" id="25"]
points = PackedVector3Array(25, 0, 10, -25, 0, 10, 25, 0, -10, -25, 0, -10)
[sub_resource type="ConvexPolygonShape3D" id="26"]
points = PackedVector3Array(50, 0, 50, -50, 0, 50, 50, 0, -50, -50, 0, -50)
[sub_resource type="ConcavePolygonShape3D" id="27"]
data = PackedVector3Array(-1, 0, 1, 1, 0, -1, 1, 0, 1, -1, 0, 1, -1, 0, -1, 1, 0, -1)
[sub_resource type="ConcavePolygonShape3D" id="28"]
data = PackedVector3Array(50, 0, 50, -50, 0, 50, 50, 0, -50, -50, 0, 50, -50, 0, -50, 50, 0, -50)
[sub_resource type="BoxShape3D" id="29"]
size = Vector3(100, 2, 40)
[sub_resource type="BoxShape3D" id="30"]
size = Vector3(200, 2, 200)
[node name="Test" type="Node3D"]
script = ExtResource("3")
[node name="LabelBodyType" type="Label" parent="."]
offset_left = 14.0
offset_top = 62.0
offset_right = 171.0
offset_bottom = 85.0
text = "Floor Type: "
[node name="Options" parent="." instance=ExtResource("2")]
offset_top = 120.0
offset_bottom = 140.0
focus_mode = 2
[node name="DynamicShapes" type="Node3D" parent="."]
[node name="Bodies" type="Node3D" parent="DynamicShapes"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 5.2912, 0)
[node name="RigidBodyBox" type="RigidBody3D" parent="DynamicShapes/Bodies"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 0, 0)
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
physics_material_override = SubResource("1")
script = ExtResource("1")
[node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/Bodies/RigidBodyBox"]
transform = Transform3D(0.6, 0, 0, 0, 1, 0, 0, 0, 0.6, 0, 0, 0)
shape = SubResource("2")
debug_color = Color(1, 1, 0, 1)
[node name="RigidBodyCapsule" type="RigidBody3D" parent="DynamicShapes/Bodies"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 0, 0)
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
physics_material_override = SubResource("5")
script = ExtResource("1")
[node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/Bodies/RigidBodyCapsule"]
transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0)
shape = SubResource("6")
debug_color = Color(1, 1, 0, 1)
[node name="RigidBodyCylinder" type="RigidBody3D" parent="DynamicShapes/Bodies"]
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
physics_material_override = SubResource("9")
script = ExtResource("1")
[node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/Bodies/RigidBodyCylinder"]
transform = Transform3D(0.8, 0, 0, 0, 1, 0, 0, 0, 0.8, 0, 0, 0)
shape = SubResource("10")
debug_color = Color(1, 1, 0, 1)
[node name="RigidBodyConvex" type="RigidBody3D" parent="DynamicShapes/Bodies"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 0.974548, 0)
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
physics_material_override = SubResource("13")
script = ExtResource("1")
[node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/Bodies/RigidBodyConvex"]
transform = Transform3D(1.5, 0, 0, 0, 2, 0, 0, 0, 1.5, 0, 0, 0)
shape = SubResource("14")
debug_color = Color(1, 1, 0, 1)
[node name="RigidBodySphere" type="RigidBody3D" parent="DynamicShapes/Bodies"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 0)
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
physics_material_override = SubResource("17")
script = ExtResource("1")
[node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/Bodies/RigidBodySphere"]
transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0)
shape = SubResource("18")
debug_color = Color(1, 1, 0, 1)
[node name="Floors" type="Node3D" parent="."]
[node name="ConvexSmall" type="Node3D" parent="Floors"]
[node name="ConvexFloor" type="StaticBody3D" parent="Floors/ConvexSmall"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -10)
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floors/ConvexSmall/ConvexFloor"]
visible = false
mesh = SubResource("23")
[node name="CollisionShape" type="CollisionShape3D" parent="Floors/ConvexSmall/ConvexFloor"]
shape = SubResource("24")
debug_color = Color(0, 0.533333, 1, 1)
[node name="ConvexFloor2" type="StaticBody3D" parent="Floors/ConvexSmall"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10)
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floors/ConvexSmall/ConvexFloor2"]
visible = false
mesh = SubResource("23")
[node name="CollisionShape" type="CollisionShape3D" parent="Floors/ConvexSmall/ConvexFloor2"]
shape = SubResource("25")
debug_color = Color(0, 0.533333, 1, 1)
[node name="ConvexBig" type="Node3D" parent="Floors"]
[node name="ConvexFloor" type="StaticBody3D" parent="Floors/ConvexBig"]
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floors/ConvexBig/ConvexFloor"]
visible = false
mesh = SubResource("23")
[node name="CollisionShape" type="CollisionShape3D" parent="Floors/ConvexBig/ConvexFloor"]
shape = SubResource("26")
debug_color = Color(0, 0.533333, 1, 1)
[node name="ConcaveSmall" type="Node3D" parent="Floors"]
[node name="ConcaveFloor" type="StaticBody3D" parent="Floors/ConcaveSmall"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -10)
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floors/ConcaveSmall/ConcaveFloor"]
visible = false
mesh = SubResource("23")
[node name="CollisionShape" type="CollisionShape3D" parent="Floors/ConcaveSmall/ConcaveFloor"]
transform = Transform3D(25, 0, 0, 0, 1, 0, 0, 0, 10, 0, 0, 0)
shape = SubResource("27")
debug_color = Color(0, 0.533333, 1, 1)
[node name="ConcaveFloor2" type="StaticBody3D" parent="Floors/ConcaveSmall"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10)
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floors/ConcaveSmall/ConcaveFloor2"]
visible = false
mesh = SubResource("23")
[node name="CollisionShape" type="CollisionShape3D" parent="Floors/ConcaveSmall/ConcaveFloor2"]
transform = Transform3D(25, 0, 0, 0, 1, 0, 0, 0, 10, 0, 0, 0)
shape = SubResource("27")
debug_color = Color(0, 0.533333, 1, 1)
[node name="ConcaveBig" type="Node3D" parent="Floors"]
[node name="ConcaveFloor" type="StaticBody3D" parent="Floors/ConcaveBig"]
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floors/ConcaveBig/ConcaveFloor"]
visible = false
mesh = SubResource("23")
[node name="CollisionShape" type="CollisionShape3D" parent="Floors/ConcaveBig/ConcaveFloor"]
shape = SubResource("28")
debug_color = Color(0, 0.533333, 1, 1)
[node name="BoxSmall" type="Node3D" parent="Floors"]
[node name="BoxFloor" type="StaticBody3D" parent="Floors/BoxSmall"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -10)
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floors/BoxSmall/BoxFloor"]
visible = false
mesh = SubResource("23")
[node name="CollisionShape" type="CollisionShape3D" parent="Floors/BoxSmall/BoxFloor"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
shape = SubResource("29")
debug_color = Color(0, 0.533333, 1, 1)
[node name="BoxFloor2" type="StaticBody3D" parent="Floors/BoxSmall"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10)
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floors/BoxSmall/BoxFloor2"]
visible = false
mesh = SubResource("23")
[node name="CollisionShape" type="CollisionShape3D" parent="Floors/BoxSmall/BoxFloor2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
shape = SubResource("29")
debug_color = Color(0, 0.533333, 1, 1)
[node name="BoxBig" type="Node3D" parent="Floors"]
[node name="BoxFloor" type="StaticBody3D" parent="Floors/BoxBig"]
[node name="MeshInstance3D" type="MeshInstance3D" parent="Floors/BoxBig/BoxFloor"]
visible = false
mesh = SubResource("23")
[node name="CollisionShape" type="CollisionShape3D" parent="Floors/BoxBig/BoxFloor"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
shape = SubResource("30")
debug_color = Color(0, 0.533333, 1, 1)
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.604, 22.124)
far = 1000.0
script = ExtResource("4")