コード例 #1
0
        public void InvalidateFrame(int frame)
        {
            if (frame <= 0)
            {
                throw new Exception("Cannot invalidate frame 0 for camera");
            }
            if (frame < _frames.Count)
            {
                _frames.RemoveRange(
                    frame,
                    _frames.Count - frame);
                if (_prevframe <= frame)
                {
                    _prevframe = -1;
                }
            }
            var cachepos = (frame / cacherate);

            if (frame % cacherate != 0)
            {
                cachepos++;
            }

            if (cachepos < _framecache.Count)
            {
                _framecache.RemoveRange(cachepos, _framecache.Count - cachepos);
            }
            if (frame == 1)
            {
                Rider firstframe = _timeline.GetFrame(0);
                var   entry      = new CameraEntry(firstframe.CalculateCenter());
                _frames[0]     = entry;
                _framecache[0] = Vector2d.Zero;
            }
        }
コード例 #2
0
 public override void InvalidateFrame(int frame)
 {
     if (frame <= 0)
     {
         throw new Exception("Cannot invalidate frame 0 for camera");
     }
     if (frame < _frames.Count)
     {
         _frames.RemoveRange(
             frame,
             _frames.Count - frame);
     }
     if (frame == 1)
     {
         var firstframe = _timeline.GetFrame(0);
         var entry      = new CameraEntry(firstframe.CalculateCenter());
         _frames[0] = entry;
     }
 }
コード例 #3
0
 public void MarkFirstInvalid(int frame)
 {
     for (int i = frame; i < _unique_frame_collisions.Count; i++)
     {
         var unique = _unique_frame_collisions[i];
         foreach (var hit in unique)
         {
             _allcollisions.Remove(hit);
             if (Settings.Editor.HitTest)
             {
                 _renderer_changelist.Add(hit);
             }
             _line_framehit.Remove(hit);
         }
     }
     _unique_frame_collisions.RemoveRange(
         frame,
         _unique_frame_collisions.Count - frame);
     _currentframe = Math.Min(frame - 1, _currentframe);
 }