tool
extends Spatial


# Declare member variables here. Examples:
# var a = 2
# var b = "text"
onready var skel = $Character/Rig/Skeleton

# Called when the node enters the scene tree for the first time.
func _ready():
	var idx_upperarm_l = skel.find_bone("upperarm.l")
	var idx_lowerarm_l = skel.find_bone("lowerarm.l")
	var idx_upperarm_r = skel.find_bone("upperarm.r")
	var idx_lowerarm_r = skel.find_bone("lowerarm.r")

	var T_UpperArmDown = Transform.IDENTITY.rotated(Vector3.RIGHT,-PI/3)
	var Tl_Elbow90 = Transform.IDENTITY.rotated(Vector3.BACK,-PI/2)
	var Tr_Elbow90 = Transform.IDENTITY.rotated(Vector3.BACK,PI/2)

	var T_ZminusPI4 = Transform.IDENTITY.rotated(Vector3.FORWARD,PI/4)
	var T_ZplusPI4 = Transform.IDENTITY.rotated(Vector3.BACK,PI/4)
	var T_YminusPI2 = Transform.IDENTITY.rotated(Vector3.UP,-PI/2)
	skel.set_bone_pose(idx_upperarm_l,T_UpperArmDown)
	skel.set_bone_pose(idx_upperarm_r,T_UpperArmDown)

	skel.set_bone_pose(idx_lowerarm_l,Tl_Elbow90)
	skel.set_bone_pose(idx_lowerarm_r,Tr_Elbow90)


# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
	pass
