13
13
* limitations under the License.
14
14
*/
15
15
16
- import { BackSide , BoxGeometry , CubeCamera , CubeTexture , EquirectangularReflectionMapping , EventDispatcher , HalfFloatType , LinearEncoding , Mesh , NoBlending , NoToneMapping , RGBAFormat , Scene , ShaderMaterial , sRGBEncoding , Texture , TextureLoader , Vector3 , WebGLCubeRenderTarget , WebGLRenderer } from 'three' ;
16
+ import { BackSide , BoxGeometry , CubeCamera , CubeTexture , EquirectangularReflectionMapping , EventDispatcher , HalfFloatType , LinearEncoding , Loader , Mesh , NoBlending , NoToneMapping , RGBAFormat , Scene , ShaderMaterial , sRGBEncoding , Texture , TextureLoader , Vector3 , WebGLCubeRenderTarget , WebGLRenderer } from 'three' ;
17
17
import { RGBELoader } from 'three/examples/jsm/loaders/RGBELoader.js' ;
18
18
19
19
import { deserializeUrl , timePasses } from '../utilities.js' ;
@@ -35,10 +35,11 @@ const HDR_FILE_RE = /\.hdr(\.js)?$/;
35
35
36
36
export default class TextureUtils extends EventDispatcher {
37
37
public lottieLoaderUrl = '' ;
38
+ public withCredentials = false ;
38
39
39
40
private _ldrLoader : TextureLoader | null = null ;
40
41
private _hdrLoader : RGBELoader | null = null ;
41
- private _lottieLoader = null ;
42
+ private _lottieLoader : Loader | null = null ;
42
43
43
44
private generatedEnvironmentMap : Promise < CubeTexture > | null = null ;
44
45
private generatedEnvironmentMapAlt : Promise < CubeTexture > | null = null ;
@@ -56,6 +57,7 @@ export default class TextureUtils extends EventDispatcher {
56
57
if ( this . _ldrLoader == null ) {
57
58
this . _ldrLoader = new TextureLoader ( ) ;
58
59
}
60
+ this . _ldrLoader . withCredentials = this . withCredentials ;
59
61
return this . _ldrLoader ;
60
62
}
61
63
@@ -64,14 +66,16 @@ export default class TextureUtils extends EventDispatcher {
64
66
this . _hdrLoader = new RGBELoader ( ) ;
65
67
this . _hdrLoader . setDataType ( HalfFloatType ) ;
66
68
}
69
+ this . _hdrLoader . withCredentials = this . withCredentials ;
67
70
return this . _hdrLoader ;
68
71
}
69
72
70
73
async getLottieLoader ( ) : Promise < any > {
71
74
if ( this . _lottieLoader == null ) {
72
75
const { LottieLoader} = await import ( this . lottieLoaderUrl ) ;
73
- this . _lottieLoader = new LottieLoader ( ) ;
76
+ this . _lottieLoader = new LottieLoader ( ) as Loader ;
74
77
}
78
+ this . _lottieLoader . withCredentials = this . withCredentials ;
75
79
return this . _lottieLoader ;
76
80
}
77
81
0 commit comments