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

150 lines
4.8 KiB
Plaintext

[gd_scene load_steps=15 format=3 uid="uid://bqmku5ewlo6j5"]
[ext_resource type="Script" uid="uid://bunx01rkxycln" path="res://tests/functional/test_character.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://blh3twy74kbkv" path="res://tests/test_options.tscn" id="3"]
[ext_resource type="Script" uid="uid://bbj7imitin8ud" path="res://utils/slider.gd" id="3_cd5g0"]
[ext_resource type="PackedScene" uid="uid://cx2q80okt25o1" path="res://tests/static_scene_flat.tscn" id="4"]
[ext_resource type="Script" uid="uid://de1e0s7nie4wc" path="res://utils/label_slider_value.gd" id="4_eoplu"]
[ext_resource type="Script" uid="uid://3kutyof2jcdh" path="res://utils/rigidbody_controller.gd" id="6"]
[ext_resource type="Script" uid="uid://gajv1ool1il5" path="res://utils/characterbody_controller.gd" id="7"]
[sub_resource type="CapsuleShape2D" id="3"]
radius = 15.0
height = 96.0
[sub_resource type="CircleShape2D" id="CircleShape2D_llvur"]
radius = 32.0
[sub_resource type="SeparationRayShape2D" id="RayShape2D_3lv1w"]
length = 64.0
[sub_resource type="PhysicsMaterial" id="1"]
friction = 0.0
[sub_resource type="CapsuleShape2D" id="2"]
radius = 15.0
height = 96.0
[sub_resource type="CircleShape2D" id="CircleShape2D_dr08f"]
radius = 32.0
[sub_resource type="SeparationRayShape2D" id="RayShape2D_w83f0"]
length = 64.0
[node name="Test" type="Node2D"]
script = ExtResource("1")
_snap_distance = 32.0
_floor_max_angle = 60.0
[node name="LabelTestType" type="Label" parent="."]
offset_left = 14.0
offset_top = 79.0
offset_right = 145.0
offset_bottom = 93.0
text = "Testing: "
[node name="Options" parent="." instance=ExtResource("3")]
[node name="LabelFloor" type="Label" parent="."]
offset_left = 14.0
offset_top = 237.929
offset_right = 145.0
offset_bottom = 251.929
text = "ON FLOOR"
[node name="LabelControls" type="Label" parent="."]
offset_left = 14.0
offset_top = 263.291
offset_right = 145.0
offset_bottom = 294.291
text = "LEFT/RIGHT - MOVE
UP - JUMP"
[node name="FloorMaxAngle" type="HBoxContainer" parent="."]
offset_left = 14.0
offset_top = 160.0
offset_right = 476.0
offset_bottom = 186.0
theme_override_constants/separation = 20
alignment = 2
[node name="Label" type="Label" parent="FloorMaxAngle"]
layout_mode = 2
text = "Floor Max angle"
[node name="HSlider" type="HSlider" parent="FloorMaxAngle"]
layout_mode = 2
size_flags_horizontal = 3
max_value = 180.0
script = ExtResource("3_cd5g0")
snap_step = 5.0
[node name="LabelValue" type="Label" parent="FloorMaxAngle"]
layout_mode = 2
text = "0.0"
script = ExtResource("4_eoplu")
[node name="CharacterBody2D" type="CharacterBody2D" parent="."]
position = Vector2(100, 450)
collision_mask = 2147483649
script = ExtResource("7")
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBody2D"]
shape = SubResource("3")
debug_color = Color(0, 1, 0, 0.0980392)
[node name="CharacterBodyRay2D" type="CharacterBody2D" parent="."]
position = Vector2(100, 450)
collision_mask = 2147483649
script = ExtResource("7")
[node name="CollisionShape2D" type="CollisionShape2D" parent="CharacterBodyRay2D"]
position = Vector2(0, -16)
shape = SubResource("CircleShape2D_llvur")
debug_color = Color(0, 1, 0, 0.0980392)
[node name="CollisionShapeRay2D" type="CollisionShape2D" parent="CharacterBodyRay2D"]
position = Vector2(0, -16)
shape = SubResource("RayShape2D_3lv1w")
debug_color = Color(0, 1, 0, 0.0980392)
[node name="RigidDynamicBody2D" type="RigidBody2D" parent="."]
position = Vector2(100, 450)
collision_mask = 2147483649
physics_material_override = SubResource("1")
lock_rotation = true
contact_monitor = true
script = ExtResource("6")
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidDynamicBody2D"]
shape = SubResource("2")
debug_color = Color(1, 1, 0, 0.0980392)
[node name="RigidBodyRay2D" type="RigidBody2D" parent="."]
position = Vector2(100, 450)
collision_mask = 2147483649
physics_material_override = SubResource("1")
lock_rotation = true
contact_monitor = true
script = ExtResource("6")
[node name="CollisionShape2D" type="CollisionShape2D" parent="RigidBodyRay2D"]
position = Vector2(-7.62939e-06, -16)
shape = SubResource("CircleShape2D_dr08f")
debug_color = Color(1, 1, 0, 0.0980392)
[node name="CollisionShapeRay2D" type="CollisionShape2D" parent="RigidBodyRay2D"]
position = Vector2(-7.62939e-06, -16)
shape = SubResource("RayShape2D_w83f0")
debug_color = Color(1, 1, 0, 0.0980392)
[node name="StaticSceneFlat" parent="." instance=ExtResource("4")]
position = Vector2(0, 12)
[node name="StaticBody2D" type="StaticBody2D" parent="."]
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBody2D"]
polygon = PackedVector2Array(171.04, 529.248, 379.275, 294.316, 506.084, 429.135, 648.26, 322.058, 868.746, 322.058, 985.282, 36.6919, 1242.91, 531.917)
[connection signal="value_changed" from="FloorMaxAngle/HSlider" to="." method="_update_floor_max_angle"]