|
@@ -32,6 +32,9 @@ module BABYLON.GLTF2 {
|
|
/** Override this method to modify the default behavior for loading materials. */
|
|
/** Override this method to modify the default behavior for loading materials. */
|
|
protected _loadMaterialAsync(context: string, material: _ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<void>> { return null; }
|
|
protected _loadMaterialAsync(context: string, material: _ILoaderMaterial, babylonMesh: Mesh, babylonDrawMode: number, assign: (babylonMaterial: Material) => void): Nullable<Promise<void>> { return null; }
|
|
|
|
|
|
|
|
+ /** Override this method to modify the default behavior for loading textures. */
|
|
|
|
+ protected _loadTextureAsync(context: string, textureInfo: ITextureInfo, assign: (texture: Texture) => void): Nullable<Promise<void>> { return null; }
|
|
|
|
+
|
|
/** Override this method to modify the default behavior for loading uris. */
|
|
/** Override this method to modify the default behavior for loading uris. */
|
|
protected _loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>> { return null; }
|
|
protected _loadUriAsync(context: string, uri: string): Nullable<Promise<ArrayBufferView>> { return null; }
|
|
|
|
|
|
@@ -82,6 +85,11 @@ module BABYLON.GLTF2 {
|
|
return loader._applyExtensions(extension => extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign));
|
|
return loader._applyExtensions(extension => extension._loadMaterialAsync(context, material, babylonMesh, babylonDrawMode, assign));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /** Helper method called by the loader to allow extensions to override loading textures. */
|
|
|
|
+ public static _LoadTextureAsync(loader: GLTFLoader, context: string, textureInfo: ITextureInfo, assign: (texture: Texture) => void): Nullable<Promise<void>> {
|
|
|
|
+ return loader._applyExtensions(extension => extension._loadTextureAsync(context, textureInfo, assign));
|
|
|
|
+ }
|
|
|
|
+
|
|
/** Helper method called by the loader to allow extensions to override loading uris. */
|
|
/** Helper method called by the loader to allow extensions to override loading uris. */
|
|
public static _LoadUriAsync(loader: GLTFLoader, context: string, uri: string): Nullable<Promise<ArrayBufferView>> {
|
|
public static _LoadUriAsync(loader: GLTFLoader, context: string, uri: string): Nullable<Promise<ArrayBufferView>> {
|
|
return loader._applyExtensions(extension => extension._loadUriAsync(context, uri));
|
|
return loader._applyExtensions(extension => extension._loadUriAsync(context, uri));
|