|
@@ -2782,6 +2782,11 @@ declare module BABYLON {
|
|
|
importMesh: (meshesNames: any, scene: Scene, data: any, rootUrl: string, meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => boolean;
|
|
|
load: (scene: Scene, data: string, rootUrl: string) => boolean;
|
|
|
}
|
|
|
+ interface ISceneLoaderPluginAsync {
|
|
|
+ extensions: string;
|
|
|
+ importMeshAsync: (meshesNames: any, scene: Scene, data: any, rootUrl: string, onsuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, onerror?: () => void) => void;
|
|
|
+ loadAsync: (scene: Scene, data: string, rootUrl: string, onsuccess: () => void, onerror: () => void) => boolean;
|
|
|
+ }
|
|
|
class SceneLoader {
|
|
|
private static _ForceFullSceneLoadingForIncremental;
|
|
|
private static _ShowLoadingScreen;
|
|
@@ -2795,7 +2800,7 @@ declare module BABYLON {
|
|
|
static loggingLevel: number;
|
|
|
private static _registeredPlugins;
|
|
|
private static _getPluginForFilename(sceneFilename);
|
|
|
- static GetPluginForExtension(extension: string): ISceneLoaderPlugin;
|
|
|
+ static GetPluginForExtension(extension: string): ISceneLoaderPlugin | ISceneLoaderPluginAsync;
|
|
|
static RegisterPlugin(plugin: ISceneLoaderPlugin): void;
|
|
|
static ImportMesh(meshesNames: any, rootUrl: string, sceneFilename: string, scene: Scene, onsuccess?: (meshes: AbstractMesh[], particleSystems: ParticleSystem[], skeletons: Skeleton[]) => void, progressCallBack?: () => void, onerror?: (scene: Scene, e: any) => void): void;
|
|
|
private static _warned;
|
|
@@ -2817,312 +2822,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class EffectFallbacks {
|
|
|
- private _defines;
|
|
|
- private _currentRank;
|
|
|
- private _maxRank;
|
|
|
- private _mesh;
|
|
|
- private _meshRank;
|
|
|
- addFallback(rank: number, define: string): void;
|
|
|
- addCPUSkinningFallback(rank: number, mesh: BABYLON.AbstractMesh): void;
|
|
|
- isMoreFallbacks: boolean;
|
|
|
- reduce(currentDefines: string): string;
|
|
|
- }
|
|
|
- class Effect {
|
|
|
- name: any;
|
|
|
- defines: string;
|
|
|
- onCompiled: (effect: Effect) => void;
|
|
|
- onError: (effect: Effect, errors: string) => void;
|
|
|
- onBind: (effect: Effect) => void;
|
|
|
- private _engine;
|
|
|
- private _uniformsNames;
|
|
|
- private _samplers;
|
|
|
- private _isReady;
|
|
|
- private _compilationError;
|
|
|
- private _attributesNames;
|
|
|
- private _attributes;
|
|
|
- private _uniforms;
|
|
|
- _key: string;
|
|
|
- private _program;
|
|
|
- private _valueCache;
|
|
|
- constructor(baseName: any, attributesNames: string[], uniformsNames: string[], samplers: string[], engine: any, defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void);
|
|
|
- isReady(): boolean;
|
|
|
- getProgram(): WebGLProgram;
|
|
|
- getAttributesNames(): string[];
|
|
|
- getAttributeLocation(index: number): number;
|
|
|
- getAttributeLocationByName(name: string): number;
|
|
|
- getAttributesCount(): number;
|
|
|
- getUniformIndex(uniformName: string): number;
|
|
|
- getUniform(uniformName: string): WebGLUniformLocation;
|
|
|
- getSamplers(): string[];
|
|
|
- getCompilationError(): string;
|
|
|
- _loadVertexShader(vertex: any, callback: (data: any) => void): void;
|
|
|
- _loadFragmentShader(fragment: any, callback: (data: any) => void): void;
|
|
|
- private _dumpShadersName();
|
|
|
- private _processIncludes(sourceCode, callback);
|
|
|
- private _processPrecision(source);
|
|
|
- private _prepareEffect(vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks?);
|
|
|
- isSupported: boolean;
|
|
|
- _bindTexture(channel: string, texture: WebGLTexture): void;
|
|
|
- setTexture(channel: string, texture: BaseTexture): void;
|
|
|
- setTextureFromPostProcess(channel: string, postProcess: PostProcess): void;
|
|
|
- _cacheMatrix(uniformName: any, matrix: any): void;
|
|
|
- _cacheFloat2(uniformName: string, x: number, y: number): void;
|
|
|
- _cacheFloat3(uniformName: string, x: number, y: number, z: number): void;
|
|
|
- _cacheFloat4(uniformName: string, x: number, y: number, z: number, w: number): void;
|
|
|
- setArray(uniformName: string, array: number[]): Effect;
|
|
|
- setArray2(uniformName: string, array: number[]): Effect;
|
|
|
- setArray3(uniformName: string, array: number[]): Effect;
|
|
|
- setArray4(uniformName: string, array: number[]): Effect;
|
|
|
- setMatrices(uniformName: string, matrices: Float32Array): Effect;
|
|
|
- setMatrix(uniformName: string, matrix: Matrix): Effect;
|
|
|
- setMatrix3x3(uniformName: string, matrix: Float32Array): Effect;
|
|
|
- setMatrix2x2(uniformname: string, matrix: Float32Array): Effect;
|
|
|
- setFloat(uniformName: string, value: number): Effect;
|
|
|
- setBool(uniformName: string, bool: boolean): Effect;
|
|
|
- setVector2(uniformName: string, vector2: Vector2): Effect;
|
|
|
- setFloat2(uniformName: string, x: number, y: number): Effect;
|
|
|
- setVector3(uniformName: string, vector3: Vector3): Effect;
|
|
|
- setFloat3(uniformName: string, x: number, y: number, z: number): Effect;
|
|
|
- setVector4(uniformName: string, vector4: Vector4): Effect;
|
|
|
- setFloat4(uniformName: string, x: number, y: number, z: number, w: number): Effect;
|
|
|
- setColor3(uniformName: string, color3: Color3): Effect;
|
|
|
- setColor4(uniformName: string, color3: Color3, alpha: number): Effect;
|
|
|
- static ShadersStore: {};
|
|
|
- static IncludesShadersStore: {};
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class FresnelParameters {
|
|
|
- isEnabled: boolean;
|
|
|
- leftColor: Color3;
|
|
|
- rightColor: Color3;
|
|
|
- bias: number;
|
|
|
- power: number;
|
|
|
- clone(): FresnelParameters;
|
|
|
- serialize(): any;
|
|
|
- static Parse(parsedFresnelParameters: any): FresnelParameters;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class MaterialDefines {
|
|
|
- _keys: string[];
|
|
|
- isEqual(other: MaterialDefines): boolean;
|
|
|
- cloneTo(other: MaterialDefines): void;
|
|
|
- reset(): void;
|
|
|
- toString(): string;
|
|
|
- }
|
|
|
- class Material {
|
|
|
- name: string;
|
|
|
- private static _TriangleFillMode;
|
|
|
- private static _WireFrameFillMode;
|
|
|
- private static _PointFillMode;
|
|
|
- static TriangleFillMode: number;
|
|
|
- static WireFrameFillMode: number;
|
|
|
- static PointFillMode: number;
|
|
|
- private static _ClockWiseSideOrientation;
|
|
|
- private static _CounterClockWiseSideOrientation;
|
|
|
- static ClockWiseSideOrientation: number;
|
|
|
- static CounterClockWiseSideOrientation: number;
|
|
|
- id: string;
|
|
|
- checkReadyOnEveryCall: boolean;
|
|
|
- checkReadyOnlyOnce: boolean;
|
|
|
- state: string;
|
|
|
- alpha: number;
|
|
|
- backFaceCulling: boolean;
|
|
|
- sideOrientation: number;
|
|
|
- onCompiled: (effect: Effect) => void;
|
|
|
- onError: (effect: Effect, errors: string) => void;
|
|
|
- onDispose: () => void;
|
|
|
- onBind: (material: Material, mesh: Mesh) => void;
|
|
|
- getRenderTargetTextures: () => SmartArray<RenderTargetTexture>;
|
|
|
- alphaMode: number;
|
|
|
- disableDepthWrite: boolean;
|
|
|
- fogEnabled: boolean;
|
|
|
- pointSize: number;
|
|
|
- zOffset: number;
|
|
|
- wireframe: boolean;
|
|
|
- pointsCloud: boolean;
|
|
|
- fillMode: number;
|
|
|
- _effect: Effect;
|
|
|
- _wasPreviouslyReady: boolean;
|
|
|
- private _scene;
|
|
|
- private _fillMode;
|
|
|
- private _cachedDepthWriteState;
|
|
|
- constructor(name: string, scene: Scene, doNotAdd?: boolean);
|
|
|
- /**
|
|
|
- * @param {boolean} fullDetails - support for multiple levels of logging within scene loading
|
|
|
- * subclasses should override adding information pertainent to themselves
|
|
|
- */
|
|
|
- toString(fullDetails?: boolean): string;
|
|
|
- isFrozen: boolean;
|
|
|
- freeze(): void;
|
|
|
- unfreeze(): void;
|
|
|
- isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
|
|
|
- getEffect(): Effect;
|
|
|
- getScene(): Scene;
|
|
|
- needAlphaBlending(): boolean;
|
|
|
- needAlphaTesting(): boolean;
|
|
|
- getAlphaTestTexture(): BaseTexture;
|
|
|
- trackCreation(onCompiled: (effect: Effect) => void, onError: (effect: Effect, errors: string) => void): void;
|
|
|
- markDirty(): void;
|
|
|
- _preBind(): void;
|
|
|
- bind(world: Matrix, mesh?: Mesh): void;
|
|
|
- bindOnlyWorldMatrix(world: Matrix): void;
|
|
|
- unbind(): void;
|
|
|
- clone(name: string): Material;
|
|
|
- getBindedMeshes(): AbstractMesh[];
|
|
|
- dispose(forceDisposeEffect?: boolean): void;
|
|
|
- serialize(): any;
|
|
|
- static ParseMultiMaterial(parsedMultiMaterial: any, scene: Scene): MultiMaterial;
|
|
|
- static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): any;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class MaterialHelper {
|
|
|
- static PrepareDefinesForLights(scene: Scene, mesh: AbstractMesh, defines: MaterialDefines): boolean;
|
|
|
- static HandleFallbacksForShadows(defines: MaterialDefines, fallbacks: EffectFallbacks): void;
|
|
|
- static PrepareAttributesForBones(attribs: string[], mesh: AbstractMesh, defines: MaterialDefines, fallbacks: EffectFallbacks): void;
|
|
|
- static PrepareAttributesForInstances(attribs: string[], defines: MaterialDefines): void;
|
|
|
- static BindLightShadow(light: Light, scene: Scene, mesh: AbstractMesh, lightIndex: number, effect: Effect, depthValuesAlreadySet: boolean): boolean;
|
|
|
- static BindLightProperties(light: Light, effect: Effect, lightIndex: number): void;
|
|
|
- static BindLights(scene: Scene, mesh: AbstractMesh, effect: Effect, defines: MaterialDefines): void;
|
|
|
- static BindFogParameters(scene: Scene, mesh: AbstractMesh, effect: Effect): void;
|
|
|
- static BindBonesParameters(mesh: AbstractMesh, effect: Effect): void;
|
|
|
- static BindLogDepth(defines: MaterialDefines, effect: Effect, scene: Scene): void;
|
|
|
- static BindClipPlane(effect: Effect, scene: Scene): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class MultiMaterial extends Material {
|
|
|
- subMaterials: Material[];
|
|
|
- constructor(name: string, scene: Scene);
|
|
|
- getSubMaterial(index: any): Material;
|
|
|
- isReady(mesh?: AbstractMesh): boolean;
|
|
|
- clone(name: string, cloneChildren?: boolean): MultiMaterial;
|
|
|
- serialize(): any;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class ShaderMaterial extends Material {
|
|
|
- private _shaderPath;
|
|
|
- private _options;
|
|
|
- private _textures;
|
|
|
- private _floats;
|
|
|
- private _floatsArrays;
|
|
|
- private _colors3;
|
|
|
- private _colors4;
|
|
|
- private _vectors2;
|
|
|
- private _vectors3;
|
|
|
- private _vectors4;
|
|
|
- private _matrices;
|
|
|
- private _matrices3x3;
|
|
|
- private _matrices2x2;
|
|
|
- private _cachedWorldViewMatrix;
|
|
|
- private _renderId;
|
|
|
- constructor(name: string, scene: Scene, shaderPath: any, options: any);
|
|
|
- needAlphaBlending(): boolean;
|
|
|
- needAlphaTesting(): boolean;
|
|
|
- private _checkUniform(uniformName);
|
|
|
- setTexture(name: string, texture: Texture): ShaderMaterial;
|
|
|
- setFloat(name: string, value: number): ShaderMaterial;
|
|
|
- setFloats(name: string, value: number[]): ShaderMaterial;
|
|
|
- setColor3(name: string, value: Color3): ShaderMaterial;
|
|
|
- setColor4(name: string, value: Color4): ShaderMaterial;
|
|
|
- setVector2(name: string, value: Vector2): ShaderMaterial;
|
|
|
- setVector3(name: string, value: Vector3): ShaderMaterial;
|
|
|
- setVector4(name: string, value: Vector4): ShaderMaterial;
|
|
|
- setMatrix(name: string, value: Matrix): ShaderMaterial;
|
|
|
- setMatrix3x3(name: string, value: Float32Array): ShaderMaterial;
|
|
|
- setMatrix2x2(name: string, value: Float32Array): ShaderMaterial;
|
|
|
- isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
|
|
|
- bindOnlyWorldMatrix(world: Matrix): void;
|
|
|
- bind(world: Matrix, mesh?: Mesh): void;
|
|
|
- clone(name: string): ShaderMaterial;
|
|
|
- dispose(forceDisposeEffect?: boolean): void;
|
|
|
- serialize(): any;
|
|
|
- static Parse(source: any, scene: Scene, rootUrl: string): ShaderMaterial;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class StandardMaterial extends Material {
|
|
|
- diffuseTexture: BaseTexture;
|
|
|
- ambientTexture: BaseTexture;
|
|
|
- opacityTexture: BaseTexture;
|
|
|
- reflectionTexture: BaseTexture;
|
|
|
- emissiveTexture: BaseTexture;
|
|
|
- specularTexture: BaseTexture;
|
|
|
- bumpTexture: BaseTexture;
|
|
|
- lightmapTexture: BaseTexture;
|
|
|
- refractionTexture: BaseTexture;
|
|
|
- ambientColor: Color3;
|
|
|
- diffuseColor: Color3;
|
|
|
- specularColor: Color3;
|
|
|
- emissiveColor: Color3;
|
|
|
- specularPower: number;
|
|
|
- useAlphaFromDiffuseTexture: boolean;
|
|
|
- useEmissiveAsIllumination: boolean;
|
|
|
- linkEmissiveWithDiffuse: boolean;
|
|
|
- useReflectionFresnelFromSpecular: boolean;
|
|
|
- useSpecularOverAlpha: boolean;
|
|
|
- useReflectionOverAlpha: boolean;
|
|
|
- disableLighting: boolean;
|
|
|
- useParallax: boolean;
|
|
|
- useParallaxOcclusion: boolean;
|
|
|
- parallaxScaleBias: number;
|
|
|
- roughness: number;
|
|
|
- indexOfRefraction: number;
|
|
|
- invertRefractionY: boolean;
|
|
|
- useLightmapAsShadowmap: boolean;
|
|
|
- diffuseFresnelParameters: FresnelParameters;
|
|
|
- opacityFresnelParameters: FresnelParameters;
|
|
|
- reflectionFresnelParameters: FresnelParameters;
|
|
|
- refractionFresnelParameters: FresnelParameters;
|
|
|
- emissiveFresnelParameters: FresnelParameters;
|
|
|
- useGlossinessFromSpecularMapAlpha: boolean;
|
|
|
- private _renderTargets;
|
|
|
- private _worldViewProjectionMatrix;
|
|
|
- private _globalAmbientColor;
|
|
|
- private _renderId;
|
|
|
- private _defines;
|
|
|
- private _cachedDefines;
|
|
|
- private _useLogarithmicDepth;
|
|
|
- constructor(name: string, scene: Scene);
|
|
|
- useLogarithmicDepth: boolean;
|
|
|
- needAlphaBlending(): boolean;
|
|
|
- needAlphaTesting(): boolean;
|
|
|
- private _shouldUseAlphaFromDiffuseTexture();
|
|
|
- getAlphaTestTexture(): BaseTexture;
|
|
|
- private _checkCache(scene, mesh?, useInstances?);
|
|
|
- isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
|
|
|
- unbind(): void;
|
|
|
- bindOnlyWorldMatrix(world: Matrix): void;
|
|
|
- bind(world: Matrix, mesh?: Mesh): void;
|
|
|
- getAnimatables(): IAnimatable[];
|
|
|
- dispose(forceDisposeEffect?: boolean): void;
|
|
|
- clone(name: string): StandardMaterial;
|
|
|
- serialize(): any;
|
|
|
- static Parse(source: any, scene: Scene, rootUrl: string): StandardMaterial;
|
|
|
- static DiffuseTextureEnabled: boolean;
|
|
|
- static AmbientTextureEnabled: boolean;
|
|
|
- static OpacityTextureEnabled: boolean;
|
|
|
- static ReflectionTextureEnabled: boolean;
|
|
|
- static EmissiveTextureEnabled: boolean;
|
|
|
- static SpecularTextureEnabled: boolean;
|
|
|
- static BumpTextureEnabled: boolean;
|
|
|
- static FresnelEnabled: boolean;
|
|
|
- static LightmapTextureEnabled: boolean;
|
|
|
- static RefractionTextureEnabled: boolean;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class SIMDVector3 {
|
|
|
static TransformCoordinatesToRefSIMD(vector: Vector3, transformation: Matrix, result: Vector3): void;
|
|
|
static TransformCoordinatesFromFloatsToRefSIMD(x: number, y: number, z: number, transformation: Matrix, result: Vector3): void;
|
|
@@ -3685,39 +3384,345 @@ declare module BABYLON {
|
|
|
addLight(direction: Vector3, color: Color3, deltaSolidAngle: number): void;
|
|
|
scale(scale: number): void;
|
|
|
}
|
|
|
- class SphericalPolynomial {
|
|
|
- x: Vector3;
|
|
|
- y: Vector3;
|
|
|
- z: Vector3;
|
|
|
- xx: Vector3;
|
|
|
- yy: Vector3;
|
|
|
- zz: Vector3;
|
|
|
- xy: Vector3;
|
|
|
- yz: Vector3;
|
|
|
- zx: Vector3;
|
|
|
- addAmbient(color: Color3): void;
|
|
|
- static getSphericalPolynomialFromHarmonics(harmonics: SphericalHarmonics): SphericalPolynomial;
|
|
|
+ class SphericalPolynomial {
|
|
|
+ x: Vector3;
|
|
|
+ y: Vector3;
|
|
|
+ z: Vector3;
|
|
|
+ xx: Vector3;
|
|
|
+ yy: Vector3;
|
|
|
+ zz: Vector3;
|
|
|
+ xy: Vector3;
|
|
|
+ yz: Vector3;
|
|
|
+ zx: Vector3;
|
|
|
+ addAmbient(color: Color3): void;
|
|
|
+ static getSphericalPolynomialFromHarmonics(harmonics: SphericalHarmonics): SphericalPolynomial;
|
|
|
+ }
|
|
|
+ class PositionNormalVertex {
|
|
|
+ position: Vector3;
|
|
|
+ normal: Vector3;
|
|
|
+ constructor(position?: Vector3, normal?: Vector3);
|
|
|
+ clone(): PositionNormalVertex;
|
|
|
+ }
|
|
|
+ class PositionNormalTextureVertex {
|
|
|
+ position: Vector3;
|
|
|
+ normal: Vector3;
|
|
|
+ uv: Vector2;
|
|
|
+ constructor(position?: Vector3, normal?: Vector3, uv?: Vector2);
|
|
|
+ clone(): PositionNormalTextureVertex;
|
|
|
+ }
|
|
|
+ class Tmp {
|
|
|
+ static Color3: Color3[];
|
|
|
+ static Vector2: Vector2[];
|
|
|
+ static Vector3: Vector3[];
|
|
|
+ static Vector4: Vector4[];
|
|
|
+ static Quaternion: Quaternion[];
|
|
|
+ static Matrix: Matrix[];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class EffectFallbacks {
|
|
|
+ private _defines;
|
|
|
+ private _currentRank;
|
|
|
+ private _maxRank;
|
|
|
+ private _mesh;
|
|
|
+ private _meshRank;
|
|
|
+ addFallback(rank: number, define: string): void;
|
|
|
+ addCPUSkinningFallback(rank: number, mesh: BABYLON.AbstractMesh): void;
|
|
|
+ isMoreFallbacks: boolean;
|
|
|
+ reduce(currentDefines: string): string;
|
|
|
+ }
|
|
|
+ class Effect {
|
|
|
+ name: any;
|
|
|
+ defines: string;
|
|
|
+ onCompiled: (effect: Effect) => void;
|
|
|
+ onError: (effect: Effect, errors: string) => void;
|
|
|
+ onBind: (effect: Effect) => void;
|
|
|
+ private _engine;
|
|
|
+ private _uniformsNames;
|
|
|
+ private _samplers;
|
|
|
+ private _isReady;
|
|
|
+ private _compilationError;
|
|
|
+ private _attributesNames;
|
|
|
+ private _attributes;
|
|
|
+ private _uniforms;
|
|
|
+ _key: string;
|
|
|
+ private _program;
|
|
|
+ private _valueCache;
|
|
|
+ constructor(baseName: any, attributesNames: string[], uniformsNames: string[], samplers: string[], engine: any, defines?: string, fallbacks?: EffectFallbacks, onCompiled?: (effect: Effect) => void, onError?: (effect: Effect, errors: string) => void);
|
|
|
+ isReady(): boolean;
|
|
|
+ getProgram(): WebGLProgram;
|
|
|
+ getAttributesNames(): string[];
|
|
|
+ getAttributeLocation(index: number): number;
|
|
|
+ getAttributeLocationByName(name: string): number;
|
|
|
+ getAttributesCount(): number;
|
|
|
+ getUniformIndex(uniformName: string): number;
|
|
|
+ getUniform(uniformName: string): WebGLUniformLocation;
|
|
|
+ getSamplers(): string[];
|
|
|
+ getCompilationError(): string;
|
|
|
+ _loadVertexShader(vertex: any, callback: (data: any) => void): void;
|
|
|
+ _loadFragmentShader(fragment: any, callback: (data: any) => void): void;
|
|
|
+ private _dumpShadersName();
|
|
|
+ private _processIncludes(sourceCode, callback);
|
|
|
+ private _processPrecision(source);
|
|
|
+ private _prepareEffect(vertexSourceCode, fragmentSourceCode, attributesNames, defines, fallbacks?);
|
|
|
+ isSupported: boolean;
|
|
|
+ _bindTexture(channel: string, texture: WebGLTexture): void;
|
|
|
+ setTexture(channel: string, texture: BaseTexture): void;
|
|
|
+ setTextureFromPostProcess(channel: string, postProcess: PostProcess): void;
|
|
|
+ _cacheMatrix(uniformName: any, matrix: any): void;
|
|
|
+ _cacheFloat2(uniformName: string, x: number, y: number): void;
|
|
|
+ _cacheFloat3(uniformName: string, x: number, y: number, z: number): void;
|
|
|
+ _cacheFloat4(uniformName: string, x: number, y: number, z: number, w: number): void;
|
|
|
+ setArray(uniformName: string, array: number[]): Effect;
|
|
|
+ setArray2(uniformName: string, array: number[]): Effect;
|
|
|
+ setArray3(uniformName: string, array: number[]): Effect;
|
|
|
+ setArray4(uniformName: string, array: number[]): Effect;
|
|
|
+ setMatrices(uniformName: string, matrices: Float32Array): Effect;
|
|
|
+ setMatrix(uniformName: string, matrix: Matrix): Effect;
|
|
|
+ setMatrix3x3(uniformName: string, matrix: Float32Array): Effect;
|
|
|
+ setMatrix2x2(uniformname: string, matrix: Float32Array): Effect;
|
|
|
+ setFloat(uniformName: string, value: number): Effect;
|
|
|
+ setBool(uniformName: string, bool: boolean): Effect;
|
|
|
+ setVector2(uniformName: string, vector2: Vector2): Effect;
|
|
|
+ setFloat2(uniformName: string, x: number, y: number): Effect;
|
|
|
+ setVector3(uniformName: string, vector3: Vector3): Effect;
|
|
|
+ setFloat3(uniformName: string, x: number, y: number, z: number): Effect;
|
|
|
+ setVector4(uniformName: string, vector4: Vector4): Effect;
|
|
|
+ setFloat4(uniformName: string, x: number, y: number, z: number, w: number): Effect;
|
|
|
+ setColor3(uniformName: string, color3: Color3): Effect;
|
|
|
+ setColor4(uniformName: string, color3: Color3, alpha: number): Effect;
|
|
|
+ static ShadersStore: {};
|
|
|
+ static IncludesShadersStore: {};
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class FresnelParameters {
|
|
|
+ isEnabled: boolean;
|
|
|
+ leftColor: Color3;
|
|
|
+ rightColor: Color3;
|
|
|
+ bias: number;
|
|
|
+ power: number;
|
|
|
+ clone(): FresnelParameters;
|
|
|
+ serialize(): any;
|
|
|
+ static Parse(parsedFresnelParameters: any): FresnelParameters;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class MaterialDefines {
|
|
|
+ _keys: string[];
|
|
|
+ isEqual(other: MaterialDefines): boolean;
|
|
|
+ cloneTo(other: MaterialDefines): void;
|
|
|
+ reset(): void;
|
|
|
+ toString(): string;
|
|
|
+ }
|
|
|
+ class Material {
|
|
|
+ name: string;
|
|
|
+ private static _TriangleFillMode;
|
|
|
+ private static _WireFrameFillMode;
|
|
|
+ private static _PointFillMode;
|
|
|
+ static TriangleFillMode: number;
|
|
|
+ static WireFrameFillMode: number;
|
|
|
+ static PointFillMode: number;
|
|
|
+ private static _ClockWiseSideOrientation;
|
|
|
+ private static _CounterClockWiseSideOrientation;
|
|
|
+ static ClockWiseSideOrientation: number;
|
|
|
+ static CounterClockWiseSideOrientation: number;
|
|
|
+ id: string;
|
|
|
+ checkReadyOnEveryCall: boolean;
|
|
|
+ checkReadyOnlyOnce: boolean;
|
|
|
+ state: string;
|
|
|
+ alpha: number;
|
|
|
+ backFaceCulling: boolean;
|
|
|
+ sideOrientation: number;
|
|
|
+ onCompiled: (effect: Effect) => void;
|
|
|
+ onError: (effect: Effect, errors: string) => void;
|
|
|
+ onDispose: () => void;
|
|
|
+ onBind: (material: Material, mesh: Mesh) => void;
|
|
|
+ getRenderTargetTextures: () => SmartArray<RenderTargetTexture>;
|
|
|
+ alphaMode: number;
|
|
|
+ disableDepthWrite: boolean;
|
|
|
+ fogEnabled: boolean;
|
|
|
+ pointSize: number;
|
|
|
+ zOffset: number;
|
|
|
+ wireframe: boolean;
|
|
|
+ pointsCloud: boolean;
|
|
|
+ fillMode: number;
|
|
|
+ _effect: Effect;
|
|
|
+ _wasPreviouslyReady: boolean;
|
|
|
+ private _scene;
|
|
|
+ private _fillMode;
|
|
|
+ private _cachedDepthWriteState;
|
|
|
+ constructor(name: string, scene: Scene, doNotAdd?: boolean);
|
|
|
+ /**
|
|
|
+ * @param {boolean} fullDetails - support for multiple levels of logging within scene loading
|
|
|
+ * subclasses should override adding information pertainent to themselves
|
|
|
+ */
|
|
|
+ toString(fullDetails?: boolean): string;
|
|
|
+ isFrozen: boolean;
|
|
|
+ freeze(): void;
|
|
|
+ unfreeze(): void;
|
|
|
+ isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
|
|
|
+ getEffect(): Effect;
|
|
|
+ getScene(): Scene;
|
|
|
+ needAlphaBlending(): boolean;
|
|
|
+ needAlphaTesting(): boolean;
|
|
|
+ getAlphaTestTexture(): BaseTexture;
|
|
|
+ trackCreation(onCompiled: (effect: Effect) => void, onError: (effect: Effect, errors: string) => void): void;
|
|
|
+ markDirty(): void;
|
|
|
+ _preBind(): void;
|
|
|
+ bind(world: Matrix, mesh?: Mesh): void;
|
|
|
+ bindOnlyWorldMatrix(world: Matrix): void;
|
|
|
+ unbind(): void;
|
|
|
+ clone(name: string): Material;
|
|
|
+ getBindedMeshes(): AbstractMesh[];
|
|
|
+ dispose(forceDisposeEffect?: boolean): void;
|
|
|
+ serialize(): any;
|
|
|
+ static ParseMultiMaterial(parsedMultiMaterial: any, scene: Scene): MultiMaterial;
|
|
|
+ static Parse(parsedMaterial: any, scene: Scene, rootUrl: string): any;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class MaterialHelper {
|
|
|
+ static PrepareDefinesForLights(scene: Scene, mesh: AbstractMesh, defines: MaterialDefines): boolean;
|
|
|
+ static HandleFallbacksForShadows(defines: MaterialDefines, fallbacks: EffectFallbacks): void;
|
|
|
+ static PrepareAttributesForBones(attribs: string[], mesh: AbstractMesh, defines: MaterialDefines, fallbacks: EffectFallbacks): void;
|
|
|
+ static PrepareAttributesForInstances(attribs: string[], defines: MaterialDefines): void;
|
|
|
+ static BindLightShadow(light: Light, scene: Scene, mesh: AbstractMesh, lightIndex: number, effect: Effect, depthValuesAlreadySet: boolean): boolean;
|
|
|
+ static BindLightProperties(light: Light, effect: Effect, lightIndex: number): void;
|
|
|
+ static BindLights(scene: Scene, mesh: AbstractMesh, effect: Effect, defines: MaterialDefines): void;
|
|
|
+ static BindFogParameters(scene: Scene, mesh: AbstractMesh, effect: Effect): void;
|
|
|
+ static BindBonesParameters(mesh: AbstractMesh, effect: Effect): void;
|
|
|
+ static BindLogDepth(defines: MaterialDefines, effect: Effect, scene: Scene): void;
|
|
|
+ static BindClipPlane(effect: Effect, scene: Scene): void;
|
|
|
}
|
|
|
- class PositionNormalVertex {
|
|
|
- position: Vector3;
|
|
|
- normal: Vector3;
|
|
|
- constructor(position?: Vector3, normal?: Vector3);
|
|
|
- clone(): PositionNormalVertex;
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class MultiMaterial extends Material {
|
|
|
+ subMaterials: Material[];
|
|
|
+ constructor(name: string, scene: Scene);
|
|
|
+ getSubMaterial(index: any): Material;
|
|
|
+ isReady(mesh?: AbstractMesh): boolean;
|
|
|
+ clone(name: string, cloneChildren?: boolean): MultiMaterial;
|
|
|
+ serialize(): any;
|
|
|
}
|
|
|
- class PositionNormalTextureVertex {
|
|
|
- position: Vector3;
|
|
|
- normal: Vector3;
|
|
|
- uv: Vector2;
|
|
|
- constructor(position?: Vector3, normal?: Vector3, uv?: Vector2);
|
|
|
- clone(): PositionNormalTextureVertex;
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class ShaderMaterial extends Material {
|
|
|
+ private _shaderPath;
|
|
|
+ private _options;
|
|
|
+ private _textures;
|
|
|
+ private _floats;
|
|
|
+ private _floatsArrays;
|
|
|
+ private _colors3;
|
|
|
+ private _colors4;
|
|
|
+ private _vectors2;
|
|
|
+ private _vectors3;
|
|
|
+ private _vectors4;
|
|
|
+ private _matrices;
|
|
|
+ private _matrices3x3;
|
|
|
+ private _matrices2x2;
|
|
|
+ private _cachedWorldViewMatrix;
|
|
|
+ private _renderId;
|
|
|
+ constructor(name: string, scene: Scene, shaderPath: any, options: any);
|
|
|
+ needAlphaBlending(): boolean;
|
|
|
+ needAlphaTesting(): boolean;
|
|
|
+ private _checkUniform(uniformName);
|
|
|
+ setTexture(name: string, texture: Texture): ShaderMaterial;
|
|
|
+ setFloat(name: string, value: number): ShaderMaterial;
|
|
|
+ setFloats(name: string, value: number[]): ShaderMaterial;
|
|
|
+ setColor3(name: string, value: Color3): ShaderMaterial;
|
|
|
+ setColor4(name: string, value: Color4): ShaderMaterial;
|
|
|
+ setVector2(name: string, value: Vector2): ShaderMaterial;
|
|
|
+ setVector3(name: string, value: Vector3): ShaderMaterial;
|
|
|
+ setVector4(name: string, value: Vector4): ShaderMaterial;
|
|
|
+ setMatrix(name: string, value: Matrix): ShaderMaterial;
|
|
|
+ setMatrix3x3(name: string, value: Float32Array): ShaderMaterial;
|
|
|
+ setMatrix2x2(name: string, value: Float32Array): ShaderMaterial;
|
|
|
+ isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
|
|
|
+ bindOnlyWorldMatrix(world: Matrix): void;
|
|
|
+ bind(world: Matrix, mesh?: Mesh): void;
|
|
|
+ clone(name: string): ShaderMaterial;
|
|
|
+ dispose(forceDisposeEffect?: boolean): void;
|
|
|
+ serialize(): any;
|
|
|
+ static Parse(source: any, scene: Scene, rootUrl: string): ShaderMaterial;
|
|
|
}
|
|
|
- class Tmp {
|
|
|
- static Color3: Color3[];
|
|
|
- static Vector2: Vector2[];
|
|
|
- static Vector3: Vector3[];
|
|
|
- static Vector4: Vector4[];
|
|
|
- static Quaternion: Quaternion[];
|
|
|
- static Matrix: Matrix[];
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class StandardMaterial extends Material {
|
|
|
+ diffuseTexture: BaseTexture;
|
|
|
+ ambientTexture: BaseTexture;
|
|
|
+ opacityTexture: BaseTexture;
|
|
|
+ reflectionTexture: BaseTexture;
|
|
|
+ emissiveTexture: BaseTexture;
|
|
|
+ specularTexture: BaseTexture;
|
|
|
+ bumpTexture: BaseTexture;
|
|
|
+ lightmapTexture: BaseTexture;
|
|
|
+ refractionTexture: BaseTexture;
|
|
|
+ ambientColor: Color3;
|
|
|
+ diffuseColor: Color3;
|
|
|
+ specularColor: Color3;
|
|
|
+ emissiveColor: Color3;
|
|
|
+ specularPower: number;
|
|
|
+ useAlphaFromDiffuseTexture: boolean;
|
|
|
+ useEmissiveAsIllumination: boolean;
|
|
|
+ linkEmissiveWithDiffuse: boolean;
|
|
|
+ useReflectionFresnelFromSpecular: boolean;
|
|
|
+ useSpecularOverAlpha: boolean;
|
|
|
+ useReflectionOverAlpha: boolean;
|
|
|
+ disableLighting: boolean;
|
|
|
+ useParallax: boolean;
|
|
|
+ useParallaxOcclusion: boolean;
|
|
|
+ parallaxScaleBias: number;
|
|
|
+ roughness: number;
|
|
|
+ indexOfRefraction: number;
|
|
|
+ invertRefractionY: boolean;
|
|
|
+ useLightmapAsShadowmap: boolean;
|
|
|
+ diffuseFresnelParameters: FresnelParameters;
|
|
|
+ opacityFresnelParameters: FresnelParameters;
|
|
|
+ reflectionFresnelParameters: FresnelParameters;
|
|
|
+ refractionFresnelParameters: FresnelParameters;
|
|
|
+ emissiveFresnelParameters: FresnelParameters;
|
|
|
+ useGlossinessFromSpecularMapAlpha: boolean;
|
|
|
+ private _renderTargets;
|
|
|
+ private _worldViewProjectionMatrix;
|
|
|
+ private _globalAmbientColor;
|
|
|
+ private _renderId;
|
|
|
+ private _defines;
|
|
|
+ private _cachedDefines;
|
|
|
+ private _useLogarithmicDepth;
|
|
|
+ constructor(name: string, scene: Scene);
|
|
|
+ useLogarithmicDepth: boolean;
|
|
|
+ needAlphaBlending(): boolean;
|
|
|
+ needAlphaTesting(): boolean;
|
|
|
+ private _shouldUseAlphaFromDiffuseTexture();
|
|
|
+ getAlphaTestTexture(): BaseTexture;
|
|
|
+ private _checkCache(scene, mesh?, useInstances?);
|
|
|
+ isReady(mesh?: AbstractMesh, useInstances?: boolean): boolean;
|
|
|
+ unbind(): void;
|
|
|
+ bindOnlyWorldMatrix(world: Matrix): void;
|
|
|
+ bind(world: Matrix, mesh?: Mesh): void;
|
|
|
+ getAnimatables(): IAnimatable[];
|
|
|
+ dispose(forceDisposeEffect?: boolean): void;
|
|
|
+ clone(name: string): StandardMaterial;
|
|
|
+ serialize(): any;
|
|
|
+ static Parse(source: any, scene: Scene, rootUrl: string): StandardMaterial;
|
|
|
+ static DiffuseTextureEnabled: boolean;
|
|
|
+ static AmbientTextureEnabled: boolean;
|
|
|
+ static OpacityTextureEnabled: boolean;
|
|
|
+ static ReflectionTextureEnabled: boolean;
|
|
|
+ static EmissiveTextureEnabled: boolean;
|
|
|
+ static SpecularTextureEnabled: boolean;
|
|
|
+ static BumpTextureEnabled: boolean;
|
|
|
+ static FresnelEnabled: boolean;
|
|
|
+ static LightmapTextureEnabled: boolean;
|
|
|
+ static RefractionTextureEnabled: boolean;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -5504,8 +5509,8 @@ declare module BABYLON {
|
|
|
color: Color4;
|
|
|
position: Vector3;
|
|
|
rotation: Vector3;
|
|
|
- quaternion: Vector4;
|
|
|
- scale: Vector3;
|
|
|
+ rotationQuaternion: Quaternion;
|
|
|
+ scaling: Vector3;
|
|
|
uvs: Vector4;
|
|
|
velocity: Vector3;
|
|
|
alive: boolean;
|
|
@@ -5514,6 +5519,8 @@ declare module BABYLON {
|
|
|
shapeId: number;
|
|
|
idxInShape: number;
|
|
|
constructor(particleIndex: number, positionIndex: number, model: ModelShape, shapeId: number, idxInShape: number);
|
|
|
+ scale: Vector3;
|
|
|
+ quaternion: Quaternion;
|
|
|
}
|
|
|
class ModelShape {
|
|
|
shapeID: number;
|
|
@@ -5857,6 +5864,7 @@ declare module BABYLON {
|
|
|
*/
|
|
|
_step(delta: number): void;
|
|
|
getPhysicsPlugin(): IPhysicsEnginePlugin;
|
|
|
+ getImpostorForPhysicsObject(object: IPhysicsEnabledObject): PhysicsImpostor;
|
|
|
getImpostorWithPhysicsBody(body: any): PhysicsImpostor;
|
|
|
}
|
|
|
interface IPhysicsEnginePlugin {
|
|
@@ -5895,10 +5903,24 @@ declare module BABYLON {
|
|
|
restitution?: number;
|
|
|
nativeOptions?: any;
|
|
|
}
|
|
|
+ interface IPhysicsEnabledObject {
|
|
|
+ position: Vector3;
|
|
|
+ rotationQuaternion: Quaternion;
|
|
|
+ scaling: Vector3;
|
|
|
+ rotation?: Vector3;
|
|
|
+ parent?: any;
|
|
|
+ getBoundingInfo?(): BoundingInfo;
|
|
|
+ computeWorldMatrix?(force: boolean): void;
|
|
|
+ getChildMeshes?(): Array<AbstractMesh>;
|
|
|
+ getVerticesData?(kind: string): Array<number> | Float32Array;
|
|
|
+ getIndices?(): Array<number> | Int32Array;
|
|
|
+ getScene?(): Scene;
|
|
|
+ }
|
|
|
class PhysicsImpostor {
|
|
|
- private _mesh;
|
|
|
+ object: IPhysicsEnabledObject;
|
|
|
type: number;
|
|
|
private _options;
|
|
|
+ static DEFAULT_OBJECT_SIZE: Vector3;
|
|
|
private _physicsEngine;
|
|
|
private _physicsBody;
|
|
|
private _bodyUpdateRequired;
|
|
@@ -5909,8 +5931,9 @@ declare module BABYLON {
|
|
|
private _deltaRotation;
|
|
|
private _deltaRotationConjugated;
|
|
|
private _parent;
|
|
|
+ uniqueId: number;
|
|
|
private _joints;
|
|
|
- constructor(_mesh: AbstractMesh, type: number, _options?: PhysicsImpostorParameters);
|
|
|
+ constructor(object: IPhysicsEnabledObject, type: number, _options?: PhysicsImpostorParameters, scene?: Scene);
|
|
|
/**
|
|
|
* This function will completly initialize this impostor.
|
|
|
* It will create a new body - but only if this mesh has no parent.
|
|
@@ -5929,7 +5952,6 @@ declare module BABYLON {
|
|
|
* Use under cautious - This will remove all joints already implemented.
|
|
|
*/
|
|
|
forceUpdate(): void;
|
|
|
- mesh: AbstractMesh;
|
|
|
/**
|
|
|
* Gets the body that holds this impostor. Either its own, or its parent.
|
|
|
*/
|
|
@@ -5939,6 +5961,8 @@ declare module BABYLON {
|
|
|
physicsBody: any;
|
|
|
parent: PhysicsImpostor;
|
|
|
resetUpdateFlags(): void;
|
|
|
+ getObjectExtendSize(): Vector3;
|
|
|
+ getObjectCenter(): Vector3;
|
|
|
/**
|
|
|
* Get a specific parametes from the options parameter.
|
|
|
*/
|
|
@@ -6018,7 +6042,7 @@ declare module BABYLON {
|
|
|
* Wake the body up.
|
|
|
*/
|
|
|
wakeUp(): void;
|
|
|
- dispose(disposeChildren?: boolean): void;
|
|
|
+ dispose(): void;
|
|
|
setDeltaPosition(position: Vector3): void;
|
|
|
setDeltaRotation(rotation: Quaternion): void;
|
|
|
static NoImpostor: number;
|
|
@@ -6136,6 +6160,27 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class ReflectionProbe {
|
|
|
+ name: string;
|
|
|
+ private _scene;
|
|
|
+ private _renderTargetTexture;
|
|
|
+ private _projectionMatrix;
|
|
|
+ private _viewMatrix;
|
|
|
+ private _target;
|
|
|
+ private _add;
|
|
|
+ private _attachedMesh;
|
|
|
+ position: Vector3;
|
|
|
+ constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
|
|
|
+ refreshRate: number;
|
|
|
+ getScene(): Scene;
|
|
|
+ cubeTexture: RenderTargetTexture;
|
|
|
+ renderList: AbstractMesh[];
|
|
|
+ attachToMesh(mesh: AbstractMesh): void;
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class AnaglyphPostProcess extends PostProcess {
|
|
|
constructor(name: string, ratio: number, camera: Camera, samplingMode?: number, engine?: Engine, reusable?: boolean);
|
|
|
}
|
|
@@ -6705,27 +6750,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class ReflectionProbe {
|
|
|
- name: string;
|
|
|
- private _scene;
|
|
|
- private _renderTargetTexture;
|
|
|
- private _projectionMatrix;
|
|
|
- private _viewMatrix;
|
|
|
- private _target;
|
|
|
- private _add;
|
|
|
- private _attachedMesh;
|
|
|
- position: Vector3;
|
|
|
- constructor(name: string, size: number, scene: Scene, generateMipMaps?: boolean);
|
|
|
- refreshRate: number;
|
|
|
- getScene(): Scene;
|
|
|
- cubeTexture: RenderTargetTexture;
|
|
|
- renderList: AbstractMesh[];
|
|
|
- attachToMesh(mesh: AbstractMesh): void;
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class BoundingBoxRenderer {
|
|
|
frontColor: Color3;
|
|
|
backColor: Color3;
|
|
@@ -8293,7 +8317,7 @@ declare module BABYLON {
|
|
|
private _addMaterial(name, friction, restitution);
|
|
|
private _checkWithEpsilon(value);
|
|
|
private _createShape(impostor);
|
|
|
- private _createHeightmap(mesh, pointDepth?);
|
|
|
+ private _createHeightmap(object, pointDepth?);
|
|
|
private _minus90X;
|
|
|
private _plus90X;
|
|
|
private _tmpPosition;
|