Exemplo n.º 1
0
 private static void IterateBoneTree(EngineBone dstParentBone, CParser.Assimp.LoaderSkeletonBone srcParentNode)
 {
     foreach (var srcNode in srcParentNode.GetChildren())
     {
         EngineBone dstChildBone = new EngineBone(srcNode.GetBoneId(), srcNode.GetBoneInfo().Name, dstParentBone);
         dstChildBone.SetOffsetMatrix(ConvertAssimpMatrix4x4ToOpenTKMatrix4(srcNode.GetBoneInfo().OffsetMatrix));
         dstParentBone.AddChildBone(dstChildBone);
         IterateBoneTree(dstChildBone, srcNode);
     }
 }
Exemplo n.º 2
0
        public static EngineParentBone ConvertAssimpBoneToEngineBone(CParser.Assimp.LoaderSkeletonParentBone rootBone)
        {
            EngineParentBone resultBone = new EngineParentBone();

            foreach (var bone in rootBone.GetChildren())
            {
                EngineBone root = new EngineBone(bone.GetBoneId(), bone.GetBoneInfo().Name, null);
                root.SetOffsetMatrix(ConvertAssimpMatrix4x4ToOpenTKMatrix4(bone.GetBoneInfo().OffsetMatrix));
                IterateBoneTree(root, bone);
                resultBone.AddChildBone(root);
            }

            return(resultBone);
        }