浏览代码

Or, rather than add, terms in update tolerance

Leo Singer 11 年之前
父节点
当前提交
575dabae7e
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      examples/js/controls/OrbitControls.js

+ 3 - 3
examples/js/controls/OrbitControls.js

@@ -286,11 +286,11 @@ THREE.OrbitControls = function ( object, domElement ) {
 		pan.set( 0, 0, 0 );
 
 		// update condition is:
-		// (camera displacement)^2 + (camera rotation in radians)^2 > EPS
+		// min(camera displacement, camera rotation in radians)^2 > EPS
 		// using small-angle approximation cos(x/2) = 1 - x^2 / 8
 
-		if ( lastPosition.distanceToSquared( this.object.position )
-		   + 8 * (1 - lastQuaternion.dot(this.object.quaternion)) > EPS ) {
+		if ( lastPosition.distanceToSquared( this.object.position ) > EPS
+		    || 8 * (1 - lastQuaternion.dot(this.object.quaternion)) > EPS ) {
 
 			this.dispatchEvent( changeEvent );