Skip to content

Commit

Permalink
fix: issue 515 (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
yomotsu authored Jun 12, 2024
1 parent 2aa9cdf commit 3d68dff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/CameraControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1984,10 +1984,10 @@ export class CameraControls extends EventDispatcher {
fitToSphere( sphereOrMesh: _THREE.Sphere | _THREE.Object3D, enableTransition: boolean ): Promise<void[]> {

const promises: Promise<void>[] = [];
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,
Expand Down

0 comments on commit 3d68dff

Please sign in to comment.