test_rigidbody_impact.tscn 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. [gd_scene load_steps=10 format=3 uid="uid://cw38dssdgqkti"]
  2. [ext_resource type="Script" uid="uid://cy2w4686igcmr" path="res://utils/rigidbody_pick.gd" id="1"]
  3. [ext_resource type="Script" uid="uid://cu0nmknf22ua2" path="res://test.gd" id="2"]
  4. [ext_resource type="PackedScene" uid="uid://3gkujifjokqw" path="res://tests/static_scene_plane.tscn" id="3"]
  5. [ext_resource type="Script" uid="uid://cx8vo58lobtgu" path="res://utils/camera_orbit.gd" id="4"]
  6. [sub_resource type="BoxShape3D" id="1"]
  7. [sub_resource type="CapsuleShape3D" id="2"]
  8. [sub_resource type="CylinderShape3D" id="3"]
  9. [sub_resource type="ConvexPolygonShape3D" id="4"]
  10. points = PackedVector3Array(-0.7, 0, -0.7, -0.3, 0, 0.8, 0.8, 0, -0.3, 0, -1, 0)
  11. [sub_resource type="SphereShape3D" id="5"]
  12. [node name="Test" type="Node3D"]
  13. script = ExtResource("2")
  14. [node name="DynamicShapes" type="Node3D" parent="."]
  15. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 9.35591, 0)
  16. [node name="RigidBodyBox" type="RigidBody3D" parent="DynamicShapes"]
  17. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6, 1, 0)
  18. axis_lock_angular_x = true
  19. axis_lock_angular_y = true
  20. axis_lock_angular_z = true
  21. script = ExtResource("1")
  22. [node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/RigidBodyBox"]
  23. transform = Transform3D(0.6, 0, 0, 0, 1, 0, 0, 0, 0.6, 0, 0, 0)
  24. shape = SubResource("1")
  25. debug_color = Color(1, 1, 0, 1)
  26. [node name="RigidBodyCapsule" type="RigidBody3D" parent="DynamicShapes"]
  27. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3, 1.0034, 0)
  28. axis_lock_angular_x = true
  29. axis_lock_angular_y = true
  30. axis_lock_angular_z = true
  31. script = ExtResource("1")
  32. [node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/RigidBodyCapsule"]
  33. transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0)
  34. shape = SubResource("2")
  35. debug_color = Color(1, 1, 0, 1)
  36. [node name="RigidBodyCylinder" type="RigidBody3D" parent="DynamicShapes"]
  37. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.0034, 0)
  38. axis_lock_angular_x = true
  39. axis_lock_angular_y = true
  40. axis_lock_angular_z = true
  41. script = ExtResource("1")
  42. [node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/RigidBodyCylinder"]
  43. transform = Transform3D(0.8, 0, 0, 0, 1, 0, 0, 0, 0.8, 0, 0, 0)
  44. shape = SubResource("3")
  45. debug_color = Color(1, 1, 0, 1)
  46. [node name="RigidBodyConvex" type="RigidBody3D" parent="DynamicShapes"]
  47. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 3, 1.97795, 0)
  48. axis_lock_angular_x = true
  49. axis_lock_angular_y = true
  50. axis_lock_angular_z = true
  51. script = ExtResource("1")
  52. [node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/RigidBodyConvex"]
  53. transform = Transform3D(1.5, 0, 0, 0, 2, 0, 0, 0, 1.5, 0, 0, 0)
  54. shape = SubResource("4")
  55. debug_color = Color(1, 1, 0, 1)
  56. [node name="RigidBodySphere" type="RigidBody3D" parent="DynamicShapes"]
  57. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 1, 0)
  58. axis_lock_angular_x = true
  59. axis_lock_angular_y = true
  60. axis_lock_angular_z = true
  61. script = ExtResource("1")
  62. [node name="CollisionShape" type="CollisionShape3D" parent="DynamicShapes/RigidBodySphere"]
  63. transform = Transform3D(0.8, 0, 0, 0, 0.8, 0, 0, 0, 0.8, 0, 0, 0)
  64. shape = SubResource("5")
  65. debug_color = Color(1, 1, 0, 1)
  66. [node name="StaticBodyPlane" parent="." instance=ExtResource("3")]
  67. [node name="Camera3D" type="Camera3D" parent="."]
  68. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3.604, 22.124)
  69. fov = 35.0
  70. script = ExtResource("4")