Skip to content

Commit

Permalink
Editor/App: Reset time in start()
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Mar 10, 2021
1 parent 3e79ce4 commit e4c5838
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions editor/js/libs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ var APP = {

}

var time, prevTime;
var time, startTime, prevTime;

function animate() {

time = performance.now();

try {

dispatch( events.update, { time: time, delta: time - prevTime } );
dispatch( events.update, { time: time - startTime, delta: time - prevTime } );

} catch ( e ) {

Expand All @@ -177,7 +177,7 @@ var APP = {

if ( renderer.xr.enabled ) dom.append( vrButton );

prevTime = performance.now();
startTime = prevTime = performance.now();

document.addEventListener( 'keydown', onKeyDown );
document.addEventListener( 'keyup', onKeyUp );
Expand Down

0 comments on commit e4c5838

Please sign in to comment.