예제 #1
0
        public override Matrix[] GetBoneTransforms()
        {
            Matrix[] child1Transforms = child1.GetBoneTransforms();
            Matrix[] child2Transforms = child2.GetBoneTransforms();
            Matrix[] child3Transforms = child2.GetBoneTransforms();

            Matrix[] blendedTransforms = new Matrix[child1Transforms.Length];

            Vector3    scale1;
            Quaternion rot1;
            Vector3    pos1;
            Vector3    scale2;
            Quaternion rot2;
            Vector3    pos2;
            Vector3    scale3;
            Quaternion rot3;
            Vector3    pos3;

            Vector3 bc = SpaceUtils.GetBarycentricCoords(Child1Position, Child2Position, Child3Position, BlendPosition);

            for (int p = 0; p < child1Transforms.Length; p++)
            {
                child1Transforms[p].Decompose(out scale1, out rot1, out pos1);
                child2Transforms[p].Decompose(out scale2, out rot2, out pos2);
                child3Transforms[p].Decompose(out scale3, out rot3, out pos3);
                blendedTransforms[p] = Matrix.CreateScale(scale1 * bc.X + scale2 * bc.Y + scale3 * bc.Z) *
                                       Matrix.CreateFromQuaternion(Quaternion.Normalize(rot1 * bc.X + rot2 * bc.Y + rot3 * bc.Z)) *
                                       Matrix.CreateTranslation(pos1 * bc.X + pos2 * bc.Y + pos3 * bc.Z);
            }

            return(blendedTransforms);
        }
예제 #2
0
        public override Matrix[] GetBoneTransforms()
        {
            Matrix[] child1Transforms = child1.GetBoneTransforms();
            Matrix[] child2Transforms = child2.GetBoneTransforms();

            return(SpaceUtils.LerpSkeletalPose(child1Transforms, child2Transforms, BlendFactor));
        }
예제 #3
0
        public override Matrix[] GetBoneTransforms()
        {
            AnimationNode activeNode = GetActiveChild();

            BinaryBlendAnimationNode binaryNode = activeNode as BinaryBlendAnimationNode;

            if (binaryNode != null)
            {
                Vector2 range = Partition[activeNode.Name];
                binaryNode.BlendFactor = (BlendPosition - range.X) / (range.Y - range.X);
            }

            return(activeNode.GetBoneTransforms());
        }
예제 #4
0
        public override Matrix[] GetBoneTransforms()
        {
            Matrix[] differencePoseTransforms = differencePose.GetBoneTransforms();
            Matrix[] targetPoseTransforms     = targetPose.GetBoneTransforms();

            Matrix[] blendedTransforms = new Matrix[differencePoseTransforms.Length];

            for (int p = 0; p < differencePoseTransforms.Length; p++)
            {
                blendedTransforms[p] = differencePoseTransforms[p] *
                                       targetPoseTransforms[p];
            }

            return(blendedTransforms);
        }
예제 #5
0
 public Matrix[] GetBoneTransforms()
 {
     return(blendTree.GetBoneTransforms());
 }
예제 #6
0
 public override Matrix[] GetBoneTransforms()
 {
     return(child.GetBoneTransforms());
 }