Guest User

Untitled

a guest
May 20th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1.         internal void FinishAnimation(Matrix worldMatrix)
  2.         {
  3.             //-----------------------------------------------
  4.             int lenght = worldTransforms.Length;
  5.  
  6.             //bonetransform is keyframe nature from the fbx
  7.             worldTransforms[0] = boneTransforms[0] * currentAnimation.inverseBindPose[0]
  8.                 * skinData.BindPose[0] * worldMatrix;
  9.             for (int i = 1; i < lenght; i++)
  10.             {
  11.                 int parent = skinData.SkeletonHierarchy[i];
  12.                 worldTransforms[i] = boneTransforms[i]
  13.                     * currentAnimation.inverseBindPose[i] * skinData.BindPose[i] * worldTransforms[parent];
  14.             }
  15.  
  16.             for (int i = 0; i < lenght; i++)
  17.             {
  18.                 skinTransforms[i] = skinData.InverseBindPose[i] * worldTransforms[i];
  19.             }
  20.         }
Add Comment
Please, Sign In to add comment