Exemplo n.º 1
0
 private void StartTimer()
 {
     lock (m_frames)
     {
         KeyframeTimer.Add(this);
         m_timerStopped = false;
     }
 }
Exemplo n.º 2
0
 private void StartTimer()
 {
     lock (m_frames)
     {
         KeyframeTimer.Add(this);
         m_lasttickMS   = Util.GetTimeStampMS();
         m_timerStopped = false;
     }
 }
Exemplo n.º 3
0
 public void OnTimer(double tickDuration)
 {
     if (!Monitor.TryEnter(m_frames))
     {
         return;
     }
     if (m_timerStopped)
     {
         KeyframeTimer.Remove(this);
     }
     else
     {
         DoOnTimer(tickDuration);
     }
     Monitor.Exit(m_frames);
 }
Exemplo n.º 4
0
        private void Done()
        {
            KeyframeTimer.Remove(this);
            m_timerStopped    = true;
            m_running         = false;
            m_isCrossing      = false;
            m_waitingCrossing = false;

            m_basePosition = m_group.AbsolutePosition;
            m_baseRotation = m_group.GroupRotation;

            m_group.RootPart.Velocity        = Vector3.Zero;
            m_group.RootPart.AngularVelocity = Vector3.Zero;
            m_group.SendGroupRootTerseUpdate();
            //            m_group.RootPart.ScheduleTerseUpdate();
            m_frames.Clear();
        }
Exemplo n.º 5
0
        public static void Add(KeyframeMotion motion)
        {
            KeyframeTimer timer;

            if (motion.Scene == null)
            {
                return;
            }

            lock (m_timers)
            {
                if (!m_timers.TryGetValue(motion.Scene, out timer))
                {
                    timer = new KeyframeTimer(motion.Scene);
                    m_timers[motion.Scene] = timer;

                    if (!SceneManager.Instance.AllRegionsReady)
                    {
                        // Start the timers only once all the regions are ready. This is required
                        // when using megaregions, because the megaregion is correctly configured
                        // only after all the regions have been loaded. (If we don't do this then
                        // when the prim moves it might think that it crossed into a region.)
                        SceneManager.Instance.OnRegionsReadyStatusChange += delegate(SceneManager sm)
                        {
                            if (sm.AllRegionsReady)
                            {
                                timer.Start();
                            }
                        };
                    }

                    // Check again, in case the regions were started while we were adding the event handler
                    if (SceneManager.Instance.AllRegionsReady)
                    {
                        timer.Start();
                    }
                }
            }

            lock (timer.m_lockObject)
            {
                timer.m_motions[motion] = null;
            }
        }
Exemplo n.º 6
0
        public static void Add(KeyframeMotion motion)
        {
            KeyframeTimer timer;

            if (motion.Scene == null)
            {
                return;
            }

            lock (m_timers)
            {
                if (!m_timers.TryGetValue(motion.Scene, out timer))
                {
                    timer = new KeyframeTimer(motion.Scene);
                    m_timers[motion.Scene] = timer;
                }
            }

            lock (timer.m_lockObject)
            {
                timer.m_motions[motion] = null;
            }
        }
Exemplo n.º 7
0
        public static void Add(KeyframeMotion motion)
        {
            KeyframeTimer timer;

            if (motion.Scene == null)
                return;

            lock (m_timers)
            {
                if (!m_timers.TryGetValue(motion.Scene, out timer))
                {
                    timer = new KeyframeTimer(motion.Scene);
                    m_timers[motion.Scene] = timer;
                }
            }

            lock (timer.m_lockObject)
            {
                timer.m_motions[motion] = null;
            }
        }
Exemplo n.º 8
0
 private void StopTimer()
 {
     m_timerStopped = true;
     KeyframeTimer.Remove(this);
 }
Exemplo n.º 9
0
        public static void Add(KeyframeMotion motion)
        {
            KeyframeTimer timer;

            if (motion.Scene == null)
                return;

            lock (m_timers)
            {
                if (!m_timers.TryGetValue(motion.Scene, out timer))
                {
                    timer = new KeyframeTimer(motion.Scene);
                    m_timers[motion.Scene] = timer;

                    if (!SceneManager.Instance.AllRegionsReady)
                    {
                        // Start the timers only once all the regions are ready. This is required
                        // when using megaregions, because the megaregion is correctly configured
                        // only after all the regions have been loaded. (If we don't do this then
                        // when the prim moves it might think that it crossed into a region.)
                        SceneManager.Instance.OnRegionsReadyStatusChange += delegate(SceneManager sm)
                        {
                            if (sm.AllRegionsReady)
                                timer.Start();
                        };
                    }
                    
                    // Check again, in case the regions were started while we were adding the event handler
                    if (SceneManager.Instance.AllRegionsReady)
                    {
                        timer.Start();
                    }
                }
            }

            lock (timer.m_lockObject)
            {
                timer.m_motions[motion] = null;
            }
        }