Esempio n. 1
0
        void MatchBones(Transform steamVRBone, Transform leapBone, BoneBasis basis,
                        Quaternion leapOrientation, int depth = 0)
        {
            if (depth == 0)
            {
                leapBone.transform.position = steamVRBone.transform.position;
            }
            else
            {
                controllerHand.SetTransformWithConstraint(leapBone, steamVRBone.transform.position, GlobalRotationFromBasis(steamVRBone, basis) * leapOrientation);
            }

            if (steamVRBone.childCount == leapBone.childCount)
            {
                if (steamVRBone.childCount == 1)
                {
                    MatchBones(steamVRBone.GetChild(0), leapBone.GetChild(0), basis, leapOrientation, depth + 1);
                }
            }
            else
            {
                Debug.LogError("Mismatch between steamVR and leap child count. Steam Bone:" + steamVRBone + " leap bone: " + leapBone);
                Debug.Break();
            }
        }
Esempio n. 2
0
 void MatchBone(Transform oculusBone, Transform leapBone, BoneBasis basis,
                Quaternion leapOrientation)
 {
     controllerHand.SetTransformWithConstraint(leapBone,
                                               oculusBone.transform.position,
                                               GlobalRotationFromBasis(oculusBone, basis) * leapOrientation);
 }