add arm ik

This commit is contained in:
oughtum 2024-08-16 20:57:18 +01:00
parent 94f3f02b09
commit 9e41d66783
8 changed files with 77 additions and 4 deletions

BIN
assets/pickaxe_arm.glb Normal file

Binary file not shown.

View file

@ -0,0 +1,36 @@
[remap]
importer="scene"
importer_version=1
type="PackedScene"
uid="uid://ccggyhqyue6fr"
path="res://.godot/imported/pickaxe_arm.glb-fc7bd95af30a47e37063710c848429b2.scn"
[deps]
source_file="res://assets/pickaxe_arm.glb"
dest_files=["res://.godot/imported/pickaxe_arm.glb-fc7bd95af30a47e37063710c848429b2.scn"]
[params]
nodes/root_type=""
nodes/root_name=""
nodes/apply_root_scale=true
nodes/root_scale=1.0
nodes/import_as_skeleton_bones=false
meshes/ensure_tangents=true
meshes/generate_lods=true
meshes/create_shadow_meshes=true
meshes/light_baking=1
meshes/lightmap_texel_size=0.2
meshes/force_disable_compression=false
skins/use_named_skins=true
animation/import=true
animation/fps=30
animation/trimming=false
animation/remove_immutable_tracks=true
animation/import_rest_as_RESET=false
import_script/path=""
_subresources={}
gltf/naming_version=1
gltf/embedded_image_handling=1

Binary file not shown.

Binary file not shown.

View file

@ -1,8 +1,11 @@
[gd_scene load_steps=3 format=3 uid="uid://dgm3241ceqpim"]
[gd_scene load_steps=4 format=3 uid="uid://dgm3241ceqpim"]
[ext_resource type="Script" path="res://body.gd" id="1_21au4"]
[ext_resource type="Script" path="res://scripts/body.gd" id="1_21au4"]
[ext_resource type="PackedScene" uid="uid://cgqpfh5j5v3yd" path="res://scenes/icepick_arm.tscn" id="2_eoxv3"]
[sub_resource type="SphereMesh" id="SphereMesh_jcpb6"]
radius = 5.0
height = 10.0
[node name="Body" type="Node3D"]
script = ExtResource("1_21au4")
@ -10,5 +13,7 @@ script = ExtResource("1_21au4")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
mesh = SubResource("SphereMesh_jcpb6")
[node name="Marker3D" type="Marker3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.49921, 0)
[node name="ArmPivot" type="Node3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.89921, 0)
[node name="icepick_arm" parent="ArmPivot" instance=ExtResource("2_eoxv3")]

19
scenes/icepick_arm.tscn Normal file
View file

@ -0,0 +1,19 @@
[gd_scene load_steps=2 format=3 uid="uid://cgqpfh5j5v3yd"]
[ext_resource type="PackedScene" uid="uid://ccggyhqyue6fr" path="res://assets/pickaxe_arm.glb" id="1_grvsx"]
[node name="pickaxe_arm" instance=ExtResource("1_grvsx")]
[node name="Sphere_004" parent="Armature/Skeleton3D" index="0"]
transform = Transform3D(0.919691, 0, -2.19271e-07, 0, 0.919691, 0, 2.19271e-07, 0, 0.919691, 0, -9.53674e-07, 0)
[node name="Sphere_001" parent="Armature/Skeleton3D" index="1"]
transform = Transform3D(0.919691, 0, 0, 0, 0.919691, 0, 0, 0, 0.919691, 0, 0, 0)
[node name="SkeletonIK3D" type="SkeletonIK3D" parent="Armature/Skeleton3D" index="3"]
root_bone = &"Bone"
tip_bone = &"Bone.011"
target_node = NodePath("../../Target")
[node name="Target" type="Marker3D" parent="Armature" index="1"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 10.2, 0)

13
scripts/arm.gd Normal file
View file

@ -0,0 +1,13 @@
extends Node3D
@export var key: Key
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass