This commit is contained in:
Spencer Killen 2023-08-19 16:32:19 -06:00
parent 9c90404a7f
commit d5d7295602
Signed by: sjkillen
GPG Key ID: F307025B65C860BA
5 changed files with 14 additions and 8 deletions

Binary file not shown.

Binary file not shown.

View File

@ -1,6 +1,7 @@
extends Node3D extends Node3D
@onready var animation: AnimationNodeStateMachinePlayback = $AnimationTree.get("parameters/playback") @onready var animation: AnimationNodeStateMachinePlayback = $AnimationTree.get("parameters/playback")
@onready var pickup_bone_idx = $rig/Skeleton3D.find_bone("PickupBone")
signal anim_check_grab(position: Vector3) signal anim_check_grab(position: Vector3)
@ -28,7 +29,14 @@ func idle_hold():
animation.travel("IdleHold") animation.travel("IdleHold")
func animation_key_grab(): func animation_key_grab():
emit_signal("anim_check_grab", $GrabPointLocation.global_transform) emit_signal("anim_check_grab", get_pickup_bone_location())
func get_pickup_bone_location() -> Vector3:
var trans = $rig/Skeleton3D.global_transform * $rig/Skeleton3D.get_bone_global_pose(pickup_bone_idx)
return trans.origin
func _process(_delta):
print(get_pickup_bone_location())
func animation_key_pickup_completed(): func animation_key_pickup_completed():
pickup_animation_in_progress = false pickup_animation_in_progress = false

View File

@ -154,7 +154,7 @@ transform = Transform3D(0.065, 0, 0, 0, 0.065, 0, 0, 0, 0.065, 0, 0, 0)
script = ExtResource("2_ksje8") script = ExtResource("2_ksje8")
[node name="Skeleton3D" parent="rig" index="0"] [node name="Skeleton3D" parent="rig" index="0"]
bones/0/rotation = Quaternion(0.10507, 0, 0, 0.994465) bones/0/rotation = Quaternion(0.0889488, 0, 0, 0.996036)
bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015) bones/1/rotation = Quaternion(-0.0891896, 1.18734e-07, -1.06322e-08, 0.996015)
bones/2/rotation = Quaternion(0.0133933, -1.19199e-07, 1.5966e-09, 0.99991) bones/2/rotation = Quaternion(0.0133933, -1.19199e-07, 1.5966e-09, 0.99991)
bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948) bones/3/rotation = Quaternion(-0.00997737, 0.100365, -0.694951, 0.711948)
@ -167,13 +167,10 @@ bones/7/rotation = Quaternion(0.0142813, -6.34259e-18, -4.44044e-16, 0.999898)
bones/10/rotation = Quaternion(0.105246, 0.0039338, -0.0113526, 0.994374) bones/10/rotation = Quaternion(0.105246, 0.0039338, -0.0113526, 0.994374)
bones/15/rotation = Quaternion(0.105246, -0.0039338, 0.0113526, 0.994374) bones/15/rotation = Quaternion(0.105246, -0.0039338, 0.0113526, 0.994374)
[node name="GrabPointLocation" type="Node3D" parent="." index="2"] [node name="OmniLight3D" type="OmniLight3D" parent="." index="2"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1.29365)
[node name="OmniLight3D" type="OmniLight3D" parent="." index="3"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.289473, 8.26292, 4.26359) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.289473, 8.26292, 4.26359)
[node name="AnimationTree" type="AnimationTree" parent="." index="4"] [node name="AnimationTree" type="AnimationTree" parent="." index="3"]
tree_root = SubResource("AnimationNodeStateMachine_6mfdu") tree_root = SubResource("AnimationNodeStateMachine_6mfdu")
anim_player = NodePath("../AnimationPlayer") anim_player = NodePath("../AnimationPlayer")
active = true active = true

View File

@ -16,6 +16,7 @@ func _ready():
$CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11)) $CameraMount.global_rotation.x = clampf($CameraMount.global_rotation.x, deg_to_rad(-60), deg_to_rad(-11))
func _process(_delta): func _process(_delta):
# Brings your mouse out of the window if you press escape. Add pause screen function here? # Brings your mouse out of the window if you press escape. Add pause screen function here?
if Input.is_action_pressed("ui_cancel"): if Input.is_action_pressed("ui_cancel"):