Exemple #1
0
        public FingerJoint GetJointCopy(FingerJoint ToClone)
        {
            // Null check
            if (ToClone == null)
            {
                return(null);
            }

            return(new FingerJoint()
            {
                LocalPosition = ToClone.LocalPosition,
                LocalRotation = ToClone.LocalRotation,
                TransformName = ToClone.TransformName
            });
        }
Exemple #2
0
        public virtual void UpdateJoint(FingerJoint fromJoint, Transform toTransform, bool doLerp)
        {
            // Invalid joint
            if (fromJoint == null || toTransform == null)
            {
                return;
            }

            if (doLerp)
            {
                toTransform.localPosition = Vector3.Lerp(toTransform.localPosition, fromJoint.LocalPosition, Time.deltaTime * AnimationSpeed);
                toTransform.localRotation = Quaternion.Lerp(toTransform.localRotation, fromJoint.LocalRotation, Time.deltaTime * AnimationSpeed);
            }
            else
            {
                toTransform.localPosition = fromJoint.LocalPosition;
                toTransform.localRotation = fromJoint.LocalRotation;
            }
        }