Example #1
0
 private void UpdateAllLocalPoses(HandDataAsset data)
 {
     for (int i = 0; i < Constants.NUM_HAND_JOINTS; ++i)
     {
         HandSkeletonJoint originalJoint = _originalJoints[i];
         _localPoses[i].position = originalJoint.pose.position;
         _localPoses[i].rotation = data.Joints[i];
     }
 }
Example #2
0
        private void UpdateAllPosesFromWrist()
        {
            if (_dirtyWristJoints == 0) //its completely clean
            {
                return;
            }

            for (int jointIndex = 0; jointIndex < Constants.NUM_HAND_JOINTS; ++jointIndex)
            {
                if ((_dirtyWristJoints & (1 << jointIndex)) == 0) //its clean
                {
                    continue;
                }

                HandSkeletonJoint originalJoint = _originalJoints[jointIndex];
                if (originalJoint.parent >= 0)
                {
                    PoseUtils.Multiply(_posesFromWrist[originalJoint.parent],
                                       _localPoses[jointIndex], ref _posesFromWrist[jointIndex]);
                }
            }
            _dirtyWristJoints = 0; //set all clean
        }