test_friction.tscn 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. [gd_scene load_steps=10 format=3 uid="uid://d1j6kxs3plvry"]
  2. [ext_resource type="Script" uid="uid://cu0nmknf22ua2" path="res://test.gd" id="1"]
  3. [ext_resource type="Script" uid="uid://k4cta5vagong" 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. debug_color = Color(0, 0.533333, 1, 1)
  24. [node name="RigidBodies" type="Node3D" parent="StaticBodyFriction0"]
  25. transform = Transform3D(1, 0, 0, 0, 0.866026, 0.5, 0, -0.5, 0.866026, -3, -7.431, 4.291)
  26. [node name="RigidBodyFriction0" type="RigidBody3D" parent="StaticBodyFriction0/RigidBodies"]
  27. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 0, 10, 0)
  28. physics_material_override = SubResource("3")
  29. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction0/RigidBodies/RigidBodyFriction0"]
  30. shape = SubResource("4")
  31. debug_color = Color(1, 1, 0, 1)
  32. [node name="LabelFriction" type="Label" parent="StaticBodyFriction0/RigidBodies/RigidBodyFriction0"]
  33. offset_right = 40.0
  34. offset_bottom = 14.0
  35. text = "0"
  36. script = ExtResource("2")
  37. world_offset = Vector3(0, 1.5, 0)
  38. [node name="RigidBodyFriction05" type="RigidBody3D" parent="StaticBodyFriction0/RigidBodies"]
  39. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 3, 10, 0)
  40. physics_material_override = SubResource("5")
  41. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction0/RigidBodies/RigidBodyFriction05"]
  42. shape = SubResource("4")
  43. debug_color = Color(1, 1, 0, 1)
  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. world_offset = Vector3(0, 1.5, 0)
  50. [node name="RigidBodyFriction1" type="RigidBody3D" parent="StaticBodyFriction0/RigidBodies"]
  51. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 6, 10, 0)
  52. physics_material_override = SubResource("6")
  53. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction0/RigidBodies/RigidBodyFriction1"]
  54. shape = SubResource("4")
  55. debug_color = Color(1, 1, 0, 1)
  56. [node name="LabelFriction" type="Label" parent="StaticBodyFriction0/RigidBodies/RigidBodyFriction1"]
  57. offset_right = 40.0
  58. offset_bottom = 14.0
  59. text = "1"
  60. script = ExtResource("2")
  61. world_offset = Vector3(0, 1.5, 0)
  62. [node name="StaticBodyFriction1" type="StaticBody3D" parent="."]
  63. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 6, 8.581, 0)
  64. physics_material_override = SubResource("7")
  65. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction1"]
  66. transform = Transform3D(5, 0, 0, 0, 1, 0, 0, 0, 50, 0, 0, 0)
  67. shape = SubResource("2")
  68. debug_color = Color(0, 0.533333, 1, 1)
  69. [node name="RigidBodies" type="Node3D" parent="StaticBodyFriction1"]
  70. transform = Transform3D(1, 0, 0, 0, 0.866026, 0.5, 0, -0.5, 0.866026, -3, -7.431, 4.291)
  71. [node name="RigidBodyFriction0" type="RigidBody3D" parent="StaticBodyFriction1/RigidBodies"]
  72. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 0, 10, 0)
  73. physics_material_override = SubResource("3")
  74. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction0"]
  75. shape = SubResource("4")
  76. debug_color = Color(1, 1, 0, 1)
  77. [node name="LabelFriction" type="Label" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction0"]
  78. offset_right = 40.0
  79. offset_bottom = 14.0
  80. text = "0"
  81. script = ExtResource("2")
  82. world_offset = Vector3(0, 1.5, 0)
  83. [node name="RigidBodyFriction05" type="RigidBody3D" parent="StaticBodyFriction1/RigidBodies"]
  84. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 3, 10, 0)
  85. physics_material_override = SubResource("5")
  86. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction05"]
  87. shape = SubResource("4")
  88. debug_color = Color(1, 1, 0, 1)
  89. [node name="LabelFriction" type="Label" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction05"]
  90. offset_right = 40.0
  91. offset_bottom = 14.0
  92. text = "0.5"
  93. script = ExtResource("2")
  94. world_offset = Vector3(0, 1.5, 0)
  95. [node name="RigidBodyFriction1" type="RigidBody3D" parent="StaticBodyFriction1/RigidBodies"]
  96. transform = Transform3D(1, 0, 0, 0, 0.866025, -0.5, 0, 0.5, 0.866025, 6, 10, 0)
  97. physics_material_override = SubResource("6")
  98. [node name="CollisionShape" type="CollisionShape3D" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction1"]
  99. shape = SubResource("4")
  100. debug_color = Color(1, 1, 0, 1)
  101. [node name="LabelFriction" type="Label" parent="StaticBodyFriction1/RigidBodies/RigidBodyFriction1"]
  102. offset_right = 40.0
  103. offset_bottom = 14.0
  104. text = "1"
  105. script = ExtResource("2")
  106. world_offset = Vector3(0, 1.5, 0)
  107. [node name="Camera3D" type="Camera3D" parent="."]
  108. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.53602, 22.1236)
  109. [node name="LabelGround0" type="Label" parent="."]
  110. anchors_preset = 5
  111. anchor_left = 0.5
  112. anchor_right = 0.5
  113. offset_left = -164.0
  114. offset_top = 80.0
  115. offset_right = -28.0
  116. offset_bottom = 94.0
  117. text = "GROUND FRICTION 0"
  118. [node name="LabelGround1" type="Label" parent="."]
  119. anchors_preset = 5
  120. anchor_left = 0.5
  121. anchor_right = 0.5
  122. offset_left = 31.0
  123. offset_top = 80.0
  124. offset_right = 167.0
  125. offset_bottom = 94.0
  126. text = "GROUND FRICTION 1"