test_friction.tscn 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. [gd_scene load_steps=10 format=3 uid="uid://d1j6kxs3plvry"]
  2. [ext_resource type="Script" path="res://test.gd" id="1"]
  3. [ext_resource type="Script" path="res://utils/control3d.gd" id="2"]
  4. [sub_resource type="PhysicsMaterial" id="1"]
  5. friction = 0.0
  6. [sub_resource type="ConcavePolygonShape3D" id="2"]
  7. data = PackedVector3Array(-1, 0, 1, 1, 0, -1, 1, 0, 1, -1, 0, 1, -1, 0, -1, 1, 0, -1)
  8. [sub_resource type="PhysicsMaterial" id="3"]
  9. friction = 0.0
  10. [sub_resource type="BoxShape3D" id="4"]
  11. [sub_resource type="PhysicsMaterial" id="5"]
  12. friction = 0.5
  13. [sub_resource type="PhysicsMaterial" id="6"]
  14. [sub_resource type="PhysicsMaterial" id="7"]
  15. [node name="Test" type="Node3D"]
  16. script = ExtResource( "1" )
  17. [node name="StaticBodyFriction0" type="StaticBody3D" parent="."]
  18. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, -6, 8.581, 0)
  19. physics_material_override = SubResource( "1" )
  20. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction0"]
  21. transform = Transform3D(5, 0, 0, 0, 1, 0, 0, 0, 50, 0, 0, 0)
  22. shape = SubResource( "2" )
  23. [node name="RigidBodies" type="Node3D" parent="StaticBodyFriction0"]
  24. transform = Transform3D(1, 0, 0, 0, 0.866026, 0.5, 0, -0.5, 0.866026, -3, -7.431, 4.291)
  25. [node name="RigidBodyFriction0" type="RigidDynamicBody3D" parent="StaticBodyFriction0/RigidBodies"]
  26. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 0, 10, 0)
  27. physics_material_override = SubResource( "3" )
  28. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction0/RigidBodies/RigidBodyFriction0"]
  29. shape = SubResource( "4" )
  30. [node name="LabelFriction" type="Label" parent="StaticBodyFriction0/RigidBodies/RigidBodyFriction0"]
  31. offset_right = 40.0
  32. offset_bottom = 14.0
  33. text = "0"
  34. script = ExtResource( "2" )
  35. __meta__ = {
  36. "_edit_use_anchors_": false
  37. }
  38. world_offset = Vector3(0, 1.5, 0)
  39. [node name="RigidBodyFriction05" type="RigidDynamicBody3D" parent="StaticBodyFriction0/RigidBodies"]
  40. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 3, 10, 0)
  41. physics_material_override = SubResource( "5" )
  42. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction0/RigidBodies/RigidBodyFriction05"]
  43. shape = SubResource( "4" )
  44. [node name="LabelFriction" type="Label" parent="StaticBodyFriction0/RigidBodies/RigidBodyFriction05"]
  45. offset_right = 40.0
  46. offset_bottom = 14.0
  47. text = "0.5"
  48. script = ExtResource( "2" )
  49. __meta__ = {
  50. "_edit_use_anchors_": false
  51. }
  52. world_offset = Vector3(0, 1.5, 0)
  53. [node name="RigidBodyFriction1" type="RigidDynamicBody3D" parent="StaticBodyFriction0/RigidBodies"]
  54. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 6, 10, 0)
  55. physics_material_override = SubResource( "6" )
  56. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction0/RigidBodies/RigidBodyFriction1"]
  57. shape = SubResource( "4" )
  58. [node name="LabelFriction" type="Label" parent="StaticBodyFriction0/RigidBodies/RigidBodyFriction1"]
  59. offset_right = 40.0
  60. offset_bottom = 14.0
  61. text = "1"
  62. script = ExtResource( "2" )
  63. __meta__ = {
  64. "_edit_use_anchors_": false
  65. }
  66. world_offset = Vector3(0, 1.5, 0)
  67. [node name="StaticBodyFriction1" type="StaticBody3D" parent="."]
  68. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 6, 8.581, 0)
  69. physics_material_override = SubResource( "7" )
  70. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction1"]
  71. transform = Transform3D(5, 0, 0, 0, 1, 0, 0, 0, 50, 0, 0, 0)
  72. shape = SubResource( "2" )
  73. [node name="RigidBodies" type="Node3D" parent="StaticBodyFriction1"]
  74. transform = Transform3D(1, 0, 0, 0, 0.866026, 0.5, 0, -0.5, 0.866026, -3, -7.431, 4.291)
  75. [node name="RigidBodyFriction0" type="RigidDynamicBody3D" parent="StaticBodyFriction1/RigidBodies"]
  76. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 0, 10, 0)
  77. physics_material_override = SubResource( "3" )
  78. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction0"]
  79. shape = SubResource( "4" )
  80. [node name="LabelFriction" type="Label" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction0"]
  81. offset_right = 40.0
  82. offset_bottom = 14.0
  83. text = "0"
  84. script = ExtResource( "2" )
  85. __meta__ = {
  86. "_edit_use_anchors_": false
  87. }
  88. world_offset = Vector3(0, 1.5, 0)
  89. [node name="RigidBodyFriction05" type="RigidDynamicBody3D" parent="StaticBodyFriction1/RigidBodies"]
  90. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 3, 10, 0)
  91. physics_material_override = SubResource( "5" )
  92. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction05"]
  93. shape = SubResource( "4" )
  94. [node name="LabelFriction" type="Label" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction05"]
  95. offset_right = 40.0
  96. offset_bottom = 14.0
  97. text = "0.5"
  98. script = ExtResource( "2" )
  99. __meta__ = {
  100. "_edit_use_anchors_": false
  101. }
  102. world_offset = Vector3(0, 1.5, 0)
  103. [node name="RigidBodyFriction1" type="RigidDynamicBody3D" parent="StaticBodyFriction1/RigidBodies"]
  104. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 6, 10, 0)
  105. physics_material_override = SubResource( "6" )
  106. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction1"]
  107. shape = SubResource( "4" )
  108. [node name="LabelFriction" type="Label" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction1"]
  109. offset_right = 40.0
  110. offset_bottom = 14.0
  111. text = "1"
  112. script = ExtResource( "2" )
  113. __meta__ = {
  114. "_edit_use_anchors_": false
  115. }
  116. world_offset = Vector3(0, 1.5, 0)
  117. [node name="Camera3D" type="Camera3D" parent="."]
  118. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.53602, 22.1236)
  119. [node name="OmniLight" type="OmniLight3D" parent="Camera3D"]
  120. omni_range = 50.0
  121. [node name="LabelGround0" type="Label" parent="."]
  122. anchor_left = 0.5
  123. anchor_right = 0.5
  124. offset_left = -164.0
  125. offset_top = 80.0
  126. offset_right = -28.0
  127. offset_bottom = 94.0
  128. text = "GROUND FRICTION 0"
  129. __meta__ = {
  130. "_edit_use_anchors_": false
  131. }
  132. [node name="LabelGround1" type="Label" parent="."]
  133. anchor_left = 0.5
  134. anchor_right = 0.5
  135. offset_left = 31.0
  136. offset_top = 80.0
  137. offset_right = 167.0
  138. offset_bottom = 94.0
  139. text = "GROUND FRICTION 1"
  140. __meta__ = {
  141. "_edit_use_anchors_": false
  142. }