using UnityEngine;
using System.Collections;

public class CCDIKController : MonoBehaviour 
{
	public Transform hinge;			// 折れ曲がる部分
	public Transform tail;			// 末尾
	public Transform ik_target;		// IKのコントローラの位置

	Vector3 prev_ik_position;

	void LookAt(Transform rotate_target, Transform target_child, Transform controller)
	{
		//var arm_vec = target_child.position - rotate_target.position;
		//var to_controller_vec = controller.position - rotate_target.position;

		//rotate_target.LookAt(controller);
		
		//var euler_angle = rotate_target.localRotation.eulerAngles;
		//euler_angle.x = euler_angle.x - 90;
		//euler_angle.y = euler_angle.y - 180;
		//rotate_target.rotation = Quaternion.Euler(euler_angle);
	}

	// Use this for initialization
	void Start () 
	{
		prev_ik_position = ik_target.position;
	}
	
	// Update is called once per frame
	void Update () 
	{
		LookAt(transform, hinge, ik_target);
		Debug.Log(transform.localRotation);
	}
}
