|
@@ -1202,8 +1202,9 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
|
|
|
import { TransformNode } from "babylonjs/Meshes/transformNode";
|
|
|
import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
|
|
|
import { Mesh } from "babylonjs/Meshes/mesh";
|
|
|
+ import { AbstractMesh } from "babylonjs/Meshes/abstractMesh";
|
|
|
import { IDisposable } from "babylonjs/scene";
|
|
|
- import { IScene, INode, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
|
+ import { IScene, INode, IMesh, ISkin, ICamera, IMeshPrimitive, IMaterial, ITextureInfo, IAnimation } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
|
import { IGLTFLoaderExtension as IGLTFBaseLoaderExtension } from "babylonjs-loaders/glTF/glTFFileLoader";
|
|
|
import { IProperty } from 'babylonjs-gltf2interface';
|
|
|
/**
|
|
@@ -1249,6 +1250,17 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
|
|
|
*/
|
|
|
_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.
|
|
|
+ * @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
|
|
|
+ * @param mesh The glTF mesh when loading the asset
|
|
|
+ * @param primitive The glTF mesh primitive property
|
|
|
+ * @param assign A function called synchronously after parsing the glTF properties
|
|
|
+ * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled
|
|
|
+ */
|
|
|
+ _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.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param material The glTF material property
|
|
@@ -1288,7 +1300,7 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
|
|
|
*/
|
|
|
loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
|
|
|
/**
|
|
|
- * 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
|
|
@@ -1296,7 +1308,7 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
|
|
|
*/
|
|
|
_loadSkinAsync?(context: string, node: INode, skin: ISkin): Nullable<Promise<void>>;
|
|
|
/**
|
|
|
- * 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
|
|
@@ -1307,6 +1319,7 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoaderExtension" {
|
|
|
}
|
|
|
declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
|
|
|
import { Nullable } from "babylonjs/types";
|
|
|
+ import { IAnimatable } from "babylonjs/Misc/tools";
|
|
|
import { Camera } from "babylonjs/Cameras/camera";
|
|
|
import { AnimationGroup } from "babylonjs/Animations/animationGroup";
|
|
|
import { Skeleton } from "babylonjs/Bones/skeleton";
|
|
@@ -1319,7 +1332,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, ICamera, IAnimation, IBufferView, IMaterial, ITextureInfo, IImage, IArrayItem as IArrItem } from "babylonjs-loaders/glTF/2.0/glTFLoaderInterfaces";
|
|
|
+ import { IGLTF, INode, IScene, IMesh, ICamera, IAnimation, IAnimationChannel, IBufferView, IMaterial, ITextureInfo, 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 } from "babylonjs-loaders/glTF/glTFFileLoader";
|
|
|
/**
|
|
@@ -1431,7 +1444,17 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
|
|
|
*/
|
|
|
loadNodeAsync(context: string, node: INode, assign?: (babylonTransformNode: TransformNode) => void): Promise<TransformNode>;
|
|
|
private _loadMeshAsync;
|
|
|
- private _loadMeshPrimitiveAsync;
|
|
|
+ /**
|
|
|
+ * @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
|
|
|
+ * @param mesh The glTF mesh when loading the asset
|
|
|
+ * @param primitive The glTF mesh primitive property
|
|
|
+ * @param assign A function called synchronously after parsing the glTF properties
|
|
|
+ * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled
|
|
|
+ */
|
|
|
+ _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Promise<AbstractMesh>;
|
|
|
private _loadVertexDataAsync;
|
|
|
private _createMorphTargets;
|
|
|
private _loadMorphTargetsAsync;
|
|
@@ -1459,7 +1482,17 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
|
|
|
* @returns A promise that resolves with the loaded Babylon animation group when the load is complete
|
|
|
*/
|
|
|
loadAnimationAsync(context: string, animation: IAnimation): Promise<AnimationGroup>;
|
|
|
- private _loadAnimationChannelAsync;
|
|
|
+ /**
|
|
|
+ * @hidden Loads a glTF animation channel.
|
|
|
+ * @param context The context when loading the asset
|
|
|
+ * @param animationContext The context of the animation when loading the asset
|
|
|
+ * @param animation The glTF animation property
|
|
|
+ * @param channel The glTF animation channel property
|
|
|
+ * @param babylonAnimationGroup The babylon animation group property
|
|
|
+ * @param animationTargetOverride The babylon animation channel target override property. My be null.
|
|
|
+ * @returns A void promise when the channel load is complete
|
|
|
+ */
|
|
|
+ _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, babylonAnimationGroup: AnimationGroup, animationTargetOverride?: Nullable<IAnimatable>): Promise<void>;
|
|
|
private _loadAnimationSamplerAsync;
|
|
|
private _loadBufferAsync;
|
|
|
/**
|
|
@@ -1559,6 +1592,7 @@ declare module "babylonjs-loaders/glTF/2.0/glTFLoader" {
|
|
|
private _extensionsLoadNodeAsync;
|
|
|
private _extensionsLoadCameraAsync;
|
|
|
private _extensionsLoadVertexDataAsync;
|
|
|
+ private _extensionsLoadMeshPrimitiveAsync;
|
|
|
private _extensionsLoadMaterialAsync;
|
|
|
private _extensionsCreateMaterial;
|
|
|
private _extensionsLoadMaterialPropertiesAsync;
|
|
@@ -1650,12 +1684,11 @@ declare module "babylonjs-loaders/glTF/2.0/Extensions/KHR_draco_mesh_compression
|
|
|
export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
|
|
|
/** The name of this extension. */
|
|
|
readonly name: string;
|
|
|
- /** The draco compression used to decode vertex data. */
|
|
|
+ /** The draco compression used to decode vertex data or DracoCompression.Default if not defined */
|
|
|
dracoCompression?: DracoCompression;
|
|
|
/** Defines whether this extension is enabled. */
|
|
|
enabled: boolean;
|
|
|
private _loader;
|
|
|
- private _dracoCompressionOwned;
|
|
|
/** @hidden */
|
|
|
constructor(loader: GLTFLoader);
|
|
|
/** @hidden */
|
|
@@ -1914,6 +1947,7 @@ declare module "babylonjs-loaders/glTF/index" {
|
|
|
export { GLTF1, GLTF2 };
|
|
|
}
|
|
|
declare module "babylonjs-loaders/OBJ/objFileLoader" {
|
|
|
+ import { Vector2 } from "babylonjs/Maths/math";
|
|
|
import { AnimationGroup } from "babylonjs/Animations/animationGroup";
|
|
|
import { Skeleton } from "babylonjs/Bones/skeleton";
|
|
|
import { IParticleSystem } from "babylonjs/Particles/IParticleSystem";
|
|
@@ -1962,10 +1996,18 @@ declare module "babylonjs-loaders/OBJ/objFileLoader" {
|
|
|
*/
|
|
|
OptimizeWithUV: boolean;
|
|
|
/**
|
|
|
+ * Defines custom scaling of UV coordinates of loaded meshes.
|
|
|
+ */
|
|
|
+ UVScaling: Vector2;
|
|
|
+ /**
|
|
|
* Invert model on y-axis (does a model scaling inversion)
|
|
|
*/
|
|
|
InvertY: boolean;
|
|
|
/**
|
|
|
+ * Invert Y-Axis of referenced textures on load
|
|
|
+ */
|
|
|
+ InvertTextureY: boolean;
|
|
|
+ /**
|
|
|
* Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.
|
|
|
*/
|
|
|
ImportVertexColors: boolean;
|
|
@@ -1996,6 +2038,10 @@ declare module "babylonjs-loaders/OBJ/objFileLoader" {
|
|
|
*/
|
|
|
static INVERT_Y: boolean;
|
|
|
/**
|
|
|
+ * Invert Y-Axis of referenced textures on load
|
|
|
+ */
|
|
|
+ static INVERT_TEXTURE_Y: boolean;
|
|
|
+ /**
|
|
|
* Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.
|
|
|
*/
|
|
|
static IMPORT_VERTEX_COLORS: boolean;
|
|
@@ -2004,6 +2050,10 @@ declare module "babylonjs-loaders/OBJ/objFileLoader" {
|
|
|
*/
|
|
|
static COMPUTE_NORMALS: boolean;
|
|
|
/**
|
|
|
+ * Defines custom scaling of UV coordinates of loaded meshes.
|
|
|
+ */
|
|
|
+ static UV_SCALING: Vector2;
|
|
|
+ /**
|
|
|
* Skip loading the materials even if defined in the OBJ file (materials are ignored).
|
|
|
*/
|
|
|
static SKIP_MATERIALS: boolean;
|
|
@@ -3431,6 +3481,17 @@ declare module BABYLON.GLTF2 {
|
|
|
*/
|
|
|
_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.
|
|
|
+ * @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
|
|
|
+ * @param mesh The glTF mesh when loading the asset
|
|
|
+ * @param primitive The glTF mesh primitive property
|
|
|
+ * @param assign A function called synchronously after parsing the glTF properties
|
|
|
+ * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled
|
|
|
+ */
|
|
|
+ _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.
|
|
|
* @param context The context when loading the asset
|
|
|
* @param material The glTF material property
|
|
@@ -3470,7 +3531,7 @@ declare module BABYLON.GLTF2 {
|
|
|
*/
|
|
|
loadAnimationAsync?(context: string, animation: IAnimation): Nullable<Promise<AnimationGroup>>;
|
|
|
/**
|
|
|
- * 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
|
|
@@ -3478,7 +3539,7 @@ declare module BABYLON.GLTF2 {
|
|
|
*/
|
|
|
_loadSkinAsync?(context: string, node: INode, skin: ISkin): Nullable<Promise<void>>;
|
|
|
/**
|
|
|
- * 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
|
|
@@ -3597,7 +3658,17 @@ declare module BABYLON.GLTF2 {
|
|
|
*/
|
|
|
loadNodeAsync(context: string, node: INode, assign?: (babylonTransformNode: TransformNode) => void): Promise<TransformNode>;
|
|
|
private _loadMeshAsync;
|
|
|
- private _loadMeshPrimitiveAsync;
|
|
|
+ /**
|
|
|
+ * @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
|
|
|
+ * @param mesh The glTF mesh when loading the asset
|
|
|
+ * @param primitive The glTF mesh primitive property
|
|
|
+ * @param assign A function called synchronously after parsing the glTF properties
|
|
|
+ * @returns A promise that resolves with the loaded mesh when the load is complete or null if not handled
|
|
|
+ */
|
|
|
+ _loadMeshPrimitiveAsync(context: string, name: string, node: INode, mesh: IMesh, primitive: IMeshPrimitive, assign: (babylonMesh: AbstractMesh) => void): Promise<AbstractMesh>;
|
|
|
private _loadVertexDataAsync;
|
|
|
private _createMorphTargets;
|
|
|
private _loadMorphTargetsAsync;
|
|
@@ -3625,7 +3696,17 @@ declare module BABYLON.GLTF2 {
|
|
|
* @returns A promise that resolves with the loaded Babylon animation group when the load is complete
|
|
|
*/
|
|
|
loadAnimationAsync(context: string, animation: IAnimation): Promise<AnimationGroup>;
|
|
|
- private _loadAnimationChannelAsync;
|
|
|
+ /**
|
|
|
+ * @hidden Loads a glTF animation channel.
|
|
|
+ * @param context The context when loading the asset
|
|
|
+ * @param animationContext The context of the animation when loading the asset
|
|
|
+ * @param animation The glTF animation property
|
|
|
+ * @param channel The glTF animation channel property
|
|
|
+ * @param babylonAnimationGroup The babylon animation group property
|
|
|
+ * @param animationTargetOverride The babylon animation channel target override property. My be null.
|
|
|
+ * @returns A void promise when the channel load is complete
|
|
|
+ */
|
|
|
+ _loadAnimationChannelAsync(context: string, animationContext: string, animation: IAnimation, channel: IAnimationChannel, babylonAnimationGroup: AnimationGroup, animationTargetOverride?: Nullable<IAnimatable>): Promise<void>;
|
|
|
private _loadAnimationSamplerAsync;
|
|
|
private _loadBufferAsync;
|
|
|
/**
|
|
@@ -3725,6 +3806,7 @@ declare module BABYLON.GLTF2 {
|
|
|
private _extensionsLoadNodeAsync;
|
|
|
private _extensionsLoadCameraAsync;
|
|
|
private _extensionsLoadVertexDataAsync;
|
|
|
+ private _extensionsLoadMeshPrimitiveAsync;
|
|
|
private _extensionsLoadMaterialAsync;
|
|
|
private _extensionsCreateMaterial;
|
|
|
private _extensionsLoadMaterialPropertiesAsync;
|
|
@@ -3805,12 +3887,11 @@ declare module BABYLON.GLTF2.Loader.Extensions {
|
|
|
export class KHR_draco_mesh_compression implements IGLTFLoaderExtension {
|
|
|
/** The name of this extension. */
|
|
|
readonly name: string;
|
|
|
- /** The draco compression used to decode vertex data. */
|
|
|
+ /** The draco compression used to decode vertex data or DracoCompression.Default if not defined */
|
|
|
dracoCompression?: DracoCompression;
|
|
|
/** Defines whether this extension is enabled. */
|
|
|
enabled: boolean;
|
|
|
private _loader;
|
|
|
- private _dracoCompressionOwned;
|
|
|
/** @hidden */
|
|
|
constructor(loader: GLTFLoader);
|
|
|
/** @hidden */
|
|
@@ -4040,10 +4121,18 @@ declare module BABYLON {
|
|
|
*/
|
|
|
OptimizeWithUV: boolean;
|
|
|
/**
|
|
|
+ * Defines custom scaling of UV coordinates of loaded meshes.
|
|
|
+ */
|
|
|
+ UVScaling: Vector2;
|
|
|
+ /**
|
|
|
* Invert model on y-axis (does a model scaling inversion)
|
|
|
*/
|
|
|
InvertY: boolean;
|
|
|
/**
|
|
|
+ * Invert Y-Axis of referenced textures on load
|
|
|
+ */
|
|
|
+ InvertTextureY: boolean;
|
|
|
+ /**
|
|
|
* Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.
|
|
|
*/
|
|
|
ImportVertexColors: boolean;
|
|
@@ -4074,6 +4163,10 @@ declare module BABYLON {
|
|
|
*/
|
|
|
static INVERT_Y: boolean;
|
|
|
/**
|
|
|
+ * Invert Y-Axis of referenced textures on load
|
|
|
+ */
|
|
|
+ static INVERT_TEXTURE_Y: boolean;
|
|
|
+ /**
|
|
|
* Include in meshes the vertex colors available in some OBJ files. This is not part of OBJ standard.
|
|
|
*/
|
|
|
static IMPORT_VERTEX_COLORS: boolean;
|
|
@@ -4082,6 +4175,10 @@ declare module BABYLON {
|
|
|
*/
|
|
|
static COMPUTE_NORMALS: boolean;
|
|
|
/**
|
|
|
+ * Defines custom scaling of UV coordinates of loaded meshes.
|
|
|
+ */
|
|
|
+ static UV_SCALING: Vector2;
|
|
|
+ /**
|
|
|
* Skip loading the materials even if defined in the OBJ file (materials are ignored).
|
|
|
*/
|
|
|
static SKIP_MATERIALS: boolean;
|