Esempio n. 1
0
 private Matrix GetBoneMatrix(FBBone bone)
 {
     return(new Matrix(bone.Right.members[0], bone.Right.members[1], bone.Right.members[2], 0,
                       bone.Up.members[0], bone.Up.members[1], bone.Up.members[2], 0,
                       bone.Forward.members[0], bone.Forward.members[1], bone.Forward.members[2], 0,
                       0, 0, 0, 1));
 }
Esempio n. 2
0
 private void AddBoneToMesh(FBBone parent, Vector3 ppos, Matrix pm, List <RawVector3> verts)
 {
     foreach (FBBone bone in parent.Children)
     {
         Vector3 pos = new Vector3(bone.Location.members[0], bone.Location.members[1], bone.Location.members[2]);
         Vector4 v   = Vector3.Transform(pos, pm);
         pos.X = v.X + ppos.X;
         pos.Y = v.Y + ppos.Y;
         pos.Z = v.Z + ppos.Z;
         verts.Add(ppos);
         verts.Add(pos);
         Matrix m = GetBoneMatrix(bone);
         AddBoneToMesh(bone, pos, m * pm, verts);
     }
 }