The Wayback Machine - https://webcf.waybackmachine.org/web/20220312032629/https://github.com/mrdoob/three.js/commit/e4c5838786df988d13a3d3b44559c92e68b9f14f
Skip to content
Permalink
Browse files
Editor/App: Reset time in start()
  • Loading branch information
mrdoob committed on Mar 10, 2021
1 parent 3e79ce4 commit e4c5838786df988d13a3d3b44559c92e68b9f14f
Showing with 3 additions and 3 deletions.
  1. +3 −3 editor/js/libs/app.js
@@ -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 ) {

@@ -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 );

0 comments on commit e4c5838

Please sign in to comment.