From 828ffd7f4789be7b5a9c2b9248eb52cdab9c160b Mon Sep 17 00:00:00 2001 From: Yomotsu Date: Wed, 12 Jun 2024 15:18:05 +0900 Subject: [PATCH] fix: issue 515 --- src/CameraControls.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CameraControls.ts b/src/CameraControls.ts index 5c4901d..ccb5396 100644 --- a/src/CameraControls.ts +++ b/src/CameraControls.ts @@ -1984,10 +1984,10 @@ export class CameraControls extends EventDispatcher { fitToSphere( sphereOrMesh: _THREE.Sphere | _THREE.Object3D, enableTransition: boolean ): Promise { const promises: Promise[] = []; - const isSphere = 'isSphere' in sphereOrMesh; - const boundingSphere = isSphere ? - _sphere.copy( sphereOrMesh as _THREE.Sphere ) : - CameraControls.createBoundingSphere( sphereOrMesh as _THREE.Object3D, _sphere ); + const isObject3D = 'isObject3D' in sphereOrMesh; + const boundingSphere = isObject3D ? + CameraControls.createBoundingSphere( sphereOrMesh as _THREE.Object3D, _sphere ) : + _sphere.copy( sphereOrMesh as _THREE.Sphere ); promises.push( this.moveTo( boundingSphere.center.x,