private void StartTimer() { lock (m_frames) { KeyframeTimer.Add(this); m_timerStopped = false; } }
private void StartTimer() { lock (m_frames) { KeyframeTimer.Add(this); m_lasttickMS = Util.GetTimeStampMS(); m_timerStopped = false; } }
public void OnTimer(double tickDuration) { if (!Monitor.TryEnter(m_frames)) { return; } if (m_timerStopped) { KeyframeTimer.Remove(this); } else { DoOnTimer(tickDuration); } Monitor.Exit(m_frames); }
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(); }
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; } }
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; } }
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; } }
private void StopTimer() { m_timerStopped = true; KeyframeTimer.Remove(this); }
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; } }