protected void ReadAnimationTrack( BinaryReader reader, Animation anim )
{
var type = ReadUShort( reader );
var target = ReadUShort( reader );
var track = anim.CreateVertexTrack( target, this.mesh.GetVertexDataByTrackHandle( target ), (VertexAnimationType)type );
// Now read the key frames for this track
if ( !IsEOF( reader ) )
{
var chunkID = ReadChunk( reader );
while ( !IsEOF( reader ) &&
( chunkID == MeshChunkID.AnimationMorphKeyframe || chunkID == MeshChunkID.AnimationPoseKeyframe ) )
{
switch ( chunkID )
{
case MeshChunkID.AnimationMorphKeyframe:
ReadMorphKeyframe( reader, track );
break;
case MeshChunkID.AnimationPoseKeyframe:
ReadPoseKeyframe( reader, track );
break;
}
if ( !IsEOF( reader ) )
{
chunkID = ReadChunk( reader );
}
}
if ( !IsEOF( reader ) )
{
// backpedal to the start of chunk
Seek( reader, -ChunkOverheadSize );
}
}
}