From dc7e5f6c250e5d2eec523ec1afebd626f67b5807 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Thu, 7 Nov 2024 11:55:26 +0900 Subject: [PATCH] Move "camera transition" to core --- example/fadingTiles.js | 3 +-- example/googleMapsExample.js | 2 +- example/r3f/globe.jsx | 2 +- src/index.js | 1 + {example => src}/r3f/components/CameraTransition.jsx | 2 +- src/r3f/index.jsx | 1 + .../camera => src/three/controls}/CameraTransitionManager.js | 0 7 files changed, 6 insertions(+), 5 deletions(-) rename {example => src}/r3f/components/CameraTransition.jsx (97%) rename {example/src/camera => src/three/controls}/CameraTransitionManager.js (100%) diff --git a/example/fadingTiles.js b/example/fadingTiles.js index 851a9a152..3228543d7 100644 --- a/example/fadingTiles.js +++ b/example/fadingTiles.js @@ -6,9 +6,8 @@ import { Group, } from 'three'; import { TilesFadePlugin } from './src/plugins/fade/TilesFadePlugin.js'; -import { EnvironmentControls, TilesRenderer } from '3d-tiles-renderer'; +import { EnvironmentControls, TilesRenderer, CameraTransitionManager } from '3d-tiles-renderer'; import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js'; -import { CameraTransitionManager } from './src/camera/CameraTransitionManager.js'; let controls, scene, renderer; let groundTiles, skyTiles, tilesParent, transition; diff --git a/example/googleMapsExample.js b/example/googleMapsExample.js index 49c8e7735..ac3aac7e0 100644 --- a/example/googleMapsExample.js +++ b/example/googleMapsExample.js @@ -3,6 +3,7 @@ import { CAMERA_FRAME, GeoUtils, GlobeControls, + CameraTransitionManager, TilesRenderer, } from '3d-tiles-renderer'; import { GoogleCloudAuthPlugin } from '3d-tiles-renderer/plugins'; @@ -17,7 +18,6 @@ import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js'; import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js'; import { GUI } from 'three/examples/jsm/libs/lil-gui.module.min.js'; import Stats from 'three/examples/jsm/libs/stats.module.js'; -import { CameraTransitionManager } from './src/camera/CameraTransitionManager.js'; import { TileCompressionPlugin } from './src/plugins/TileCompressionPlugin.js'; import { UpdateOnChangePlugin } from './src/plugins/UpdateOnChangePlugin.js'; import { TilesFadePlugin } from './src/plugins/fade/TilesFadePlugin.js'; diff --git a/example/r3f/globe.jsx b/example/r3f/globe.jsx index d64b55870..77c578cfc 100644 --- a/example/r3f/globe.jsx +++ b/example/r3f/globe.jsx @@ -9,8 +9,8 @@ import { GlobeControls, EastNorthUpFrame, CompassGizmo, + CameraTransition, } from '3d-tiles-renderer/r3f'; -import { CameraTransition } from './components/CameraTransition.jsx'; // Plugins import { GoogleCloudAuthPlugin } from '3d-tiles-renderer/plugins'; diff --git a/src/index.js b/src/index.js index 96350ed49..f5a3c2668 100644 --- a/src/index.js +++ b/src/index.js @@ -20,6 +20,7 @@ export * from './three/renderers/CesiumIonTilesRenderer.js'; // three.js controls export { GlobeControls } from './three/controls/GlobeControls.js'; export { EnvironmentControls } from './three/controls/EnvironmentControls.js'; +export { CameraTransitionManager } from './three/controls/CameraTransitionManager.js'; // three.js plugins export { CesiumIonAuthPlugin } from './three/plugins/CesiumIonAuthPlugin.js'; diff --git a/example/r3f/components/CameraTransition.jsx b/src/r3f/components/CameraTransition.jsx similarity index 97% rename from example/r3f/components/CameraTransition.jsx rename to src/r3f/components/CameraTransition.jsx index 9da217d38..2ae32ba08 100644 --- a/example/r3f/components/CameraTransition.jsx +++ b/src/r3f/components/CameraTransition.jsx @@ -1,6 +1,6 @@ import { forwardRef, useEffect, useMemo } from 'react'; import { useFrame, useThree } from '@react-three/fiber'; -import { CameraTransitionManager } from '../../src/camera/CameraTransitionManager.js'; +import { CameraTransitionManager } from '3d-tiles-renderer'; export const CameraTransition = forwardRef( function CameraTransition( props, ref ) { diff --git a/src/r3f/index.jsx b/src/r3f/index.jsx index 2ec642b00..a13bcd037 100644 --- a/src/r3f/index.jsx +++ b/src/r3f/index.jsx @@ -3,3 +3,4 @@ export * from './components/TilesAttributionOverlay.jsx'; export * from './components/CanvasDOMOverlay.jsx'; export * from './components/CameraControls.jsx'; export * from './components/CompassGizmo.jsx'; +export * from './components/CameraTransition.jsx'; diff --git a/example/src/camera/CameraTransitionManager.js b/src/three/controls/CameraTransitionManager.js similarity index 100% rename from example/src/camera/CameraTransitionManager.js rename to src/three/controls/CameraTransitionManager.js