Преглед изворни кода

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();
 
 		}