Пример #1
0
 public static string PositionsAsString(this SkeletonFile.Skeleton skeleton, bool flipZ = false)
 {
     return(string.Join(" ", skeleton.Bones.Select(b =>
     {
         var p = b.Position(flipZ);
         return p.ToFormatString();
     })));
 }
Пример #2
0
 public static void ToString(this SkeletonFile.Skeleton skeleton, TextWriter writer, bool flipZ = false)
 {
     writer.WriteLine("  Bones.Count(): {0}", skeleton.Bones.Count());
     for (int i = 0; i < skeleton.Bones.Count(); i++)
     {
         var skeletonBone = skeleton.Bones.ElementAt(i);
         writer.WriteLine("  {0}:", i);
         ToString(skeletonBone, writer, flipZ);
     }
 }
Пример #3
0
        public static IEnumerable <int> Indexes(this SkeletonFile.Skeleton skeleton)
        {
            var result = new List <int>();

            for (int i = 0; i < skeleton.Bones.Count(); i++)
            {
                var bone = skeleton.Bones.ElementAt(i);
                if (bone.ParentIndex >= 0)
                {
                    result.AddRange(new int[] { bone.ParentIndex, i });
                }
            }
            return(result);
        }
Пример #4
0
 public static IEnumerable <Vector3> Positions(this SkeletonFile.Skeleton skeleton)
 {
     return(skeleton.Bones.Select(b => b.Position()).ToArray());
 }
Пример #5
0
 public static string IndexesAsString(this SkeletonFile.Skeleton skeleton, bool flipZ = false)
 {
     return(string.Join(" ", skeleton.Indexes().Select(i => string.Format("{0}", i))));
 }