|
@@ -183,7 +183,13 @@ class GLTFLoader extends Loader {
|
|
|
|
|
|
} else if ( this.path !== '' ) {
|
|
} else if ( this.path !== '' ) {
|
|
|
|
|
|
- resourcePath = this.path;
|
|
|
|
|
|
+ // If a base path is set, resources will be relative paths from that plus the relative path of the gltf file
|
|
|
|
+ // Example path = 'https://my-cnd-server.com/', url = 'assets/models/model.gltf'
|
|
|
|
+ // resourcePath = 'https://my-cnd-server.com/assets/models/'
|
|
|
|
+ // referenced resource 'model.bin' will be loaded from 'https://my-cnd-server.com/assets/models/model.bin'
|
|
|
|
+ // referenced resource '../textures/texture.png' will be loaded from 'https://my-cnd-server.com/assets/textures/texture.png'
|
|
|
|
+ const relativeUrl = LoaderUtils.extractUrlBase( url );
|
|
|
|
+ resourcePath = LoaderUtils.resolveURL( relativeUrl, this.path );
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|