Skip to content

Commit

Permalink
Move more plugins (#847)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson authored Dec 1, 2024
1 parent ae53541 commit 9254c8a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 5 deletions.
2 changes: 1 addition & 1 deletion example/r3f/globe.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
UpdateOnChangePlugin,
TileCompressionPlugin,
TilesFadePlugin,
GLTFExtensionsPlugin,
} from '3d-tiles-renderer/plugins';
import { GLTFExtensionsPlugin } from '../src/plugins/GLTFExtensionsPlugin.js';
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';

// R3F, DREI and LEVA imports
Expand Down
4 changes: 1 addition & 3 deletions example/r3f/ion.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ import { createRoot } from 'react-dom/client';

// TilesRenderer, controls and attribution imports
import { TilesPlugin, TilesRenderer, TilesAttributionOverlay, EnvironmentControls } from '3d-tiles-renderer/r3f';
import { CesiumIonAuthPlugin, UpdateOnChangePlugin } from '3d-tiles-renderer/plugins';
import { CesiumIonAuthPlugin, UpdateOnChangePlugin, GLTFExtensionsPlugin, ReorientationPlugin } from '3d-tiles-renderer/plugins';

// Plugins
import { GLTFExtensionsPlugin } from '../src/plugins/GLTFExtensionsPlugin.js';
import { ReorientationPlugin } from '../src/plugins/ReorientationPlugin.js';
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader.js';

// R3F, DREI and LEVA imports
Expand Down
18 changes: 18 additions & 0 deletions src/plugins/three/GLTFExtensionsPlugin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader';
import { KTX2Loader } from 'three/examples/jsm/loaders/KTX2Loader';
import { GLTFLoaderPlugin, GLTFParser } from 'three/examples/jsm/loaders/GLTFLoader';

export class GLTFExtensionsPlugin {

constructor( options: {
metadata: Boolean,
rtc: Boolean,

plugins: Array<( parser: GLTFParser ) => GLTFLoaderPlugin>,

dracoLoader: DRACOLoader | null,
ktxLoader: KTX2Loader | null,
autoDispose: Boolean,
} );

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';
import { GLTFStructuralMetadataExtension, GLTFMeshFeaturesExtension, GLTFCesiumRTCExtension } from '3d-tiles-renderer/plugins';
import { GLTFStructuralMetadataExtension } from './gltf/GLTFStructuralMetadataExtension.js';
import { GLTFMeshFeaturesExtension } from './gltf/GLTFMeshFeaturesExtension.js';
import { GLTFCesiumRTCExtension } from './gltf/GLTFCesiumRTCExtension.js';

export class GLTFExtensionsPlugin {

Expand Down
12 changes: 12 additions & 0 deletions src/plugins/three/ReorientationPlugin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export class GLTFExtensionsPlugin {

constructor( options: {
up: '+x' | '-x' | '+y' | '-y' | '+z' | '-z',
recenter: Boolean,

lat: Number | null,
lon: Number | null,
height: Number,
} );

}
File renamed without changes.

0 comments on commit 9254c8a

Please sign in to comment.