/* * Updates the 3 plane points * */ public void UpdatePlane() { Quaternion l = lastAnimatedTargetRotation; defaultLocalTargetRotation = QuaTools.GetAxisConvert(transform.rotation, l); planePosition = Quaternion.Inverse(l) * (transform.position - planeNode1.transform.position); }
/* * Initiates the bone, precalculates values. * */ public void Initiate(Vector3 childPosition, Vector3 bendNormal) { // Get default target rotation that looks at child position with bendNormal as up Quaternion defaultTargetRotation = Quaternion.LookRotation(childPosition - transform.position, bendNormal); // Covert default target rotation to local space axisConvert = QuaTools.GetAxisConvert(transform.rotation, defaultTargetRotation); defaultLocalBendNormal = Quaternion.Inverse(transform.rotation) * bendNormal; }