skeleton_ik.tscn 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. [gd_scene load_steps=13 format=3 uid="uid://5x7yswntc63m"]
  2. [ext_resource type="Script" path="res://skeleton_ik_runner.gd" id="1"]
  3. [ext_resource type="Texture2D" uid="uid://dhgpf3w8mh4ed" path="res://addons/sade/ik_look_at.png" id="2"]
  4. [ext_resource type="Texture2D" uid="uid://bw3q8aq6gfuof" path="res://addons/sade/editor_gizmo_texture.png" id="3"]
  5. [ext_resource type="PackedScene" uid="uid://ctssefekxjogg" path="res://model/godot_battle_bot.dae" id="4"]
  6. [ext_resource type="Script" path="res://target_from_mousepos.gd" id="5"]
  7. [ext_resource type="Material" path="res://model/battle_bot_color.tres" id="6"]
  8. [ext_resource type="Script" path="res://button_change_scene.gd" id="8"]
  9. [ext_resource type="Script" path="res://addons/sade/ik_look_at.gd" id="9"]
  10. [sub_resource type="PlaneMesh" id="1"]
  11. size = Vector2(40, 40)
  12. [sub_resource type="StandardMaterial3D" id="2"]
  13. albedo_texture = ExtResource( "3" )
  14. roughness = 0.2
  15. uv1_scale = Vector3(0.25, 0.25, 0.25)
  16. uv1_triplanar = true
  17. [sub_resource type="BoxMesh" id="3"]
  18. [sub_resource type="StandardMaterial3D" id="4"]
  19. albedo_color = Color(0, 0.191406, 0.765625, 1)
  20. roughness = 0.0
  21. [node name="SkeletonIK3D" type="Node3D"]
  22. [node name="Floor" type="MeshInstance3D" parent="."]
  23. mesh = SubResource( "1" )
  24. surface_material_override/0 = SubResource( "2" )
  25. [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
  26. transform = Transform3D(0.56827, 0.673454, -0.472789, 0, 0.574581, 0.818448, 0.822842, -0.465099, 0.326517, -9.77531, 11.5204, 11.766)
  27. [node name="Camera3D" type="Camera3D" parent="."]
  28. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 11.5, 11)
  29. fov = 74.0
  30. script = ExtResource( "5" )
  31. MOVEMENT_SPEED = -8.0
  32. flip_axis = true
  33. [node name="Targets" type="Node3D" parent="Camera3D"]
  34. transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -8)
  35. [node name="IK_LookAt_Head" type="Node3D" parent="Camera3D/Targets"]
  36. script = ExtResource( "9" )
  37. __meta__ = {
  38. "_editor_icon": ExtResource( "2" )
  39. }
  40. skeleton_path = NodePath("../../../GodotBattleBot/Armature/Skeleton3D")
  41. bone_name = "Head"
  42. additional_rotation = Vector3(90, 0, 0)
  43. [node name="1MeterCube" type="MeshInstance3D" parent="Camera3D/Targets"]
  44. mesh = SubResource( "3" )
  45. surface_material_override/0 = SubResource( "4" )
  46. [node name="TargetLeft" type="Position3D" parent="Camera3D/Targets"]
  47. transform = Transform3D(-0.179447, 0.98366, -0.0145678, 0.981822, 0.178142, -0.0654973, -0.0618319, -0.0260563, -0.997746, 0.653517, -0.112305, -0.760886)
  48. [node name="TargetRight" type="Position3D" parent="Camera3D/Targets"]
  49. transform = Transform3D(-0.0217688, 0.998559, -0.0490576, 0.992503, 0.0274873, 0.119085, 0.120262, -0.0460975, -0.991671, -0.683053, 0.0251284, -0.811513)
  50. [node name="GodotBattleBot" parent="." instance=ExtResource( "4" )]
  51. [node name="godot_battle_bot" parent="GodotBattleBot/Armature/Skeleton3D" index="0"]
  52. surface_material_override/0 = ExtResource( "6" )
  53. [node name="SkeletonIK_Left" type="SkeletonIK3D" parent="GodotBattleBot/Armature/Skeleton3D" index="1"]
  54. process_priority = 1
  55. root_bone = &"Left_UpperArm"
  56. tip_bone = &"Left_Hand"
  57. use_magnet = true
  58. magnet = Vector3(8, 6, 0)
  59. target_node = NodePath("../../../../Camera3D/Targets/TargetLeft")
  60. script = ExtResource( "1" )
  61. [node name="SkeletonIK_Right" type="SkeletonIK3D" parent="GodotBattleBot/Armature/Skeleton3D" index="2"]
  62. process_priority = 1
  63. root_bone = &"Right_UpperArm"
  64. tip_bone = &"Right_Hand"
  65. use_magnet = true
  66. magnet = Vector3(-8, 6, 0)
  67. target_node = NodePath("../../../../Camera3D/Targets/TargetRight")
  68. script = ExtResource( "1" )
  69. [node name="Control" type="Control" parent="."]
  70. anchor_right = 1.0
  71. anchor_bottom = 1.0
  72. __meta__ = {
  73. "_edit_use_anchors_": false
  74. }
  75. [node name="Panel" type="Panel" parent="Control"]
  76. modulate = Color(1, 1, 1, 0.784314)
  77. anchor_top = 1.0
  78. anchor_right = 1.0
  79. anchor_bottom = 1.0
  80. offset_left = -2.0
  81. offset_top = -70.0
  82. offset_right = 4.0
  83. __meta__ = {
  84. "_edit_use_anchors_": false
  85. }
  86. [node name="Label" type="Label" parent="Control/Panel"]
  87. anchor_right = 1.0
  88. anchor_bottom = 1.0
  89. offset_left = 12.0
  90. offset_top = 10.0
  91. offset_right = -18.0
  92. offset_bottom = -29.0
  93. text = "SkeletonIK3D node
  94. Move mouse to move IK targets"
  95. __meta__ = {
  96. "_edit_use_anchors_": false
  97. }
  98. [node name="ButtonNext" type="Button" parent="Control"]
  99. anchor_left = 1.0
  100. anchor_top = 1.0
  101. anchor_right = 1.0
  102. anchor_bottom = 1.0
  103. offset_left = -124.0
  104. offset_top = -60.0
  105. offset_right = -5.0
  106. offset_bottom = -10.0
  107. text = "Next scene"
  108. script = ExtResource( "8" )
  109. __meta__ = {
  110. "_edit_use_anchors_": false
  111. }
  112. scene_to_change_to = "res://fps/fps_example.tscn"
  113. [node name="ButtonPrev" type="Button" parent="Control"]
  114. anchor_top = 1.0
  115. anchor_bottom = 1.0
  116. offset_left = 10.0
  117. offset_top = -60.0
  118. offset_right = 129.0
  119. offset_bottom = -10.0
  120. text = "Previous scene"
  121. script = ExtResource( "8" )
  122. __meta__ = {
  123. "_edit_use_anchors_": false
  124. }
  125. scene_to_change_to = "res://fabrik_ik.tscn"
  126. [editable path="GodotBattleBot"]