src/time.js
/*
 * Timing manager.  Calculates when to advance the simulation and what
 * the timestep is.
 *
 * Has a 'frac' property, for interpolating between successive
 * simulation frames.  It is between 0 and 1.
 *
 * target: An object with a 'step' method, which is passed the
 * timestep
 */
Timing manager.  Calculates when to advance the simulation and what
the timestep is.

Has a 'frac' property, for interpolating between successive
simulation frames.  It is between 0 and 1.

An object with a 'step' method, which is passed the
timestep
Timing manager . Calculates when to advance the simulation and what the timestep is . Has a ' frac ' property for interpolating between successive simulation frames . It is between 0 and 1 . An object with a ' step ' method which is passed the timestep
function Time(target) {
	this._target = target;
	this._rate = param.Rate;
	this._dt = 1.0 / param.Rate;
	this._dtMsec = 1e3 * this._dt;
	this._step0 = -1;
	this._step1 = -1;
	this._lastTime = -1;
	this.frac = 0;
	this.frame = 0;
	this.elapsed = 0;
	this.scale = 1;
	this.realTime = 0;
}
function Time ( target ) { this . _target = target ; this . _rate = param . Rate ; this . _dt = 1.0 / param . Rate ; this . _dtMsec = 1e3 * this . _dt ; this . _step0 = - 1 ; this . _step1 = - 1 ; this . _lastTime = - 1 ; this . frac = 0 ; this . frame = 0 ; this . elapsed = 0 ; this . scale = 1 ; this . realTime = 0 ; }
Timing manager.
Timing manager .
// The object to periodically update // Target update frequency, in Hz // Target update interval, in s // Target update interval, in ms // Previous update timestamp // Next update timestamp // Last update timestamp // The current fractional position between updates, in the range 0-1 // Frame count as of last step // The total elapsed time // Scaling factor for time (larger is slower)