提交 cad40e6a 编写于 作者: T tschw 提交者: Mr.doob

Clock (#8564)

* Make Clock work on iOS without polyfill.

* Clock: Avoid adding up unnecessary rounding error.

0.001 does not have a finite binary float representation.
上级 525ddc9b
......@@ -20,7 +20,7 @@ THREE.Clock.prototype = {
start: function () {
this.startTime = performance.now();
this.startTime = ( performance || Date ).now();
this.oldTime = this.startTime;
this.running = true;
......@@ -53,9 +53,9 @@ THREE.Clock.prototype = {
if ( this.running ) {
var newTime = performance.now();
var newTime = ( performance || Date ).now();
diff = 0.001 * ( newTime - this.oldTime );
diff = ( newTime - this.oldTime ) / 1000;
this.oldTime = newTime;
this.elapsedTime += diff;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册