Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove GLTFExtensionLoader #922

Merged
merged 4 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export { B3DMLoader, B3DMScene } from './three/loaders/B3DMLoader';
export { I3DMLoader, I3DMScene } from './three/loaders/I3DMLoader';
export { PNTSLoader, PNTSScene } from './three/loaders/PNTSLoader';
export { CMPTLoader } from './three/loaders/CMPTLoader';
export { GLTFExtensionLoader } from './three/loaders/GLTFExtensionLoader';
export { Ellipsoid } from './three/math/Ellipsoid';
export { EllipsoidRegion } from './three/math/EllipsoidRegion';
export * as GeoUtils from './three/math/GeoUtils';
Expand Down
1 change: 0 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ export { B3DMLoader } from './three/loaders/B3DMLoader.js';
export { PNTSLoader } from './three/loaders/PNTSLoader.js';
export { I3DMLoader } from './three/loaders/I3DMLoader.js';
export { CMPTLoader } from './three/loaders/CMPTLoader.js';
export { GLTFExtensionLoader } from './three/loaders/GLTFExtensionLoader.js';

export * from './three/math/Ellipsoid.js';
export * from './three/math/EllipsoidRegion.js';
Expand Down
25 changes: 20 additions & 5 deletions src/three/TilesRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { B3DMLoader } from './loaders/B3DMLoader.js';
import { PNTSLoader } from './loaders/PNTSLoader.js';
import { I3DMLoader } from './loaders/I3DMLoader.js';
import { CMPTLoader } from './loaders/CMPTLoader.js';
import { GLTFExtensionLoader } from './loaders/GLTFExtensionLoader.js';
import { TilesGroup } from './TilesGroup.js';
import {
Matrix4,
Expand All @@ -19,6 +18,7 @@ import { TileBoundingVolume } from './math/TileBoundingVolume.js';
import { ExtendedFrustum } from './math/ExtendedFrustum.js';
import { estimateBytesUsed } from './utilities.js';
import { WGS84_ELLIPSOID } from './math/GeoConstants.js';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';

const _mat = new Matrix4();
const _euler = new Euler();
Expand Down Expand Up @@ -643,10 +643,25 @@ export class TilesRenderer extends TilesRendererBase {
case 'gltf':
case 'glb': {

const loader = new GLTFExtensionLoader( manager );
loader.workingPath = workingPath;
loader.fetchOptions = fetchOptions;
promise = loader.parse( buffer ).then( result => {
const loader = manager.getHandler( 'path.gltf' ) || manager.getHandler( 'path.glb' ) || new GLTFLoader( manager );
loader.setWithCredentials( fetchOptions.credentials === 'include' );
loader.setRequestHeader( fetchOptions.headers || {} );
if ( fetchOptions.credentials === 'include' && fetchOptions.mode === 'cors' ) {

loader.setCrossOrigin( 'use-credentials' );

}

// assume any pre-registered loader has paths configured as the user desires, but if we're making
// a new loader, use the working path during parse to support relative uris on other hosts
let resourcePath = loader.resourcePath || loader.path || workingPath;
if ( ! /[\\/]$/.test( resourcePath ) && resourcePath.length ) {

resourcePath += '/';

}

promise = loader.parseAsync( buffer, resourcePath ).then( result => {

// apply the local up-axis correction rotation
// GLTFLoader seems to never set a transformation on the root scene object so
Expand Down
11 changes: 0 additions & 11 deletions src/three/loaders/GLTFExtensionLoader.d.ts

This file was deleted.

65 changes: 0 additions & 65 deletions src/three/loaders/GLTFExtensionLoader.js

This file was deleted.

Loading