/// <summary> /// Creates a new PhysicsTimer Instance. /// </summary> /// <param name="callback">The callback to call.</param> /// <param name="targetDt">The target change in time. (in seconds)</param> public PhysicsTimer(PhysicsCallback callback, Scalar targetInterval) { if (callback == null) { throw new ArgumentNullException("callback"); } if (targetInterval <= 0) { throw new ArgumentOutOfRangeException("targetInterval"); } this.isBackground = true; this.state = TimerState.NotStarted; this.targetInterval = targetInterval; this.callback = callback; this.waitHandle = new AutoResetEvent(true); }
/// <summary> /// Creates a new PhysicsTimer Instance. /// </summary> /// <param name="callback">The callback to call.</param> /// <param name="targetDt">The target change in time. (in seconds)</param> public PhysicsTimer(PhysicsCallback callback, Scalar targetInterval) { if (callback == null) { throw new ArgumentNullException("callback"); } if (targetInterval <= 0) { throw new ArgumentOutOfRangeException("targetInterval"); } this.isBackground = true; this.state = TimerState.NotStarted; this.targetInterval = targetInterval; this.callback = callback; this.waitHandle = new AutoResetEvent(true); }