浏览代码

Orbitcontrol ZoomToCursor fix (#26549)

* Fix ZoomToCursor to work with changeable object and object3d

* change code style

* remove object type check and fix coding style
王徐 2 年之前
父节点
当前提交
50d352fddd
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      examples/jsm/controls/OrbitControls.js

+ 1 - 1
examples/jsm/controls/OrbitControls.js

@@ -631,7 +631,7 @@ class OrbitControls extends EventDispatcher {
 			mouse.x = ( x / w ) * 2 - 1;
 			mouse.y = - ( y / h ) * 2 + 1;
 
-			dollyDirection.set( mouse.x, mouse.y, 1 ).unproject( object ).sub( object.position ).normalize();
+			dollyDirection.set( mouse.x, mouse.y, 1 ).unproject( scope.object ).sub( scope.object.position ).normalize();
 
 		}