test_collision_pairs.tscn 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. [gd_scene load_steps=8 format=2]
  2. [ext_resource path="res://tests/functional/test_collision_pairs.gd" type="Script" id=1]
  3. [ext_resource path="res://assets/texture/godot-head.png" type="Texture" id=2]
  4. [ext_resource path="res://tests/test_options.tscn" type="PackedScene" id=3]
  5. [sub_resource type="RectangleShape2D" id=1]
  6. extents = Vector2( 40, 60 )
  7. [sub_resource type="CircleShape2D" id=2]
  8. radius = 60.0
  9. [sub_resource type="CapsuleShape2D" id=3]
  10. radius = 30.0
  11. height = 50.0
  12. [sub_resource type="ConcavePolygonShape2D" id=4]
  13. segments = PoolVector2Array( -5.93512, -43.2195, 6.44476, -42.9695, 6.44476, -42.9695, 11.127, -54.3941, 11.127, -54.3941, 26.9528, -49.4309, 26.9528, -49.4309, 26.2037, -36.508, 26.2037, -36.508, 37.5346, -28.1737, 37.5346, -28.1737, 47.6282, -34.3806, 47.6282, -34.3806, 58.0427, -20.9631, 58.0427, -20.9631, 51.113, -10.2876, 51.113, -10.2876, 50.9869, 35.2694, 50.9869, 35.2694, 38.8, 47.5, 38.8, 47.5, 15.9852, 54.3613, 15.9852, 54.3613, -14.9507, 54.1845, -14.9507, 54.1845, -36.5, 48.1, -36.5, 48.1, -50.4828, 36.33, -50.4828, 36.33, -51.3668, -9.98545, -51.3668, -9.98545, -57.8889, -20.5885, -57.8889, -20.5885, -46.9473, -34.7342, -46.9473, -34.7342, -37.4014, -28.547, -37.4014, -28.547, -26.0876, -37.0323, -26.0876, -37.0323, -26.9862, -49.15, -26.9862, -49.15, -11.4152, -54.5332, -11.4152, -54.5332, -5.93512, -43.2195 )
  14. [node name="Test" type="Node2D"]
  15. script = ExtResource( 1 )
  16. [node name="Options" parent="." instance=ExtResource( 3 )]
  17. [node name="Shapes" type="Node2D" parent="."]
  18. z_index = -1
  19. z_as_relative = false
  20. [node name="RigidBodyRectangle" type="RigidBody2D" parent="Shapes"]
  21. position = Vector2( 114.877, 248.76 )
  22. mode = 1
  23. [node name="CollisionShape2D" type="CollisionShape2D" parent="Shapes/RigidBodyRectangle"]
  24. rotation = -1.19206
  25. scale = Vector2( 1.2, 1.2 )
  26. shape = SubResource( 1 )
  27. [node name="RigidBodySphere" type="RigidBody2D" parent="Shapes"]
  28. position = Vector2( 314.894, 257.658 )
  29. mode = 1
  30. [node name="CollisionShape2D" type="CollisionShape2D" parent="Shapes/RigidBodySphere"]
  31. shape = SubResource( 2 )
  32. [node name="RigidBodyCapsule" type="RigidBody2D" parent="Shapes"]
  33. position = Vector2( 465.629, 261.204 )
  34. mode = 1
  35. [node name="CollisionShape2D" type="CollisionShape2D" parent="Shapes/RigidBodyCapsule"]
  36. rotation = -0.202458
  37. scale = Vector2( 1.2, 1.2 )
  38. shape = SubResource( 3 )
  39. [node name="RigidBodyConvexPolygon" type="RigidBody2D" parent="Shapes"]
  40. position = Vector2( 613.385, 252.771 )
  41. mode = 1
  42. [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Shapes/RigidBodyConvexPolygon"]
  43. polygon = PoolVector2Array( 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="Sprite" parent="Shapes/RigidBodyConvexPolygon"]
  45. modulate = Color( 1, 1, 1, 0.392157 )
  46. texture = ExtResource( 2 )
  47. [node name="RigidBodyConcavePolygon" type="RigidBody2D" parent="Shapes"]
  48. position = Vector2( 771.159, 252.771 )
  49. mode = 1
  50. [node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Shapes/RigidBodyConcavePolygon"]
  51. polygon = PoolVector2Array( -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 )
  52. [node name="GodotIcon" type="Sprite" parent="Shapes/RigidBodyConcavePolygon"]
  53. modulate = Color( 1, 1, 1, 0.392157 )
  54. texture = ExtResource( 2 )
  55. [node name="RigidBodyConcaveSegments" type="RigidBody2D" parent="Shapes"]
  56. position = Vector2( 930.097, 252.771 )
  57. mode = 1
  58. [node name="CollisionShape2D" type="CollisionShape2D" parent="Shapes/RigidBodyConcaveSegments"]
  59. shape = SubResource( 4 )
  60. [node name="GodotIcon" type="Sprite" parent="Shapes/RigidBodyConcaveSegments"]
  61. modulate = Color( 1, 1, 1, 0.392157 )
  62. texture = ExtResource( 2 )
  63. [node name="Controls" type="VBoxContainer" parent="."]
  64. pause_mode = 2
  65. anchor_right = 1.0
  66. anchor_bottom = 1.0
  67. margin_left = 25.3619
  68. margin_top = 416.765
  69. margin_right = 218.362
  70. margin_bottom = 458.765
  71. custom_constants/separation = 10
  72. __meta__ = {
  73. "_edit_use_anchors_": false
  74. }
  75. [node name="OffsetH" type="HBoxContainer" parent="Controls"]
  76. margin_right = 193.0
  77. margin_bottom = 16.0
  78. custom_constants/separation = 20
  79. alignment = 2
  80. __meta__ = {
  81. "_edit_use_anchors_": false
  82. }
  83. [node name="Label" type="Label" parent="Controls/OffsetH"]
  84. margin_top = 1.0
  85. margin_right = 53.0
  86. margin_bottom = 15.0
  87. text = "Offset H"
  88. [node name="HSlider" type="HSlider" parent="Controls/OffsetH"]
  89. margin_left = 73.0
  90. margin_right = 193.0
  91. margin_bottom = 16.0
  92. rect_min_size = Vector2( 120, 0 )
  93. min_value = -1.0
  94. max_value = 1.0
  95. step = 0.01
  96. [node name="OffsetV" type="HBoxContainer" parent="Controls"]
  97. margin_top = 26.0
  98. margin_right = 193.0
  99. margin_bottom = 42.0
  100. custom_constants/separation = 20
  101. alignment = 2
  102. __meta__ = {
  103. "_edit_use_anchors_": false
  104. }
  105. [node name="Label" type="Label" parent="Controls/OffsetV"]
  106. margin_left = 2.0
  107. margin_top = 1.0
  108. margin_right = 53.0
  109. margin_bottom = 15.0
  110. text = "Offset V"
  111. [node name="HSlider" type="HSlider" parent="Controls/OffsetV"]
  112. margin_left = 73.0
  113. margin_right = 193.0
  114. margin_bottom = 16.0
  115. rect_min_size = Vector2( 120, 0 )
  116. min_value = -1.0
  117. max_value = 1.0
  118. step = 0.01
  119. [connection signal="value_changed" from="Controls/OffsetH/HSlider" to="." method="set_h_offset"]
  120. [connection signal="value_changed" from="Controls/OffsetV/HSlider" to="." method="set_v_offset"]