|
@@ -165,6 +165,7 @@ class OrbitControls extends EventDispatcher {
|
|
|
|
|
|
const lastPosition = new Vector3();
|
|
|
const lastQuaternion = new Quaternion();
|
|
|
+ const lastTargetPosition = new Vector3();
|
|
|
|
|
|
const twoPI = 2 * Math.PI;
|
|
|
|
|
@@ -278,12 +279,15 @@ class OrbitControls extends EventDispatcher {
|
|
|
|
|
|
if ( zoomChanged ||
|
|
|
lastPosition.distanceToSquared( scope.object.position ) > EPS ||
|
|
|
- 8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ) {
|
|
|
+ 8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ||
|
|
|
+ lastTargetPosition.distanceToSquared( scope.target ) > 0 ) {
|
|
|
|
|
|
scope.dispatchEvent( _changeEvent );
|
|
|
|
|
|
lastPosition.copy( scope.object.position );
|
|
|
lastQuaternion.copy( scope.object.quaternion );
|
|
|
+ lastTargetPosition.copy( scope.target );
|
|
|
+
|
|
|
zoomChanged = false;
|
|
|
|
|
|
return true;
|