@@ -3,6 +3,7 @@ import { injectNgtLoader, type NgtLoaderResults, type NgtObjectMap } from 'angul
3
3
import { DRACOLoader , GLTFLoader , MeshoptDecoder , type GLTF } from 'three-stdlib' ;
4
4
5
5
let dracoLoader : DRACOLoader | null = null ;
6
+ let decoderPath = 'https://www.gstatic.com/draco/versioned/decoders/1.5.5/' ;
6
7
7
8
function _extensions ( useDraco : boolean | string , useMeshOpt : boolean , extensions ?: ( loader : GLTFLoader ) => void ) {
8
9
return ( loader : THREE . Loader ) => {
@@ -15,12 +16,9 @@ function _extensions(useDraco: boolean | string, useMeshOpt: boolean, extensions
15
16
dracoLoader = new DRACOLoader ( ) ;
16
17
}
17
18
18
- dracoLoader . setDecoderPath (
19
- typeof useDraco === 'string' ? useDraco : 'https://www.gstatic.com/draco/versioned/decoders/1.5.5/' ,
20
- ) ;
19
+ dracoLoader . setDecoderPath ( typeof useDraco === 'string' ? useDraco : decoderPath ) ;
21
20
( loader as GLTFLoader ) . setDRACOLoader ( dracoLoader ) ;
22
21
}
23
-
24
22
if ( useMeshOpt ) {
25
23
( loader as GLTFLoader ) . setMeshoptDecoder (
26
24
typeof MeshoptDecoder === 'function' ? MeshoptDecoder ( ) : MeshoptDecoder ,
@@ -65,3 +63,6 @@ injectNgtsGLTFLoader['preload'] = <TUrl extends string | string[] | Record<strin
65
63
) => {
66
64
( injectNgtLoader as any ) [ 'preload' ] ( ( ) => GLTFLoader , path , _extensions ( useDraco , useMeshOpt , extensions ) ) ;
67
65
} ;
66
+ injectNgtsGLTFLoader [ 'setDecoderPath' ] = ( path : string ) => {
67
+ decoderPath = path ;
68
+ } ;
0 commit comments