protected void ReadAnimationTrack( BinaryReader reader, Animation anim )
{
// read the bone handle to apply this track to
ushort boneHandle = ReadUShort( reader );
// get a reference to the target bone
Bone targetBone = skeleton.GetBone( boneHandle );
// create an animation track for this bone
NodeAnimationTrack track = anim.CreateNodeTrack( boneHandle, targetBone );
// keep reading all keyframes for this track
if ( !IsEOF( reader ) )
{
SkeletonChunkID chunkID = ReadChunk( reader );
while ( !IsEOF( reader ) && ( chunkID == SkeletonChunkID.KeyFrame ) )
{
// read the key frame
ReadKeyFrame( reader, track );
// read the next chunk id
// If we're not end of file get the next chunk ID
if ( !IsEOF( reader ) )
{
chunkID = ReadChunk( reader );
}
}
// backpedal to the start of the chunk
if ( !IsEOF( reader ) )
{
Seek( reader, -ChunkOverheadSize );
}
}
}