2
0
Эх сурвалжийг харах

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 жил өмнө
parent
commit
50d352fddd

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