Files
godot-demo-projects/3d/physics_tests/tests/functional/test_moving_platform.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

167 lines
5.3 KiB
Plaintext

[gd_scene load_steps=15 format=3 uid="uid://dgh5drb4q81kh"]
[ext_resource type="Script" uid="uid://cx8vo58lobtgu" path="res://utils/camera_orbit.gd" id="1"]
[ext_resource type="Script" uid="uid://uo2swke2y6v8" path="res://tests/functional/test_moving_platform.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://b1ihqm3x8jru" path="res://tests/test_options.tscn" id="3"]
[ext_resource type="Script" uid="uid://ckob04lrcf4w" path="res://utils/characterbody_physics.gd" id="4"]
[sub_resource type="CapsuleShape3D" id="1"]
radius = 0.3
[sub_resource type="BoxShape3D" id="2"]
size = Vector3(0.6, 1.6, 0.6)
[sub_resource type="CylinderShape3D" id="3"]
height = 1.60005
radius = 0.3
[sub_resource type="SphereShape3D" id="4"]
radius = 0.79945
[sub_resource type="ConvexPolygonShape3D" id="5"]
points = PackedVector3Array(-0.7, 0, -0.7, -0.3, 0, 0.8, 0.8, 0, -0.3, 0, -0.8, 0)
[sub_resource type="PhysicsMaterial" id="7"]
[sub_resource type="BoxShape3D" id="8"]
size = Vector3(4, 0.4, 2)
[sub_resource type="Animation" id="9"]
length = 9.0
loop_mode = 1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 4.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Vector3(-7, -4.235, 0), Vector3(7, -4.235, 0)]
}
[sub_resource type="Animation" id="Animation_jtts3"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath(".:position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Vector3(-7, -4.235, 0)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_jtts3"]
_data = {
&"Move": SubResource("9"),
&"RESET": SubResource("Animation_jtts3")
}
[node name="Test2" type="Node3D"]
script = ExtResource("2")
[node name="LabelBodyType" type="Label" parent="."]
offset_left = 14.0
offset_top = 78.0
offset_right = 171.0
offset_bottom = 92.0
text = "Body Type: "
[node name="Options" parent="." instance=ExtResource("3")]
offset_top = 153.0
offset_right = 134.0
offset_bottom = 182.0
[node name="Bodies" type="Node3D" parent="."]
[node name="CharacterBody3D" type="CharacterBody3D" parent="Bodies"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, -4.18538, 0)
collision_layer = 2
script = ExtResource("4")
_stop_on_slopes = true
use_snap = true
[node name="Capsule" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
shape = SubResource("1")
debug_color = Color(1, 1, 0, 1)
[node name="Box" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
shape = SubResource("2")
debug_color = Color(1, 1, 0, 1)
[node name="Cylinder" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
shape = SubResource("3")
debug_color = Color(1, 1, 0, 1)
[node name="Sphere" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
shape = SubResource("4")
debug_color = Color(1, 1, 0, 1)
[node name="Convex" type="CollisionShape3D" parent="Bodies/CharacterBody3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
shape = SubResource("5")
debug_color = Color(1, 1, 0, 1)
[node name="RigidBody" type="RigidBody3D" parent="Bodies"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, -4.18538, 0)
collision_layer = 4
axis_lock_angular_x = true
axis_lock_angular_y = true
axis_lock_angular_z = true
physics_material_override = SubResource("7")
[node name="Capsule" type="CollisionShape3D" parent="Bodies/RigidBody"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
shape = SubResource("1")
debug_color = Color(1, 1, 0, 1)
[node name="Box" type="CollisionShape3D" parent="Bodies/RigidBody"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
shape = SubResource("2")
debug_color = Color(1, 1, 0, 1)
[node name="Cylinder" type="CollisionShape3D" parent="Bodies/RigidBody"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
shape = SubResource("3")
debug_color = Color(1, 1, 0, 1)
[node name="Sphere" type="CollisionShape3D" parent="Bodies/RigidBody"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
shape = SubResource("4")
debug_color = Color(1, 1, 0, 1)
[node name="Convex" type="CollisionShape3D" parent="Bodies/RigidBody"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.8, 0)
shape = SubResource("5")
debug_color = Color(1, 1, 0, 1)
[node name="Platforms" type="Node3D" parent="."]
[node name="MovingPlatform" type="AnimatableBody3D" parent="Platforms"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -7, -4.235, 0)
[node name="CollisionShape" type="CollisionShape3D" parent="Platforms/MovingPlatform"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.2, 0)
shape = SubResource("8")
debug_color = Color(0.533333, 0, 1, 1)
[node name="AnimationPlayer" type="AnimationPlayer" parent="Platforms/MovingPlatform"]
libraries = {
&"": SubResource("AnimationLibrary_jtts3")
}
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 10)
current = true
script = ExtResource("1")