protected void ReadAnimation( BinaryReader reader )
{
string name = ReadString( reader );
float length = ReadFloat( reader );
Animation anim = mesh.CreateAnimation( name, length );
// Read the tracks for this animation
if ( !IsEOF( reader ) )
{
MeshChunkID chunkID = ReadChunk( reader );
while ( !IsEOF( reader ) &&
chunkID == MeshChunkID.AnimationTrack )
{
switch ( chunkID )
{
case MeshChunkID.AnimationTrack:
ReadAnimationTrack( reader, anim );
break;
}
if ( !IsEOF( reader ) )
chunkID = ReadChunk( reader );
}
if ( !IsEOF( reader ) )
{
// backpedal to the start of chunk
Seek( reader, -ChunkOverheadSize );
}
}
}