void InitializeFrames()
 {
     string[] keys = activeAnimation.GetAnimationKeys();
     ModelBoneAnimationFrame nullFrame = new ModelBoneAnimationFrame();
     nullFrame.Position = Vector3.Zero;
     nullFrame.Rotation = Vector3.Zero;
     for (int i = 0; i < keys.Length; i++)
     {
         timeIndices.Add(keys[i], 0);
         frames.Add(keys[i], new Queue<ModelBoneAnimationFrame>());
         prevFrames.Add(keys[i], nullFrame);
         ModelBoneAnimationFrame[] keyFrames = activeAnimation.GetKeyFrames(keys[i]);
         for (int j = 0; j < keyFrames.Length; j++)
             frames[keys[i]].Enqueue(keyFrames[j]);
     }
 }
        void ReadSkeleton(Tokenizer input, SortedList<int, List<ModelBoneAnimationFrame>> frames)
        {
            string text = input.GetNextToken();
            while (text != "skeleton")
                text = input.GetNextToken();
            int currTime = 0;
            timeStart = currTime;
            while (input.Peek() != "end")
            {
                text = input.GetNextToken();
                if (text == "time")
                {
                    currTime = int.Parse(input.GetNextToken());
                    if (currTime > timeEnd && timeEnd > -1)
                    {
                        currTime = (int)timeEnd;
                        break;
                    }
                }
                else
                {
                    int boneID = int.Parse(text);
                    Vector3 posDisp;
                    posDisp.X = float.Parse(input.GetNextToken());
                    posDisp.Y = float.Parse(input.GetNextToken());
                    posDisp.Z = float.Parse(input.GetNextToken());
                    Vector3 rotDisp;
                    rotDisp.X = float.Parse(input.GetNextToken());
                    rotDisp.Y = float.Parse(input.GetNextToken());
                    rotDisp.Z = float.Parse(input.GetNextToken());

                    ModelBoneAnimationFrame frame = new ModelBoneAnimationFrame();
                    frame.Position = posDisp;
                    frame.Rotation = rotDisp;
                    frame.time = currTime;

                    if (!frames.ContainsKey(boneID))
                        frames.Add(boneID, new List<ModelBoneAnimationFrame>());

                    frames[boneID].Add(frame);
                }
            }
            timeEnd = currTime;
            fps = 24;
        }