|
@@ -1228,7 +1228,7 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
|
|
|
import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
import { IDisposable } from "babylonjs/scene";
|
|
|
- import { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, IBufferView, IBuffer } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
|
+ import { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation, ITexture, IBufferView, IBuffer } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
|
import { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from "babylonjs-loaders/glTF/glTFFileLoader";
|
|
|
import { IProperty } from 'babylonjs-gltf2interface';
|
|
|
/**
|
|
@@ -1267,14 +1267,16 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
|
|
|
*/
|
|
|
loadCameraAsync?(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
|
|
|
/**
|
|
|
- * @hidden Define this method to modify the default behavior when loading vertex data for mesh primitives.
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading vertex data for mesh primitives.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param primitive The glTF mesh primitive property
|
|
|
* @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled
|
|
|
*/
|
|
|
_loadVertexDataAsync?(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
|
|
|
/**
|
|
|
- * @hidden Define this method to modify the default behavior when loading data for mesh primitives.
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading data for mesh primitives.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param name The mesh name when loading the asset
|
|
|
* @param node The glTF node when loading the asset
|
|
@@ -1285,7 +1287,8 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
|
|
|
*/
|
|
|
_loadMeshPrimitiveAsync?(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Promise<AbstractMesh>;
|
|
|
/**
|
|
|
- * @hidden Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param material The glTF material property
|
|
|
* @param assign A function called synchronously after parsing the glTF properties
|
|
@@ -1317,6 +1320,15 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
|
|
|
*/
|
|
|
loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
|
|
/**
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading textures.
|
|
|
+ * @param context The context when loading the asset
|
|
|
+ * @param texture The glTF texture property
|
|
|
+ * @param assign A function called synchronously after parsing the glTF properties
|
|
|
+ * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
|
|
|
+ */
|
|
|
+ _loadTextureAsync?(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
|
|
+ /**
|
|
|
* Define this method to modify the default behavior when loading animations.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param animation The glTF animation property
|
|
@@ -1324,7 +1336,8 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
|
|
|
*/
|
|
|
loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
|
|
|
/**
|
|
|
- * @hidden Define this method to modify the default behavior when loading skins.
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading skins.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param node The glTF node property
|
|
|
* @param skin The glTF skin property
|
|
@@ -1332,7 +1345,8 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
|
|
|
*/
|
|
|
_loadSkinAsync?(context: string, node: INode, skin: ISkin): Nullable<Promise<void>>;
|
|
|
/**
|
|
|
- * @hidden Define this method to modify the default behavior when loading uris.
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading uris.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param property The glTF property associated with the uri
|
|
|
* @param uri The uri to load
|
|
@@ -1369,7 +1383,7 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
|
|
|
import { SceneLoaderProgressEvent } from "babylonjs/Loading/sceneLoader";
|
|
|
import { Scene } from "babylonjs/scene";
|
|
|
import { IProperty } from "babylonjs-gltf2interface";
|
|
|
- import { IGLTF, INode, IScene, IMesh, ICamera, IAnimation, IAnimationChannel, IBufferView, IMaterial, ITextureInfo, IImage, IMeshPrimitive, IArrayItem as IArrItem } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
|
+ import { IGLTF, ISampler, INode, IScene, IMesh, ICamera, IAnimation, IAnimationChannel, IBufferView, IMaterial, ITextureInfo, ITexture, IImage, IMeshPrimitive, IArrayItem as IArrItem } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
|
import { IGLTFLoaderExtension } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
|
|
|
import { IGLTFLoader, GLTFFileLoader, GLTFLoaderState, IGLTFLoaderData, IImportMeshAsyncOutput } from "babylonjs-loaders/glTF/glTFFileLoader";
|
|
|
import { IAnimatable } from 'babylonjs/Animations/animatable.interface';
|
|
@@ -1417,9 +1431,12 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
|
|
|
private _defaultBabylonMaterialData;
|
|
|
private _progressCallback?;
|
|
|
private _requests;
|
|
|
- private static readonly _DefaultSampler;
|
|
|
private static _RegisteredExtensions;
|
|
|
/**
|
|
|
+ * The default glTF sampler.
|
|
|
+ */
|
|
|
+ static readonly DefaultSampler: ISampler;
|
|
|
+ /**
|
|
|
* Registers a loader extension.
|
|
|
* @param name The name of the loader extension.
|
|
|
* @param factory The factory function that creates the loader extension.
|
|
@@ -1432,7 +1449,7 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
|
|
|
*/
|
|
|
static UnregisterExtension(name: string): boolean;
|
|
|
/**
|
|
|
- * Gets the loader state.
|
|
|
+ * The loader state.
|
|
|
*/
|
|
|
get state(): Nullable<GLTFLoaderState>;
|
|
|
/**
|
|
@@ -1599,7 +1616,10 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
|
|
|
* @returns A promise that resolves with the loaded Babylon texture when the load is complete
|
|
|
*/
|
|
|
loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
|
|
|
- private _loadTextureAsync;
|
|
|
+ /** @hidden */
|
|
|
+ _loadTextureAsync(context: string, texture: ITexture, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
|
|
|
+ /** @hidden */
|
|
|
+ _createTextureAsync(context: string, sampler: ISampler, image: IImage, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
|
|
|
private _loadSampler;
|
|
|
/**
|
|
|
* Loads a glTF image.
|
|
@@ -1647,6 +1667,7 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
|
|
|
private _extensionsCreateMaterial;
|
|
|
private _extensionsLoadMaterialPropertiesAsync;
|
|
|
private _extensionsLoadTextureInfoAsync;
|
|
|
+ private _extensionsLoadTextureAsync;
|
|
|
private _extensionsLoadAnimationAsync;
|
|
|
private _extensionsLoadSkinAsync;
|
|
|
private _extensionsLoadUriAsync;
|
|
@@ -1772,7 +1793,7 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_lights_punctual" {
|
|
|
import { IGLTFLoaderExtension } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
|
|
|
import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader";
|
|
|
/**
|
|
|
- * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md)
|
|
|
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual)
|
|
|
*/
|
|
|
export class KHR_lights implements IGLTFLoaderExtension {
|
|
|
/**
|
|
@@ -1982,6 +2003,30 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_mesh_quantization" {
|
|
|
dispose(): void;
|
|
|
}
|
|
|
}
|
|
|
+declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_texture_basisu" {
|
|
|
+ import { IGLTFLoaderExtension } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
|
|
|
+ import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader";
|
|
|
+ import { ITexture } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
|
+ import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
+ /**
|
|
|
+ * [Proposed Specification](https://github.com/KhronosGroup/glTF/pull/1751)
|
|
|
+ * !!! Experimental Extension Subject to Changes !!!
|
|
|
+ */
|
|
|
+ export class KHR_texture_basisu implements IGLTFLoaderExtension {
|
|
|
+ /** The name of this extension. */
|
|
|
+ readonly name: string;
|
|
|
+ /** Defines whether this extension is enabled. */
|
|
|
+ enabled: boolean;
|
|
|
+ private _loader;
|
|
|
+ /** @hidden */
|
|
|
+ constructor(loader: GLTFLoader);
|
|
|
+ /** @hidden */
|
|
|
+ dispose(): void;
|
|
|
+ /** @hidden */
|
|
|
+ loadTextureAsync(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
|
|
+ }
|
|
|
+}
|
|
|
declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_texture_transform" {
|
|
|
import { Nullable } from "babylonjs/types";
|
|
|
import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
|
|
@@ -1989,7 +2034,7 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_texture_transform" {
|
|
|
import { IGLTFLoaderExtension } from "babylonjs-loaders/glTF/2.0/glTFLoaderExtension";
|
|
|
import { GLTFLoader } from "babylonjs-loaders/glTF/2.0/glTFLoader";
|
|
|
/**
|
|
|
- * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md)
|
|
|
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform)
|
|
|
*/
|
|
|
export class KHR_texture_transform implements IGLTFLoaderExtension {
|
|
|
/**
|
|
@@ -2201,6 +2246,7 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/index" {
|
|
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_sheen";
|
|
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_materials_specular";
|
|
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_mesh_quantization";
|
|
|
+ export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_texture_basisu";
|
|
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/KHR_texture_transform";
|
|
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/MSFT_audio_emitter";
|
|
|
export * from "babylonjs-loaders/glTF/2.0/Extensions/MSFT_lod";
|
|
@@ -3783,14 +3829,16 @@ declare module BABYLON.GLTF2 {
|
|
|
*/
|
|
|
loadCameraAsync?(context: string, camera: ICamera, assign: (babylonCamera: Camera) => void): Nullable<Promise<Camera>>;
|
|
|
/**
|
|
|
- * @hidden Define this method to modify the default behavior when loading vertex data for mesh primitives.
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading vertex data for mesh primitives.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param primitive The glTF mesh primitive property
|
|
|
* @returns A promise that resolves with the loaded geometry when the load is complete or null if not handled
|
|
|
*/
|
|
|
_loadVertexDataAsync?(context: string, primitive: IMeshPrimitive, babylonMesh: Mesh): Nullable<Promise<Geometry>>;
|
|
|
/**
|
|
|
- * @hidden Define this method to modify the default behavior when loading data for mesh primitives.
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading data for mesh primitives.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param name The mesh name when loading the asset
|
|
|
* @param node The glTF node when loading the asset
|
|
@@ -3801,7 +3849,8 @@ declare module BABYLON.GLTF2 {
|
|
|
*/
|
|
|
_loadMeshPrimitiveAsync?(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Promise<AbstractMesh>;
|
|
|
/**
|
|
|
- * @hidden Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading materials. Load material creates the material and then loads material properties.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param material The glTF material property
|
|
|
* @param assign A function called synchronously after parsing the glTF properties
|
|
@@ -3833,6 +3882,15 @@ declare module BABYLON.GLTF2 {
|
|
|
*/
|
|
|
loadTextureInfoAsync?(context: string, textureInfo: ITextureInfo, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
|
|
/**
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading textures.
|
|
|
+ * @param context The context when loading the asset
|
|
|
+ * @param texture The glTF texture property
|
|
|
+ * @param assign A function called synchronously after parsing the glTF properties
|
|
|
+ * @returns A promise that resolves with the loaded Babylon texture when the load is complete or null if not handled
|
|
|
+ */
|
|
|
+ _loadTextureAsync?(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
|
|
+ /**
|
|
|
* Define this method to modify the default behavior when loading animations.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param animation The glTF animation property
|
|
@@ -3840,7 +3898,8 @@ declare module BABYLON.GLTF2 {
|
|
|
*/
|
|
|
loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
|
|
|
/**
|
|
|
- * @hidden Define this method to modify the default behavior when loading skins.
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading skins.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param node The glTF node property
|
|
|
* @param skin The glTF skin property
|
|
@@ -3848,7 +3907,8 @@ declare module BABYLON.GLTF2 {
|
|
|
*/
|
|
|
_loadSkinAsync?(context: string, node: INode, skin: ISkin): Nullable<Promise<void>>;
|
|
|
/**
|
|
|
- * @hidden Define this method to modify the default behavior when loading uris.
|
|
|
+ * @hidden
|
|
|
+ * Define this method to modify the default behavior when loading uris.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param property The glTF property associated with the uri
|
|
|
* @param uri The uri to load
|
|
@@ -3916,9 +3976,12 @@ declare module BABYLON.GLTF2 {
|
|
|
private _defaultBabylonMaterialData;
|
|
|
private _progressCallback?;
|
|
|
private _requests;
|
|
|
- private static readonly _DefaultSampler;
|
|
|
private static _RegisteredExtensions;
|
|
|
/**
|
|
|
+ * The default glTF sampler.
|
|
|
+ */
|
|
|
+ static readonly DefaultSampler: ISampler;
|
|
|
+ /**
|
|
|
* Registers a loader extension.
|
|
|
* @param name The name of the loader extension.
|
|
|
* @param factory The factory function that creates the loader extension.
|
|
@@ -3931,7 +3994,7 @@ declare module BABYLON.GLTF2 {
|
|
|
*/
|
|
|
static UnregisterExtension(name: string): boolean;
|
|
|
/**
|
|
|
- * Gets the loader state.
|
|
|
+ * The loader state.
|
|
|
*/
|
|
|
get state(): Nullable<GLTFLoaderState>;
|
|
|
/**
|
|
@@ -4098,7 +4161,10 @@ declare module BABYLON.GLTF2 {
|
|
|
* @returns A promise that resolves with the loaded Babylon texture when the load is complete
|
|
|
*/
|
|
|
loadTextureInfoAsync(context: string, textureInfo: ITextureInfo, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
|
|
|
- private _loadTextureAsync;
|
|
|
+ /** @hidden */
|
|
|
+ _loadTextureAsync(context: string, texture: ITexture, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
|
|
|
+ /** @hidden */
|
|
|
+ _createTextureAsync(context: string, sampler: ISampler, image: IImage, assign?: (babylonTexture: BaseTexture) => void): Promise<BaseTexture>;
|
|
|
private _loadSampler;
|
|
|
/**
|
|
|
* Loads a glTF image.
|
|
@@ -4146,6 +4212,7 @@ declare module BABYLON.GLTF2 {
|
|
|
private _extensionsCreateMaterial;
|
|
|
private _extensionsLoadMaterialPropertiesAsync;
|
|
|
private _extensionsLoadTextureInfoAsync;
|
|
|
+ private _extensionsLoadTextureAsync;
|
|
|
private _extensionsLoadAnimationAsync;
|
|
|
private _extensionsLoadSkinAsync;
|
|
|
private _extensionsLoadUriAsync;
|
|
@@ -4255,7 +4322,7 @@ declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
}
|
|
|
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
/**
|
|
|
- * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual/README.md)
|
|
|
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_lights_punctual)
|
|
|
*/
|
|
|
export class KHR_lights implements IGLTFLoaderExtension {
|
|
|
/**
|
|
@@ -4440,7 +4507,26 @@ declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
}
|
|
|
declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
/**
|
|
|
- * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform/README.md)
|
|
|
+ * [Proposed Specification](https://github.com/KhronosGroup/glTF/pull/1751)
|
|
|
+ * !!! Experimental Extension Subject to Changes !!!
|
|
|
+ */
|
|
|
+ export class KHR_texture_basisu implements IGLTFLoaderExtension {
|
|
|
+ /** The name of this extension. */
|
|
|
+ readonly name: string;
|
|
|
+ /** Defines whether this extension is enabled. */
|
|
|
+ enabled: boolean;
|
|
|
+ private _loader;
|
|
|
+ /** @hidden */
|
|
|
+ constructor(loader: GLTFLoader);
|
|
|
+ /** @hidden */
|
|
|
+ dispose(): void;
|
|
|
+ /** @hidden */
|
|
|
+ loadTextureAsync(context: string, texture: ITexture, assign: (babylonTexture: BaseTexture) => void): Nullable<Promise<BaseTexture>>;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
+ /**
|
|
|
+ * [Specification](https://github.com/KhronosGroup/glTF/blob/master/extensions/2.0/Khronos/KHR_texture_transform)
|
|
|
*/
|
|
|
export class KHR_texture_transform implements IGLTFLoaderExtension {
|
|
|
/**
|