Esempio n. 1
0
        //---------------------------------------------------------------
        #endregion
        //---------------------------------------------------------------

        //---------------------------------------------------------------
        #region Methods
        //---------------------------------------------------------------
        /// <summary>
        /// Update the joints of the skeleton.
        /// </summary>
        public void Update()
        {
            // every channel can animate a certain part of the skeleton
            for (int i = 0; i < channels.Length; i++)
            {
                channels[i].Update(animated);
            }
            // Prebind the animated skeleton with the inverse binding pose of the skeleton
            Skinning.PreBind(preBound, animated, invertedBindingPose);
        }
Esempio n. 2
0
 void SoftSkin(Matrix4[] preBound)
 {
     // Apply skinning on all subSets
     for (int iSubSet = 0; iSubSet < data.Length; iSubSet++)
     {
         SubSetData ssData = data[iSubSet];
         if (ssData != null)
         {
             VertexUnit         vu  = mesh.SubSets[iSubSet].VertexUnit;
             PositionStream     ps  = (PositionStream)vu[typeof(PositionStream)];
             IBoneIndicesStream bis = (IBoneIndicesStream)vu[typeof(IBoneIndicesStream)];
             IBoneWeightsStream bws = (IBoneWeightsStream)vu[typeof(IBoneWeightsStream)];
             // currently just the position stream is skinned!
             Skinning.SoftSkin(ps, ssData.Position, bis, bws, preBound, Shadowed);
             ps.Upload();
         }
     }
 }