/// <summary> /// Recursively shifts the position and rotation of a skeleton to get each frame model /// Will be expanded soon to support rotations so we can fully export characted model animations. /// </summary> /// <param name="mesh">The mesh to shift</param> /// <param name="track">The skeleton track set to shift</param> /// <param name="skeletonPieceData">The data about this specific piece</param> /// <param name="shift">The shift value to apply to this piece</param> /// <param name="index">The current bone index</param> public void ShiftSkeletonValues(SkeletonTrack track, SkeletonPieceData skeletonPieceData, vec3 shift, int index) { vec3 newShift = shift + skeletonPieceData.AnimationTracks.First().Value.SkeletonPiece.Frames[0].Translation; ShiftVertices(newShift, index); foreach (var pieces in skeletonPieceData.ConnectedPieces) { ShiftSkeletonValues(track, track.Skeleton[pieces], newShift, pieces); } }
public override void Initialize(int index, int id, int size, byte[] data, Dictionary <int, WldFragment> fragments, Dictionary <int, string> stringHash, ILogger logger) { base.Initialize(index, id, size, data, fragments, stringHash, logger); var reader = new BinaryReader(new MemoryStream(data)); Name = stringHash[-reader.ReadInt32()]; int reference = reader.ReadInt32(); SkeletonTrack = fragments[reference - 1] as SkeletonTrack; //Console.WriteLine("0x11: " + Name); }