|
@@ -124,8 +124,10 @@ declare module BABYLON {
|
|
|
private _alphaMode;
|
|
|
private _loadedTexturesCache;
|
|
|
private _maxTextureChannels;
|
|
|
+ private _activeTexture;
|
|
|
private _activeTexturesCache;
|
|
|
private _currentEffect;
|
|
|
+ private _currentProgram;
|
|
|
private _compiledEffects;
|
|
|
private _vertexAttribArraysEnabled;
|
|
|
private _vertexAttribArraysToUse;
|
|
@@ -136,6 +138,8 @@ declare module BABYLON {
|
|
|
private _currentRenderTarget;
|
|
|
private _uintIndicesCurrentlySet;
|
|
|
private _currentBoundBuffer;
|
|
|
+ private _currentFramebuffer;
|
|
|
+ private _currentBufferPointers;
|
|
|
private _currentInstanceLocations;
|
|
|
private _currentInstanceBuffers;
|
|
|
private _workingCanvas;
|
|
@@ -231,6 +235,7 @@ declare module BABYLON {
|
|
|
*/
|
|
|
setSize(width: number, height: number): void;
|
|
|
bindFramebuffer(texture: WebGLTexture, faceIndex?: number, requiredWidth?: number, requiredHeight?: number): void;
|
|
|
+ private bindUnboundFramebuffer(framebuffer);
|
|
|
unBindFramebuffer(texture: WebGLTexture, disableGenerateMipMaps?: boolean): void;
|
|
|
generateMipMapsForCubemap(texture: WebGLTexture): void;
|
|
|
flushFramebuffer(): void;
|
|
@@ -242,8 +247,10 @@ declare module BABYLON {
|
|
|
private _resetIndexBufferBinding();
|
|
|
createIndexBuffer(indices: number[] | Int32Array): WebGLBuffer;
|
|
|
bindArrayBuffer(buffer: WebGLBuffer): void;
|
|
|
- updateArrayBuffer(data: Float32Array): void;
|
|
|
+ private bindIndexBuffer(buffer);
|
|
|
private bindBuffer(buffer, target);
|
|
|
+ updateArrayBuffer(data: Float32Array): void;
|
|
|
+ private vertexAttribPointer(buffer, indx, size, type, normalized, stride, offset);
|
|
|
bindBuffersDirectly(vertexBuffer: WebGLBuffer, indexBuffer: WebGLBuffer, vertexDeclaration: number[], vertexStrideSize: number, effect: Effect): void;
|
|
|
bindBuffers(vertexBuffers: {
|
|
|
[key: string]: VertexBuffer;
|
|
@@ -304,7 +311,10 @@ declare module BABYLON {
|
|
|
updateTextureSize(texture: WebGLTexture, width: number, height: number): void;
|
|
|
createRawCubeTexture(url: string, scene: Scene, size: number, format: number, type: number, noMipmap: boolean, callback: (ArrayBuffer) => ArrayBufferView[], mipmmapGenerator: ((faces: ArrayBufferView[]) => ArrayBufferView[][])): WebGLTexture;
|
|
|
_releaseTexture(texture: WebGLTexture): void;
|
|
|
+ private setProgram(program);
|
|
|
bindSamplers(effect: Effect): void;
|
|
|
+ private activateTexture(texture);
|
|
|
+ _bindTextureDirectly(target: number, texture: WebGLTexture): void;
|
|
|
_bindTexture(channel: number, texture: WebGLTexture): void;
|
|
|
setTextureFromPostProcess(channel: number, postProcess: PostProcess): void;
|
|
|
unbindAllTextures(): void;
|
|
@@ -1488,182 +1498,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class Analyser {
|
|
|
- SMOOTHING: number;
|
|
|
- FFT_SIZE: number;
|
|
|
- BARGRAPHAMPLITUDE: number;
|
|
|
- DEBUGCANVASPOS: {
|
|
|
- x: number;
|
|
|
- y: number;
|
|
|
- };
|
|
|
- DEBUGCANVASSIZE: {
|
|
|
- width: number;
|
|
|
- height: number;
|
|
|
- };
|
|
|
- private _byteFreqs;
|
|
|
- private _byteTime;
|
|
|
- private _floatFreqs;
|
|
|
- private _webAudioAnalyser;
|
|
|
- private _debugCanvas;
|
|
|
- private _debugCanvasContext;
|
|
|
- private _scene;
|
|
|
- private _registerFunc;
|
|
|
- private _audioEngine;
|
|
|
- constructor(scene: Scene);
|
|
|
- getFrequencyBinCount(): number;
|
|
|
- getByteFrequencyData(): Uint8Array;
|
|
|
- getByteTimeDomainData(): Uint8Array;
|
|
|
- getFloatFrequencyData(): Uint8Array;
|
|
|
- drawDebugCanvas(): void;
|
|
|
- stopDebugCanvas(): void;
|
|
|
- connectAudioNodes(inputAudioNode: AudioNode, outputAudioNode: AudioNode): void;
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class AudioEngine {
|
|
|
- private _audioContext;
|
|
|
- private _audioContextInitialized;
|
|
|
- canUseWebAudio: boolean;
|
|
|
- masterGain: GainNode;
|
|
|
- private _connectedAnalyser;
|
|
|
- WarnedWebAudioUnsupported: boolean;
|
|
|
- unlocked: boolean;
|
|
|
- onAudioUnlocked: () => any;
|
|
|
- audioContext: AudioContext;
|
|
|
- constructor();
|
|
|
- private _unlockiOSaudio();
|
|
|
- private _initializeAudioContext();
|
|
|
- dispose(): void;
|
|
|
- getGlobalVolume(): number;
|
|
|
- setGlobalVolume(newVolume: number): void;
|
|
|
- connectToAnalyser(analyser: Analyser): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class Sound {
|
|
|
- name: string;
|
|
|
- autoplay: boolean;
|
|
|
- loop: boolean;
|
|
|
- useCustomAttenuation: boolean;
|
|
|
- soundTrackId: number;
|
|
|
- spatialSound: boolean;
|
|
|
- refDistance: number;
|
|
|
- rolloffFactor: number;
|
|
|
- maxDistance: number;
|
|
|
- distanceModel: string;
|
|
|
- private _panningModel;
|
|
|
- onended: () => any;
|
|
|
- private _playbackRate;
|
|
|
- private _streaming;
|
|
|
- private _startTime;
|
|
|
- private _startOffset;
|
|
|
- private _position;
|
|
|
- private _localDirection;
|
|
|
- private _volume;
|
|
|
- private _isLoaded;
|
|
|
- private _isReadyToPlay;
|
|
|
- isPlaying: boolean;
|
|
|
- isPaused: boolean;
|
|
|
- private _isDirectional;
|
|
|
- private _readyToPlayCallback;
|
|
|
- private _audioBuffer;
|
|
|
- private _soundSource;
|
|
|
- private _streamingSource;
|
|
|
- private _soundPanner;
|
|
|
- private _soundGain;
|
|
|
- private _inputAudioNode;
|
|
|
- private _ouputAudioNode;
|
|
|
- private _coneInnerAngle;
|
|
|
- private _coneOuterAngle;
|
|
|
- private _coneOuterGain;
|
|
|
- private _scene;
|
|
|
- private _connectedMesh;
|
|
|
- private _customAttenuationFunction;
|
|
|
- private _registerFunc;
|
|
|
- private _isOutputConnected;
|
|
|
- private _htmlAudioElement;
|
|
|
- /**
|
|
|
- * Create a sound and attach it to a scene
|
|
|
- * @param name Name of your sound
|
|
|
- * @param urlOrArrayBuffer Url to the sound to load async or ArrayBuffer
|
|
|
- * @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played
|
|
|
- * @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel, streaming
|
|
|
- */
|
|
|
- constructor(name: string, urlOrArrayBuffer: any, scene: Scene, readyToPlayCallback?: () => void, options?: any);
|
|
|
- dispose(): void;
|
|
|
- private _soundLoaded(audioData);
|
|
|
- setAudioBuffer(audioBuffer: AudioBuffer): void;
|
|
|
- updateOptions(options: any): void;
|
|
|
- private _createSpatialParameters();
|
|
|
- private _updateSpatialParameters();
|
|
|
- switchPanningModelToHRTF(): void;
|
|
|
- switchPanningModelToEqualPower(): void;
|
|
|
- private _switchPanningModel();
|
|
|
- connectToSoundTrackAudioNode(soundTrackAudioNode: AudioNode): void;
|
|
|
- /**
|
|
|
- * Transform this sound into a directional source
|
|
|
- * @param coneInnerAngle Size of the inner cone in degree
|
|
|
- * @param coneOuterAngle Size of the outer cone in degree
|
|
|
- * @param coneOuterGain Volume of the sound outside the outer cone (between 0.0 and 1.0)
|
|
|
- */
|
|
|
- setDirectionalCone(coneInnerAngle: number, coneOuterAngle: number, coneOuterGain: number): void;
|
|
|
- setPosition(newPosition: Vector3): void;
|
|
|
- setLocalDirectionToMesh(newLocalDirection: Vector3): void;
|
|
|
- private _updateDirection();
|
|
|
- updateDistanceFromListener(): void;
|
|
|
- setAttenuationFunction(callback: (currentVolume: number, currentDistance: number, maxDistance: number, refDistance: number, rolloffFactor: number) => number): void;
|
|
|
- /**
|
|
|
- * Play the sound
|
|
|
- * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
|
|
|
- */
|
|
|
- play(time?: number): void;
|
|
|
- private _onended();
|
|
|
- /**
|
|
|
- * Stop the sound
|
|
|
- * @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default.
|
|
|
- */
|
|
|
- stop(time?: number): void;
|
|
|
- pause(): void;
|
|
|
- setVolume(newVolume: number, time?: number): void;
|
|
|
- setPlaybackRate(newPlaybackRate: number): void;
|
|
|
- getVolume(): number;
|
|
|
- attachToMesh(meshToConnectTo: AbstractMesh): void;
|
|
|
- detachFromMesh(): void;
|
|
|
- private _onRegisterAfterWorldMatrixUpdate(connectedMesh);
|
|
|
- clone(): Sound;
|
|
|
- getAudioBuffer(): AudioBuffer;
|
|
|
- static Parse(parsedSound: any, scene: Scene, rootUrl: string, sourceSound?: Sound): Sound;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class SoundTrack {
|
|
|
- private _outputAudioNode;
|
|
|
- private _inputAudioNode;
|
|
|
- private _trackConvolver;
|
|
|
- private _scene;
|
|
|
- id: number;
|
|
|
- soundCollection: Array<Sound>;
|
|
|
- private _isMainTrack;
|
|
|
- private _connectedAnalyser;
|
|
|
- private _options;
|
|
|
- private _isInitialized;
|
|
|
- constructor(scene: Scene, options?: any);
|
|
|
- private _initializeSoundTrackAudioGraph();
|
|
|
- dispose(): void;
|
|
|
- AddSound(sound: Sound): void;
|
|
|
- RemoveSound(sound: Sound): void;
|
|
|
- setVolume(newVolume: number): void;
|
|
|
- switchPanningModelToHRTF(): void;
|
|
|
- switchPanningModelToEqualPower(): void;
|
|
|
- connectToAnalyser(analyser: Analyser): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class Animatable {
|
|
|
target: any;
|
|
|
fromFrame: number;
|
|
@@ -1768,7 +1602,10 @@ declare module BABYLON {
|
|
|
getRange(name: string): AnimationRange;
|
|
|
reset(): void;
|
|
|
isStopped(): boolean;
|
|
|
- getKeys(): any[];
|
|
|
+ getKeys(): Array<{
|
|
|
+ frame: number;
|
|
|
+ value: any;
|
|
|
+ }>;
|
|
|
getHighestFrame(): number;
|
|
|
getEasingFunction(): IEasingFunction;
|
|
|
setEasingFunction(easingFunction: EasingFunction): void;
|
|
@@ -1780,7 +1617,10 @@ declare module BABYLON {
|
|
|
color3InterpolateFunction(startValue: Color3, endValue: Color3, gradient: number): Color3;
|
|
|
matrixInterpolateFunction(startValue: Matrix, endValue: Matrix, gradient: number): Matrix;
|
|
|
clone(): Animation;
|
|
|
- setKeys(values: Array<any>): void;
|
|
|
+ setKeys(values: Array<{
|
|
|
+ frame: number;
|
|
|
+ value: any;
|
|
|
+ }>): void;
|
|
|
private _getKeyValue(value);
|
|
|
private _interpolate(currentFrame, repeatCount, loopMode, offsetValue?, highLimitValue?);
|
|
|
setValue(currentValue: any, blend?: boolean): void;
|
|
@@ -1885,6 +1725,182 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class Analyser {
|
|
|
+ SMOOTHING: number;
|
|
|
+ FFT_SIZE: number;
|
|
|
+ BARGRAPHAMPLITUDE: number;
|
|
|
+ DEBUGCANVASPOS: {
|
|
|
+ x: number;
|
|
|
+ y: number;
|
|
|
+ };
|
|
|
+ DEBUGCANVASSIZE: {
|
|
|
+ width: number;
|
|
|
+ height: number;
|
|
|
+ };
|
|
|
+ private _byteFreqs;
|
|
|
+ private _byteTime;
|
|
|
+ private _floatFreqs;
|
|
|
+ private _webAudioAnalyser;
|
|
|
+ private _debugCanvas;
|
|
|
+ private _debugCanvasContext;
|
|
|
+ private _scene;
|
|
|
+ private _registerFunc;
|
|
|
+ private _audioEngine;
|
|
|
+ constructor(scene: Scene);
|
|
|
+ getFrequencyBinCount(): number;
|
|
|
+ getByteFrequencyData(): Uint8Array;
|
|
|
+ getByteTimeDomainData(): Uint8Array;
|
|
|
+ getFloatFrequencyData(): Uint8Array;
|
|
|
+ drawDebugCanvas(): void;
|
|
|
+ stopDebugCanvas(): void;
|
|
|
+ connectAudioNodes(inputAudioNode: AudioNode, outputAudioNode: AudioNode): void;
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class AudioEngine {
|
|
|
+ private _audioContext;
|
|
|
+ private _audioContextInitialized;
|
|
|
+ canUseWebAudio: boolean;
|
|
|
+ masterGain: GainNode;
|
|
|
+ private _connectedAnalyser;
|
|
|
+ WarnedWebAudioUnsupported: boolean;
|
|
|
+ unlocked: boolean;
|
|
|
+ onAudioUnlocked: () => any;
|
|
|
+ audioContext: AudioContext;
|
|
|
+ constructor();
|
|
|
+ private _unlockiOSaudio();
|
|
|
+ private _initializeAudioContext();
|
|
|
+ dispose(): void;
|
|
|
+ getGlobalVolume(): number;
|
|
|
+ setGlobalVolume(newVolume: number): void;
|
|
|
+ connectToAnalyser(analyser: Analyser): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class Sound {
|
|
|
+ name: string;
|
|
|
+ autoplay: boolean;
|
|
|
+ loop: boolean;
|
|
|
+ useCustomAttenuation: boolean;
|
|
|
+ soundTrackId: number;
|
|
|
+ spatialSound: boolean;
|
|
|
+ refDistance: number;
|
|
|
+ rolloffFactor: number;
|
|
|
+ maxDistance: number;
|
|
|
+ distanceModel: string;
|
|
|
+ private _panningModel;
|
|
|
+ onended: () => any;
|
|
|
+ private _playbackRate;
|
|
|
+ private _streaming;
|
|
|
+ private _startTime;
|
|
|
+ private _startOffset;
|
|
|
+ private _position;
|
|
|
+ private _localDirection;
|
|
|
+ private _volume;
|
|
|
+ private _isLoaded;
|
|
|
+ private _isReadyToPlay;
|
|
|
+ isPlaying: boolean;
|
|
|
+ isPaused: boolean;
|
|
|
+ private _isDirectional;
|
|
|
+ private _readyToPlayCallback;
|
|
|
+ private _audioBuffer;
|
|
|
+ private _soundSource;
|
|
|
+ private _streamingSource;
|
|
|
+ private _soundPanner;
|
|
|
+ private _soundGain;
|
|
|
+ private _inputAudioNode;
|
|
|
+ private _ouputAudioNode;
|
|
|
+ private _coneInnerAngle;
|
|
|
+ private _coneOuterAngle;
|
|
|
+ private _coneOuterGain;
|
|
|
+ private _scene;
|
|
|
+ private _connectedMesh;
|
|
|
+ private _customAttenuationFunction;
|
|
|
+ private _registerFunc;
|
|
|
+ private _isOutputConnected;
|
|
|
+ private _htmlAudioElement;
|
|
|
+ /**
|
|
|
+ * Create a sound and attach it to a scene
|
|
|
+ * @param name Name of your sound
|
|
|
+ * @param urlOrArrayBuffer Url to the sound to load async or ArrayBuffer
|
|
|
+ * @param readyToPlayCallback Provide a callback function if you'd like to load your code once the sound is ready to be played
|
|
|
+ * @param options Objects to provide with the current available options: autoplay, loop, volume, spatialSound, maxDistance, rolloffFactor, refDistance, distanceModel, panningModel, streaming
|
|
|
+ */
|
|
|
+ constructor(name: string, urlOrArrayBuffer: any, scene: Scene, readyToPlayCallback?: () => void, options?: any);
|
|
|
+ dispose(): void;
|
|
|
+ private _soundLoaded(audioData);
|
|
|
+ setAudioBuffer(audioBuffer: AudioBuffer): void;
|
|
|
+ updateOptions(options: any): void;
|
|
|
+ private _createSpatialParameters();
|
|
|
+ private _updateSpatialParameters();
|
|
|
+ switchPanningModelToHRTF(): void;
|
|
|
+ switchPanningModelToEqualPower(): void;
|
|
|
+ private _switchPanningModel();
|
|
|
+ connectToSoundTrackAudioNode(soundTrackAudioNode: AudioNode): void;
|
|
|
+ /**
|
|
|
+ * Transform this sound into a directional source
|
|
|
+ * @param coneInnerAngle Size of the inner cone in degree
|
|
|
+ * @param coneOuterAngle Size of the outer cone in degree
|
|
|
+ * @param coneOuterGain Volume of the sound outside the outer cone (between 0.0 and 1.0)
|
|
|
+ */
|
|
|
+ setDirectionalCone(coneInnerAngle: number, coneOuterAngle: number, coneOuterGain: number): void;
|
|
|
+ setPosition(newPosition: Vector3): void;
|
|
|
+ setLocalDirectionToMesh(newLocalDirection: Vector3): void;
|
|
|
+ private _updateDirection();
|
|
|
+ updateDistanceFromListener(): void;
|
|
|
+ setAttenuationFunction(callback: (currentVolume: number, currentDistance: number, maxDistance: number, refDistance: number, rolloffFactor: number) => number): void;
|
|
|
+ /**
|
|
|
+ * Play the sound
|
|
|
+ * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
|
|
|
+ */
|
|
|
+ play(time?: number): void;
|
|
|
+ private _onended();
|
|
|
+ /**
|
|
|
+ * Stop the sound
|
|
|
+ * @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default.
|
|
|
+ */
|
|
|
+ stop(time?: number): void;
|
|
|
+ pause(): void;
|
|
|
+ setVolume(newVolume: number, time?: number): void;
|
|
|
+ setPlaybackRate(newPlaybackRate: number): void;
|
|
|
+ getVolume(): number;
|
|
|
+ attachToMesh(meshToConnectTo: AbstractMesh): void;
|
|
|
+ detachFromMesh(): void;
|
|
|
+ private _onRegisterAfterWorldMatrixUpdate(connectedMesh);
|
|
|
+ clone(): Sound;
|
|
|
+ getAudioBuffer(): AudioBuffer;
|
|
|
+ static Parse(parsedSound: any, scene: Scene, rootUrl: string, sourceSound?: Sound): Sound;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class SoundTrack {
|
|
|
+ private _outputAudioNode;
|
|
|
+ private _inputAudioNode;
|
|
|
+ private _trackConvolver;
|
|
|
+ private _scene;
|
|
|
+ id: number;
|
|
|
+ soundCollection: Array<Sound>;
|
|
|
+ private _isMainTrack;
|
|
|
+ private _connectedAnalyser;
|
|
|
+ private _options;
|
|
|
+ private _isInitialized;
|
|
|
+ constructor(scene: Scene, options?: any);
|
|
|
+ private _initializeSoundTrackAudioGraph();
|
|
|
+ dispose(): void;
|
|
|
+ AddSound(sound: Sound): void;
|
|
|
+ RemoveSound(sound: Sound): void;
|
|
|
+ setVolume(newVolume: number): void;
|
|
|
+ switchPanningModelToHRTF(): void;
|
|
|
+ switchPanningModelToEqualPower(): void;
|
|
|
+ connectToAnalyser(analyser: Analyser): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class Bone extends Node {
|
|
|
name: string;
|
|
|
children: Bone[];
|
|
@@ -5588,50 +5604,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- interface ISceneLoaderPlugin {
|
|
|
- extensions: string;
|
|
|
- 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;
|
|
|
- static NO_LOGGING: number;
|
|
|
- static MINIMAL_LOGGING: number;
|
|
|
- static SUMMARY_LOGGING: number;
|
|
|
- static DETAILED_LOGGING: number;
|
|
|
- private static _loggingLevel;
|
|
|
- static ForceFullSceneLoadingForIncremental: boolean;
|
|
|
- static ShowLoadingScreen: boolean;
|
|
|
- static loggingLevel: number;
|
|
|
- private static _registeredPlugins;
|
|
|
- private static _getPluginForFilename(sceneFilename);
|
|
|
- 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, message: string, exception?: any) => void): void;
|
|
|
- /**
|
|
|
- * Load a scene
|
|
|
- * @param rootUrl a string that defines the root url for scene and resources
|
|
|
- * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
|
|
|
- * @param engine is the instance of BABYLON.Engine to use to create the scene
|
|
|
- */
|
|
|
- static Load(rootUrl: string, sceneFilename: any, engine: Engine, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
|
|
|
- /**
|
|
|
- * Append a scene
|
|
|
- * @param rootUrl a string that defines the root url for scene and resources
|
|
|
- * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
|
|
|
- * @param scene is the instance of BABYLON.Scene to append to
|
|
|
- */
|
|
|
- static Append(rootUrl: string, sceneFilename: any, scene: Scene, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class DirectionalLight extends Light implements IShadowLight {
|
|
|
position: Vector3;
|
|
|
direction: Vector3;
|
|
@@ -5766,6 +5738,50 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ interface ISceneLoaderPlugin {
|
|
|
+ extensions: string;
|
|
|
+ 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;
|
|
|
+ static NO_LOGGING: number;
|
|
|
+ static MINIMAL_LOGGING: number;
|
|
|
+ static SUMMARY_LOGGING: number;
|
|
|
+ static DETAILED_LOGGING: number;
|
|
|
+ private static _loggingLevel;
|
|
|
+ static ForceFullSceneLoadingForIncremental: boolean;
|
|
|
+ static ShowLoadingScreen: boolean;
|
|
|
+ static loggingLevel: number;
|
|
|
+ private static _registeredPlugins;
|
|
|
+ private static _getPluginForFilename(sceneFilename);
|
|
|
+ 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, message: string, exception?: any) => void): void;
|
|
|
+ /**
|
|
|
+ * Load a scene
|
|
|
+ * @param rootUrl a string that defines the root url for scene and resources
|
|
|
+ * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
|
|
|
+ * @param engine is the instance of BABYLON.Engine to use to create the scene
|
|
|
+ */
|
|
|
+ static Load(rootUrl: string, sceneFilename: any, engine: Engine, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
|
|
|
+ /**
|
|
|
+ * Append a scene
|
|
|
+ * @param rootUrl a string that defines the root url for scene and resources
|
|
|
+ * @param sceneFilename a string that defines the name of the scene file. can start with "data:" following by the stringified version of the scene
|
|
|
+ * @param scene is the instance of BABYLON.Scene to append to
|
|
|
+ */
|
|
|
+ static Append(rootUrl: string, sceneFilename: any, scene: Scene, onsuccess?: (scene: Scene) => void, progressCallBack?: any, onerror?: (scene: Scene) => void): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
/**
|
|
|
* The color grading curves provide additional color adjustmnent that is applied after any color grading transform (3D LUT).
|
|
|
* They allow basic adjustment of saturation and small exposure adjustments, along with color filter tinting to provide white balance adjustment or more stylistic effects.
|
|
@@ -6052,10 +6068,10 @@ declare module BABYLON {
|
|
|
_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;
|
|
|
+ _cacheMatrix(uniformName: string, matrix: Matrix): boolean;
|
|
|
+ _cacheFloat2(uniformName: string, x: number, y: number): boolean;
|
|
|
+ _cacheFloat3(uniformName: string, x: number, y: number, z: number): boolean;
|
|
|
+ _cacheFloat4(uniformName: string, x: number, y: number, z: number, w: number): boolean;
|
|
|
setArray(uniformName: string, array: number[]): Effect;
|
|
|
setArray2(uniformName: string, array: number[]): Effect;
|
|
|
setArray3(uniformName: string, array: number[]): Effect;
|
|
@@ -6063,7 +6079,7 @@ declare module BABYLON {
|
|
|
setMatrices(uniformName: string, matrices: Float32Array): Effect;
|
|
|
setMatrix(uniformName: string, matrix: Matrix): Effect;
|
|
|
setMatrix3x3(uniformName: string, matrix: Float32Array): Effect;
|
|
|
- setMatrix2x2(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;
|
|
@@ -6846,6 +6862,8 @@ declare module BABYLON {
|
|
|
static CrossToRef(left: Vector3, right: Vector3, result: Vector3): void;
|
|
|
static Normalize(vector: Vector3): Vector3;
|
|
|
static NormalizeToRef(vector: Vector3, result: Vector3): void;
|
|
|
+ private static _viewportMatrixCache;
|
|
|
+ private static _matrixCache;
|
|
|
static Project(vector: Vector3, world: Matrix, transform: Matrix, viewport: Viewport): Vector3;
|
|
|
static UnprojectFromTransform(source: Vector3, viewportWidth: number, viewportHeight: number, world: Matrix, transform: Matrix): Vector3;
|
|
|
static Unproject(source: Vector3, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Vector3;
|
|
@@ -6973,9 +6991,10 @@ declare module BABYLON {
|
|
|
static Inverse(q: Quaternion): Quaternion;
|
|
|
static Identity(): Quaternion;
|
|
|
static RotationAxis(axis: Vector3, angle: number): Quaternion;
|
|
|
+ static RotationAxisToRef(axis: Vector3, angle: number, result: Quaternion): Quaternion;
|
|
|
static FromArray(array: number[], offset?: number): Quaternion;
|
|
|
static RotationYawPitchRoll(yaw: number, pitch: number, roll: number): Quaternion;
|
|
|
- static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Quaternion): void;
|
|
|
+ static RotationYawPitchRollToRef(yaw: number, pitch: number, roll: number, result: Quaternion): Quaternion;
|
|
|
static RotationAlphaBetaGamma(alpha: number, beta: number, gamma: number): Quaternion;
|
|
|
static RotationAlphaBetaGammaToRef(alpha: number, beta: number, gamma: number, result: Quaternion): void;
|
|
|
static Slerp(left: Quaternion, right: Quaternion, amount: number): Quaternion;
|
|
@@ -7427,6 +7446,7 @@ declare module BABYLON {
|
|
|
freezeWorldMatrix(): void;
|
|
|
unfreezeWorldMatrix(): void;
|
|
|
isWorldMatrixFrozen: boolean;
|
|
|
+ private static _rotationAxisCache;
|
|
|
rotate(axis: Vector3, amount: number, space?: Space): void;
|
|
|
translate(axis: Vector3, distance: number, space?: Space): void;
|
|
|
getAbsolutePosition(): Vector3;
|
|
@@ -7482,6 +7502,7 @@ declare module BABYLON {
|
|
|
setPositionWithLocalVector(vector3: Vector3): void;
|
|
|
getPositionExpressedInLocalSpace(): Vector3;
|
|
|
locallyTranslate(vector3: Vector3): void;
|
|
|
+ private static _lookAtVectorCache;
|
|
|
lookAt(targetPoint: Vector3, yawCor: number, pitchCor: number, rollCor: number): void;
|
|
|
attachToBone(bone: Bone, affectedMesh: AbstractMesh): void;
|
|
|
detachFromBone(): void;
|
|
@@ -7644,6 +7665,7 @@ declare module BABYLON {
|
|
|
private _applyToMesh(mesh);
|
|
|
private notifyUpdate(kind?);
|
|
|
load(scene: Scene, onLoaded?: () => void): void;
|
|
|
+ private _queueLoad(scene, onLoaded?);
|
|
|
/**
|
|
|
* Invert the geometry to move from a right handed system to a left handed one.
|
|
|
*/
|
|
@@ -8259,12 +8281,13 @@ declare module BABYLON {
|
|
|
unregisterAfterRender(func: (mesh: AbstractMesh) => void): void;
|
|
|
_getInstancesRenderList(subMeshId: number): _InstancesBatch;
|
|
|
_renderWithInstances(subMesh: SubMesh, fillMode: number, batch: _InstancesBatch, effect: Effect, engine: Engine): void;
|
|
|
- _processRendering(subMesh: SubMesh, effect: Effect, fillMode: number, batch: _InstancesBatch, hardwareInstancedRendering: boolean, onBeforeDraw: (isInstance: boolean, world: Matrix) => void): void;
|
|
|
+ _processRendering(subMesh: SubMesh, effect: Effect, fillMode: number, batch: _InstancesBatch, hardwareInstancedRendering: boolean, onBeforeDraw: (isInstance: boolean, world: Matrix, effectiveMaterial?: Material) => void, effectiveMaterial?: Material): void;
|
|
|
/**
|
|
|
* Triggers the draw call for the mesh.
|
|
|
* Usually, you don't need to call this method by your own because the mesh rendering is handled by the scene rendering manager.
|
|
|
*/
|
|
|
render(subMesh: SubMesh, enableAlphaMode: boolean): void;
|
|
|
+ private _onBeforeDraw(isInstance, world, effectiveMaterial);
|
|
|
/**
|
|
|
* Returns an array populated with ParticleSystem objects whose the mesh is the emitter.
|
|
|
*/
|
|
@@ -8274,6 +8297,7 @@ declare module BABYLON {
|
|
|
*/
|
|
|
getHierarchyEmittedParticleSystems(): ParticleSystem[];
|
|
|
_checkDelayState(): void;
|
|
|
+ private _queueLoad(mesh, scene);
|
|
|
/**
|
|
|
* Boolean, true is the mesh in the frustum defined by the Plane objects from the `frustumPlanes` array parameter.
|
|
|
*/
|
|
@@ -8792,6 +8816,7 @@ declare module BABYLON {
|
|
|
closePath?: boolean;
|
|
|
offset?: number;
|
|
|
sideOrientation?: number;
|
|
|
+ invertUV?: boolean;
|
|
|
}): VertexData;
|
|
|
static CreateBox(options: {
|
|
|
size?: number;
|
|
@@ -9020,6 +9045,7 @@ declare module BABYLON {
|
|
|
* The optional parameter `instance` is an instance of an existing Ribbon object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#ribbon
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
* Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture.
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
static CreateRibbon(name: string, options: {
|
|
@@ -9030,6 +9056,7 @@ declare module BABYLON {
|
|
|
updatable?: boolean;
|
|
|
sideOrientation?: number;
|
|
|
instance?: Mesh;
|
|
|
+ invertUV?: boolean;
|
|
|
}, scene?: Scene): Mesh;
|
|
|
/**
|
|
|
* Creates a cylinder or a cone mesh.
|
|
@@ -9176,6 +9203,7 @@ declare module BABYLON {
|
|
|
* Remember you can only change the shape or path point positions, not their number when updating an extruded shape.
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
* Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture.
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
static ExtrudeShape(name: string, options: {
|
|
@@ -9187,6 +9215,7 @@ declare module BABYLON {
|
|
|
updatable?: boolean;
|
|
|
sideOrientation?: number;
|
|
|
instance?: Mesh;
|
|
|
+ invertUV?: boolean;
|
|
|
}, scene: Scene): Mesh;
|
|
|
/**
|
|
|
* Creates an custom extruded shape mesh.
|
|
@@ -9220,6 +9249,7 @@ declare module BABYLON {
|
|
|
* Remember you can only change the shape or path point positions, not their number when updating an extruded shape.
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
* Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture.
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
static ExtrudeShapeCustom(name: string, options: {
|
|
@@ -9233,6 +9263,7 @@ declare module BABYLON {
|
|
|
updatable?: boolean;
|
|
|
sideOrientation?: number;
|
|
|
instance?: Mesh;
|
|
|
+ invertUV?: boolean;
|
|
|
}, scene: Scene): Mesh;
|
|
|
/**
|
|
|
* Creates lathe mesh.
|
|
@@ -9248,6 +9279,7 @@ declare module BABYLON {
|
|
|
* The parameter `cap` sets the way the extruded shape is capped. Possible values : BABYLON.Mesh.NO_CAP (default), BABYLON.Mesh.CAP_START, BABYLON.Mesh.CAP_END, BABYLON.Mesh.CAP_ALL
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
* Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture.
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
static CreateLathe(name: string, options: {
|
|
@@ -9259,6 +9291,7 @@ declare module BABYLON {
|
|
|
updatable?: boolean;
|
|
|
sideOrientation?: number;
|
|
|
cap?: number;
|
|
|
+ invertUV?: boolean;
|
|
|
}, scene: Scene): Mesh;
|
|
|
/**
|
|
|
* Creates a plane mesh.
|
|
@@ -9364,6 +9397,7 @@ declare module BABYLON {
|
|
|
* The optional parameter `instance` is an instance of an existing Tube object to be updated with the passed `pathArray` parameter : http://doc.babylonjs.com/tutorials/How_to_dynamically_morph_a_mesh#tube
|
|
|
* You can also set the mesh side orientation with the values : BABYLON.Mesh.FRONTSIDE (default), BABYLON.Mesh.BACKSIDE or BABYLON.Mesh.DOUBLESIDE
|
|
|
* Detail here : http://doc.babylonjs.com/tutorials/02._Discover_Basic_Elements#side-orientation
|
|
|
+ * The optional parameter `invertUV` (boolean, default false) swaps in the geometry the U and V coordinates to apply a texture.
|
|
|
* The mesh can be set to updatable with the boolean parameter `updatable` (default false) if its internal geometry is supposed to change once created.
|
|
|
*/
|
|
|
static CreateTube(name: string, options: {
|
|
@@ -9378,6 +9412,7 @@ declare module BABYLON {
|
|
|
updatable?: boolean;
|
|
|
sideOrientation?: number;
|
|
|
instance?: Mesh;
|
|
|
+ invertUV?: boolean;
|
|
|
}, scene: Scene): Mesh;
|
|
|
/**
|
|
|
* Creates a polyhedron mesh.
|
|
@@ -9424,7 +9459,7 @@ declare module BABYLON {
|
|
|
size?: Vector3;
|
|
|
angle?: number;
|
|
|
}): Mesh;
|
|
|
- private static _ExtrudeShapeGeneric(name, shape, curve, scale, rotation, scaleFunction, rotateFunction, rbCA, rbCP, cap, custom, scene, updtbl, side, instance);
|
|
|
+ private static _ExtrudeShapeGeneric(name, shape, curve, scale, rotation, scaleFunction, rotateFunction, rbCA, rbCP, cap, custom, scene, updtbl, side, instance, invertUV);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -10449,6 +10484,28 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
+ class ReflectionProbe {
|
|
|
+ name: string;
|
|
|
+ private _scene;
|
|
|
+ private _renderTargetTexture;
|
|
|
+ private _projectionMatrix;
|
|
|
+ private _viewMatrix;
|
|
|
+ private _target;
|
|
|
+ private _add;
|
|
|
+ private _attachedMesh;
|
|
|
+ invertYAxis: boolean;
|
|
|
+ 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 {
|
|
|
private _passedProcess;
|
|
|
constructor(name: string, options: number | PostProcessOptions, rigCameras: Camera[], samplingMode?: number, engine?: Engine, reusable?: boolean);
|
|
@@ -11065,28 +11122,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;
|
|
|
- invertYAxis: boolean;
|
|
|
- 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;
|
|
@@ -11726,6 +11761,7 @@ declare module BABYLON {
|
|
|
* If the callback of a given Observer set skipNextObservers to true the following observers will be ignored
|
|
|
*/
|
|
|
constructor(mask: number, skipNextObservers?: boolean);
|
|
|
+ initalize(mask: number, skipNextObservers?: boolean): EventState;
|
|
|
/**
|
|
|
* An Observer can set this property to true to prevent subsequent observers of being notified
|
|
|
*/
|
|
@@ -11751,6 +11787,7 @@ declare module BABYLON {
|
|
|
* A given observer can register itself with only Move and Stop (mask = 0x03), then it will only be notified when one of these two occurs and will never be for Turn Left/Right.
|
|
|
*/
|
|
|
class Observable<T> {
|
|
|
+ private static _pooledEventState;
|
|
|
_observers: Observer<T>[];
|
|
|
/**
|
|
|
* Create a new Observer with the specified callback
|
|
@@ -12626,9 +12663,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-declare module BABYLON.Internals {
|
|
|
-}
|
|
|
-
|
|
|
declare module BABYLON {
|
|
|
class ShadowGenerator {
|
|
|
private static _FILTER_NONE;
|
|
@@ -12687,6 +12721,9 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+declare module BABYLON.Internals {
|
|
|
+}
|
|
|
+
|
|
|
declare module BABYLON {
|
|
|
class BaseTexture {
|
|
|
name: string;
|