test_shapes.tscn 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. [gd_scene load_steps=8 format=3 uid="uid://v3saw5bafa6a"]
  2. [ext_resource type="Texture2D" uid="uid://c5duuyhbmd0m4" path="res://assets/texture/godot-head.png" id="1"]
  3. [ext_resource type="Script" path="res://test.gd" id="2"]
  4. [ext_resource type="Script" path="res://utils/rigidbody_pick.gd" id="3"]
  5. [ext_resource type="PackedScene" uid="uid://dv7rxhg55y3t6" path="res://tests/static_scene.tscn" id="6"]
  6. [sub_resource type="RectangleShape2D" id="1"]
  7. size = Vector2(40, 60)
  8. [sub_resource type="CapsuleShape2D" id="2"]
  9. radius = 20.0
  10. height = 70.0
  11. [sub_resource type="CircleShape2D" id="3"]
  12. radius = 30.0
  13. [node name="Test" type="Node2D"]
  14. script = ExtResource( "2" )
  15. [node name="DynamicShapes" type="Node2D" parent="."]
  16. [node name="RigidBodyRectangle" type="RigidDynamicBody2D" parent="DynamicShapes"]
  17. position = Vector2(96, 127)
  18. script = ExtResource( "3" )
  19. [node name="CollisionShape2D" type="CollisionShape2D" parent="DynamicShapes/RigidBodyRectangle"]
  20. rotation = 0.675442
  21. shape = SubResource( "1" )
  22. [node name="RigidBodyCapsule" type="RigidDynamicBody2D" parent="DynamicShapes"]
  23. position = Vector2(270.165, 139.444)
  24. script = ExtResource( "3" )
  25. [node name="CollisionShape2D" type="CollisionShape2D" parent="DynamicShapes/RigidBodyCapsule"]
  26. rotation = -0.202458
  27. shape = SubResource( "2" )
  28. [node name="RigidBodyConcavePolygon" type="RigidDynamicBody2D" parent="DynamicShapes"]
  29. position = Vector2(683.614, 132.749)
  30. script = ExtResource( "3" )
  31. [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="DynamicShapes/RigidBodyConcavePolygon"]
  32. scale = Vector2(0.5, 0.5)
  33. 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)
  34. [node name="GodotIcon" type="Sprite2D" parent="DynamicShapes/RigidBodyConcavePolygon"]
  35. self_modulate = Color(1, 1, 1, 0.392157)
  36. scale = Vector2(0.5, 0.5)
  37. texture = ExtResource( "1" )
  38. [node name="RigidBodyConvexPolygon" type="RigidDynamicBody2D" parent="DynamicShapes"]
  39. position = Vector2(473.536, 134.336)
  40. script = ExtResource( "3" )
  41. [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="DynamicShapes/RigidBodyConvexPolygon"]
  42. scale = Vector2(0.5, 0.5)
  43. 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)
  44. [node name="GodotIcon" type="Sprite2D" parent="DynamicShapes/RigidBodyConvexPolygon"]
  45. self_modulate = Color(1, 1, 1, 0.392157)
  46. scale = Vector2(0.5, 0.5)
  47. texture = ExtResource( "1" )
  48. [node name="RigidBodySphere" type="RigidDynamicBody2D" parent="DynamicShapes"]
  49. position = Vector2(919.968, 115.129)
  50. script = ExtResource( "3" )
  51. [node name="CollisionShape2D" type="CollisionShape2D" parent="DynamicShapes/RigidBodySphere"]
  52. shape = SubResource( "3" )
  53. [node name="StaticScene" parent="." instance=ExtResource( "6" )]