Skip to content

Commit df8b087

Browse files
committed
Update index.js
Fixes dt sign when calculated automatically
1 parent 7771dd5 commit df8b087

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Controller.prototype.update = function(currentValue) {
3232
if (this.lastTime === 0) { // First time update() is called
3333
dt = 1;
3434
} else {
35-
dt = (this.lastTime - currentTime) / 1000; // in seconds
35+
dt = (currentTime - this.lastTime) / 1000; // in seconds
3636
}
3737
this.lastTime = currentTime;
3838
}

0 commit comments

Comments
 (0)