Esempio n. 1
0
    public void UpdateIKTargets(IKSnapshotType type, bool isLeft)
    {
        IKSnapshot snap = GetIKSnapshot(type);

        Vector3 targetBodyPos = snap.bodyPos;

        if (isLeft)
        {
            targetBodyPos.x = -targetBodyPos.x;
        }

        bodyHelper.localPosition = targetBodyPos;

        if (snap.overrideHeadPosition)
        {
            headHelper.localPosition = snap.headPos;
        }
        else
        {
            headHelper.localPosition = defaultHeadPos;
        }

        handHelper.localPosition    = snap.handPos;
        handHelper.localEulerAngles = snap.handEulers;
    }
Esempio n. 2
0
        IKSnapShot GetSnapshot(IKSnapshotType type)
        {
            for (int i = 0; i < ikSnapshots.Length; i++)
            {
                if (ikSnapshots[i].type == type)
                {
                    return(ikSnapshots[i]);
                }
            }

            return(null);
        }
Esempio n. 3
0
        public void UpdateIKTargets(IKSnapshotType type, bool isLeft)
        {
            IKSnapShot snap = GetSnapshot(type);

            Vector3 targetBodyPos = snap.bodyPos;

            if (isLeft)
            {
                targetBodyPos.x = -targetBodyPos.x;
            }
            bodyHelper.localPosition = targetBodyPos;

            handHelper.localPosition    = snap.handPos;
            handHelper.localEulerAngles = snap.hand_eulers;

            /*
             * if (snap.overwriteHeadPos)
             *  headHelper.localPosition = snap.headPos;
             * else
             *  headHelper.localPosition = defaultHeadPos;
             */
        }