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

76 lines
3.3 KiB
Plaintext

[gd_scene load_steps=8 format=3 uid="uid://v3saw5bafa6a"]
[ext_resource type="Texture2D" uid="uid://c5duuyhbmd0m4" path="res://assets/texture/godot-head.png" id="1"]
[ext_resource type="Script" uid="uid://d0kgjrek58tgu" path="res://test.gd" id="2"]
[ext_resource type="Script" uid="uid://wmtyglckg2sn" path="res://utils/rigidbody_pick.gd" id="3"]
[ext_resource type="PackedScene" uid="uid://dv7rxhg55y3t6" path="res://tests/static_scene.tscn" id="6"]
[sub_resource type="RectangleShape2D" id="1"]
size = Vector2(40, 60)
[sub_resource type="CapsuleShape2D" id="2"]
radius = 20.0
height = 70.0
[sub_resource type="CircleShape2D" id="3"]
radius = 30.0
[node name="Test" type="Node2D"]
script = ExtResource("2")
[node name="DynamicShapes" type="Node2D" parent="."]
[node name="RigidBodyRectangle" type="RigidBody2D" parent="DynamicShapes"]
position = Vector2(96, 127)
script = ExtResource("3")
[node name="CollisionShape2D" type="CollisionShape2D" parent="DynamicShapes/RigidBodyRectangle"]
rotation = 0.675442
shape = SubResource("1")
debug_color = Color(1, 1, 0, 0.0980392)
[node name="RigidBodyCapsule" type="RigidBody2D" parent="DynamicShapes"]
position = Vector2(270.165, 139.444)
script = ExtResource("3")
[node name="CollisionShape2D" type="CollisionShape2D" parent="DynamicShapes/RigidBodyCapsule"]
rotation = -0.202458
shape = SubResource("2")
debug_color = Color(1, 1, 0, 0.0980392)
[node name="RigidBodyConcavePolygon" type="RigidBody2D" parent="DynamicShapes"]
position = Vector2(683.614, 132.749)
script = ExtResource("3")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="DynamicShapes/RigidBodyConcavePolygon"]
scale = Vector2(0.5, 0.5)
polygon = PackedVector2Array(-5.93512, -43.2195, 6.44476, -42.9695, 11.127, -54.3941, 26.9528, -49.4309, 26.2037, -36.508, 37.5346, -28.1737, 47.6282, -34.3806, 58.0427, -20.9631, 51.113, -10.2876, 50.9869, 35.2694, 38.8, 47.5, 15.9852, 54.3613, -14.9507, 54.1845, -36.5, 48.1, -50.4828, 36.33, -51.3668, -9.98545, -57.8889, -20.5885, -46.9473, -34.7342, -37.4014, -28.547, -26.0876, -37.0323, -26.9862, -49.15, -11.4152, -54.5332)
[node name="GodotIcon" type="Sprite2D" parent="DynamicShapes/RigidBodyConcavePolygon"]
self_modulate = Color(1, 1, 1, 0.392157)
scale = Vector2(0.5, 0.5)
texture = ExtResource("1")
[node name="RigidBodyConvexPolygon" type="RigidBody2D" parent="DynamicShapes"]
position = Vector2(473.536, 134.336)
script = ExtResource("3")
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="DynamicShapes/RigidBodyConvexPolygon"]
scale = Vector2(0.5, 0.5)
polygon = PackedVector2Array(10.7, -54.5, 28.3596, -49.4067, 47.6282, -34.3806, 57.9717, -20.9447, 50.9869, 35.2694, 38.8, 47.5, 15.9852, 54.3613, -14.9507, 54.1845, -36.5, 48.1, -50.4828, 36.33, -58.0115, -20.515, -46.9473, -34.7342, -26.0876, -50.1138, -11.4152, -54.5332)
[node name="GodotIcon" type="Sprite2D" parent="DynamicShapes/RigidBodyConvexPolygon"]
self_modulate = Color(1, 1, 1, 0.392157)
scale = Vector2(0.5, 0.5)
texture = ExtResource("1")
[node name="RigidBodySphere" type="RigidBody2D" parent="DynamicShapes"]
position = Vector2(919.968, 115.129)
script = ExtResource("3")
[node name="CollisionShape2D" type="CollisionShape2D" parent="DynamicShapes/RigidBodySphere"]
shape = SubResource("3")
debug_color = Color(1, 1, 0, 0.0980392)
[node name="StaticScene" parent="." instance=ExtResource("6")]