protected void ReadAnimationTrack( BinaryReader reader, Animation anim )
{
ushort type = ReadUShort( reader );
ushort target = ReadUShort( reader );
VertexAnimationTrack track = anim.CreateVertexTrack( target,
mesh.GetVertexDataByTrackHandle( target ),
(VertexAnimationType)type );
// Now read the key frames for this track
if ( !IsEOF( reader ) )
{
MeshChunkID 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 );
}
}
}