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(); }))); }
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); } }
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); }
public static IEnumerable <Vector3> Positions(this SkeletonFile.Skeleton skeleton) { return(skeleton.Bones.Select(b => b.Position()).ToArray()); }
public static string IndexesAsString(this SkeletonFile.Skeleton skeleton, bool flipZ = false) { return(string.Join(" ", skeleton.Indexes().Select(i => string.Format("{0}", i)))); }