Exemplo n.º 1
0
        //---------------------------------------------------------------
        #endregion
        //---------------------------------------------------------------

        //---------------------------------------------------------------
        #region Methods
        //---------------------------------------------------------------
        /// <summary>
        /// Does the manipulation.
        /// </summary>
        public void Do()
        {
            for (int iSubSet = 0; iSubSet < subSets.Length; iSubSet++)
            {
                //Interpolate(animatedJoints, anim.Frames[player.FrameIndex].JointArray,
                //  anim.Frames[player.NextFrameIndex].JointArray, player.Weight);
                //player.Interpolate(animatedJoints, anim.Frames);

                if (bindings[iSubSet] == -1)
                {
                    tags[iSubSet] = Matrix4.Identity;
                }
                else
                {
                    tags[iSubSet] = Matrix4.Invert(anim.Frames[0].JointArray[bindings[iSubSet]]) * animatedJoints[bindings[iSubSet]];
                }

                if (subSets[iSubSet] != null)
                {
                    PositionStream posStream = (PositionStream)subSets[iSubSet].VertexUnit[typeof(PositionStream), 0];

                    Skinning.PreBind(animatedJoints, animatedJoints, skeleton.InvertedBindingPose);
                    Skinning.SoftSkin(posStream, source[iSubSet], boneIndicesStream[iSubSet], boneWeightsStream[iSubSet], animatedJoints, false);

                    posStream.Upload();
                }
            }
        }