File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ var TimeStep = new Class({
6969 // The actual elapsed time in ms between one update and the next.
7070 // No smoothing, no capping, no averaging. So please be aware of this when using the contents of this property.
7171 this . rawDelta = 0 ;
72+
73+ for ( var i = 0 ; i < this . deltaSmoothingMax ; i ++ )
74+ {
75+ this . deltaHistory [ i ] = this . _target ;
76+ }
7277 } ,
7378
7479 // Called when the DOM window.onBlur event triggers
@@ -121,7 +126,7 @@ var TimeStep = new Class({
121126
122127 for ( var i = 0 ; i < this . deltaSmoothingMax ; i ++ )
123128 {
124- this . deltaHistory [ i ] = 0 ;
129+ this . deltaHistory [ i ] = Math . min ( this . _target , this . deltaHistory [ i ] ) ;
125130 }
126131
127132 this . delta = 0 ;
@@ -178,7 +183,8 @@ var TimeStep = new Class({
178183 {
179184 this . _coolDown -- ;
180185
181- dt = this . _target ;
186+ dt = Math . min ( dt , this . _target ) ;
187+
182188 // debug = (time - this.lastTime);
183189 }
184190
You can’t perform that action at this time.
0 commit comments