|
@@ -2418,6 +2418,188 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
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;
|
|
|
|
+ isMP3supported: boolean;
|
|
|
|
+ isOGGsupported: boolean;
|
|
|
|
+ readonly 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;
|
|
|
|
+ private _urlType;
|
|
|
|
+ /**
|
|
|
|
+ * 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;
|
|
|
|
+ isReady(): boolean;
|
|
|
|
+ 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.
|
|
|
|
+ * @param offset (optional) Start the sound setting it at a specific time
|
|
|
|
+ */
|
|
|
|
+ play(time?: number, offset?: 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;
|
|
|
|
+ serialize(): any;
|
|
|
|
+ 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 {
|
|
class Animatable {
|
|
target: any;
|
|
target: any;
|
|
fromFrame: number;
|
|
fromFrame: number;
|
|
@@ -2649,189 +2831,7 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
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;
|
|
|
|
- isMP3supported: boolean;
|
|
|
|
- isOGGsupported: boolean;
|
|
|
|
- readonly 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;
|
|
|
|
- private _urlType;
|
|
|
|
- /**
|
|
|
|
- * 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;
|
|
|
|
- isReady(): boolean;
|
|
|
|
- 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.
|
|
|
|
- * @param offset (optional) Start the sound setting it at a specific time
|
|
|
|
- */
|
|
|
|
- play(time?: number, offset?: 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;
|
|
|
|
- serialize(): any;
|
|
|
|
- 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 {
|
|
|
|
|
|
+ class Bone extends Node {
|
|
name: string;
|
|
name: string;
|
|
private static _tmpVecs;
|
|
private static _tmpVecs;
|
|
private static _tmpQuat;
|
|
private static _tmpQuat;
|
|
@@ -4131,111 +4131,6 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-declare module BABYLON.Debug {
|
|
|
|
- class AxesViewer {
|
|
|
|
- private _xline;
|
|
|
|
- private _yline;
|
|
|
|
- private _zline;
|
|
|
|
- private _xmesh;
|
|
|
|
- private _ymesh;
|
|
|
|
- private _zmesh;
|
|
|
|
- scene: Scene;
|
|
|
|
- scaleLines: number;
|
|
|
|
- constructor(scene: Scene, scaleLines?: number);
|
|
|
|
- update(position: Vector3, xaxis: Vector3, yaxis: Vector3, zaxis: Vector3): void;
|
|
|
|
- dispose(): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON.Debug {
|
|
|
|
- class BoneAxesViewer extends Debug.AxesViewer {
|
|
|
|
- mesh: Mesh;
|
|
|
|
- bone: Bone;
|
|
|
|
- pos: Vector3;
|
|
|
|
- xaxis: Vector3;
|
|
|
|
- yaxis: Vector3;
|
|
|
|
- zaxis: Vector3;
|
|
|
|
- constructor(scene: Scene, bone: Bone, mesh: Mesh, scaleLines?: number);
|
|
|
|
- update(): void;
|
|
|
|
- dispose(): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class DebugLayer {
|
|
|
|
- private _scene;
|
|
|
|
- static InspectorURL: string;
|
|
|
|
- private _inspector;
|
|
|
|
- constructor(scene: Scene);
|
|
|
|
- /** Creates the inspector window. */
|
|
|
|
- private _createInspector(config?);
|
|
|
|
- isVisible(): boolean;
|
|
|
|
- hide(): void;
|
|
|
|
- show(config?: {
|
|
|
|
- popup?: boolean;
|
|
|
|
- initialTab?: number;
|
|
|
|
- parentElement?: HTMLElement;
|
|
|
|
- newColors?: {
|
|
|
|
- backgroundColor?: string;
|
|
|
|
- backgroundColorLighter?: string;
|
|
|
|
- backgroundColorLighter2?: string;
|
|
|
|
- backgroundColorLighter3?: string;
|
|
|
|
- color?: string;
|
|
|
|
- colorTop?: string;
|
|
|
|
- colorBot?: string;
|
|
|
|
- };
|
|
|
|
- }): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class RayHelper {
|
|
|
|
- ray: Ray;
|
|
|
|
- private _renderPoints;
|
|
|
|
- private _renderLine;
|
|
|
|
- private _renderFunction;
|
|
|
|
- private _scene;
|
|
|
|
- private _updateToMeshFunction;
|
|
|
|
- private _attachedToMesh;
|
|
|
|
- private _meshSpaceDirection;
|
|
|
|
- private _meshSpaceOrigin;
|
|
|
|
- static CreateAndShow(ray: Ray, scene: Scene, color: Color3): RayHelper;
|
|
|
|
- constructor(ray: Ray);
|
|
|
|
- show(scene: Scene, color: Color3): void;
|
|
|
|
- hide(): void;
|
|
|
|
- private _render();
|
|
|
|
- attachToMesh(mesh: AbstractMesh, meshSpaceDirection?: Vector3, meshSpaceOrigin?: Vector3, length?: number): void;
|
|
|
|
- detachFromMesh(): void;
|
|
|
|
- private _updateToMesh();
|
|
|
|
- dispose(): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON.Debug {
|
|
|
|
- /**
|
|
|
|
- * Demo available here: http://www.babylonjs-playground.com/#1BZJVJ#8
|
|
|
|
- */
|
|
|
|
- class SkeletonViewer {
|
|
|
|
- skeleton: Skeleton;
|
|
|
|
- mesh: AbstractMesh;
|
|
|
|
- autoUpdateBonesMatrices: boolean;
|
|
|
|
- renderingGroupId: number;
|
|
|
|
- color: Color3;
|
|
|
|
- private _scene;
|
|
|
|
- private _debugLines;
|
|
|
|
- private _debugMesh;
|
|
|
|
- private _isEnabled;
|
|
|
|
- private _renderFunction;
|
|
|
|
- constructor(skeleton: Skeleton, mesh: AbstractMesh, scene: Scene, autoUpdateBonesMatrices?: boolean, renderingGroupId?: number);
|
|
|
|
- isEnabled: boolean;
|
|
|
|
- private _getBonePosition(position, bone, meshMat, x?, y?, z?);
|
|
|
|
- private _getLinesForBonesWithLength(bones, meshMat);
|
|
|
|
- private _getLinesForBonesNoLength(bones, meshMat);
|
|
|
|
- update(): void;
|
|
|
|
- dispose(): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
/**
|
|
/**
|
|
* Highlight layer options. This helps customizing the behaviour
|
|
* Highlight layer options. This helps customizing the behaviour
|
|
@@ -4492,24 +4387,129 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class LensFlare {
|
|
|
|
- size: number;
|
|
|
|
- position: number;
|
|
|
|
- color: Color3;
|
|
|
|
- texture: Texture;
|
|
|
|
- alphaMode: number;
|
|
|
|
- private _system;
|
|
|
|
- constructor(size: number, position: number, color: any, imgUrl: string, system: LensFlareSystem);
|
|
|
|
- dispose: () => void;
|
|
|
|
|
|
+declare module BABYLON.Debug {
|
|
|
|
+ class AxesViewer {
|
|
|
|
+ private _xline;
|
|
|
|
+ private _yline;
|
|
|
|
+ private _zline;
|
|
|
|
+ private _xmesh;
|
|
|
|
+ private _ymesh;
|
|
|
|
+ private _zmesh;
|
|
|
|
+ scene: Scene;
|
|
|
|
+ scaleLines: number;
|
|
|
|
+ constructor(scene: Scene, scaleLines?: number);
|
|
|
|
+ update(position: Vector3, xaxis: Vector3, yaxis: Vector3, zaxis: Vector3): void;
|
|
|
|
+ dispose(): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON.Debug {
|
|
|
|
+ class BoneAxesViewer extends Debug.AxesViewer {
|
|
|
|
+ mesh: Mesh;
|
|
|
|
+ bone: Bone;
|
|
|
|
+ pos: Vector3;
|
|
|
|
+ xaxis: Vector3;
|
|
|
|
+ yaxis: Vector3;
|
|
|
|
+ zaxis: Vector3;
|
|
|
|
+ constructor(scene: Scene, bone: Bone, mesh: Mesh, scaleLines?: number);
|
|
|
|
+ update(): void;
|
|
|
|
+ dispose(): void;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- class LensFlareSystem {
|
|
|
|
- name: string;
|
|
|
|
- lensFlares: LensFlare[];
|
|
|
|
- borderLimit: number;
|
|
|
|
|
|
+ class DebugLayer {
|
|
|
|
+ private _scene;
|
|
|
|
+ static InspectorURL: string;
|
|
|
|
+ private _inspector;
|
|
|
|
+ constructor(scene: Scene);
|
|
|
|
+ /** Creates the inspector window. */
|
|
|
|
+ private _createInspector(config?);
|
|
|
|
+ isVisible(): boolean;
|
|
|
|
+ hide(): void;
|
|
|
|
+ show(config?: {
|
|
|
|
+ popup?: boolean;
|
|
|
|
+ initialTab?: number;
|
|
|
|
+ parentElement?: HTMLElement;
|
|
|
|
+ newColors?: {
|
|
|
|
+ backgroundColor?: string;
|
|
|
|
+ backgroundColorLighter?: string;
|
|
|
|
+ backgroundColorLighter2?: string;
|
|
|
|
+ backgroundColorLighter3?: string;
|
|
|
|
+ color?: string;
|
|
|
|
+ colorTop?: string;
|
|
|
|
+ colorBot?: string;
|
|
|
|
+ };
|
|
|
|
+ }): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class RayHelper {
|
|
|
|
+ ray: Ray;
|
|
|
|
+ private _renderPoints;
|
|
|
|
+ private _renderLine;
|
|
|
|
+ private _renderFunction;
|
|
|
|
+ private _scene;
|
|
|
|
+ private _updateToMeshFunction;
|
|
|
|
+ private _attachedToMesh;
|
|
|
|
+ private _meshSpaceDirection;
|
|
|
|
+ private _meshSpaceOrigin;
|
|
|
|
+ static CreateAndShow(ray: Ray, scene: Scene, color: Color3): RayHelper;
|
|
|
|
+ constructor(ray: Ray);
|
|
|
|
+ show(scene: Scene, color: Color3): void;
|
|
|
|
+ hide(): void;
|
|
|
|
+ private _render();
|
|
|
|
+ attachToMesh(mesh: AbstractMesh, meshSpaceDirection?: Vector3, meshSpaceOrigin?: Vector3, length?: number): void;
|
|
|
|
+ detachFromMesh(): void;
|
|
|
|
+ private _updateToMesh();
|
|
|
|
+ dispose(): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON.Debug {
|
|
|
|
+ /**
|
|
|
|
+ * Demo available here: http://www.babylonjs-playground.com/#1BZJVJ#8
|
|
|
|
+ */
|
|
|
|
+ class SkeletonViewer {
|
|
|
|
+ skeleton: Skeleton;
|
|
|
|
+ mesh: AbstractMesh;
|
|
|
|
+ autoUpdateBonesMatrices: boolean;
|
|
|
|
+ renderingGroupId: number;
|
|
|
|
+ color: Color3;
|
|
|
|
+ private _scene;
|
|
|
|
+ private _debugLines;
|
|
|
|
+ private _debugMesh;
|
|
|
|
+ private _isEnabled;
|
|
|
|
+ private _renderFunction;
|
|
|
|
+ constructor(skeleton: Skeleton, mesh: AbstractMesh, scene: Scene, autoUpdateBonesMatrices?: boolean, renderingGroupId?: number);
|
|
|
|
+ isEnabled: boolean;
|
|
|
|
+ private _getBonePosition(position, bone, meshMat, x?, y?, z?);
|
|
|
|
+ private _getLinesForBonesWithLength(bones, meshMat);
|
|
|
|
+ private _getLinesForBonesNoLength(bones, meshMat);
|
|
|
|
+ update(): void;
|
|
|
|
+ dispose(): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class LensFlare {
|
|
|
|
+ size: number;
|
|
|
|
+ position: number;
|
|
|
|
+ color: Color3;
|
|
|
|
+ texture: Texture;
|
|
|
|
+ alphaMode: number;
|
|
|
|
+ private _system;
|
|
|
|
+ constructor(size: number, position: number, color: any, imgUrl: string, system: LensFlareSystem);
|
|
|
|
+ dispose: () => void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class LensFlareSystem {
|
|
|
|
+ name: string;
|
|
|
|
+ lensFlares: LensFlare[];
|
|
|
|
+ borderLimit: number;
|
|
viewportBorder: number;
|
|
viewportBorder: number;
|
|
meshesSelectionPredicate: (mesh: Mesh) => boolean;
|
|
meshesSelectionPredicate: (mesh: Mesh) => boolean;
|
|
layerMask: number;
|
|
layerMask: number;
|
|
@@ -14599,139 +14599,6 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- class VRCameraMetrics {
|
|
|
|
- hResolution: number;
|
|
|
|
- vResolution: number;
|
|
|
|
- hScreenSize: number;
|
|
|
|
- vScreenSize: number;
|
|
|
|
- vScreenCenter: number;
|
|
|
|
- eyeToScreenDistance: number;
|
|
|
|
- lensSeparationDistance: number;
|
|
|
|
- interpupillaryDistance: number;
|
|
|
|
- distortionK: number[];
|
|
|
|
- chromaAbCorrection: number[];
|
|
|
|
- postProcessScaleFactor: number;
|
|
|
|
- lensCenterOffset: number;
|
|
|
|
- compensateDistortion: boolean;
|
|
|
|
- readonly aspectRatio: number;
|
|
|
|
- readonly aspectRatioFov: number;
|
|
|
|
- readonly leftHMatrix: Matrix;
|
|
|
|
- readonly rightHMatrix: Matrix;
|
|
|
|
- readonly leftPreViewMatrix: Matrix;
|
|
|
|
- readonly rightPreViewMatrix: Matrix;
|
|
|
|
- static GetDefault(): VRCameraMetrics;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class VRDeviceOrientationFreeCamera extends DeviceOrientationCamera {
|
|
|
|
- constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
- getClassName(): string;
|
|
|
|
- }
|
|
|
|
- class VRDeviceOrientationGamepadCamera extends VRDeviceOrientationFreeCamera {
|
|
|
|
- constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
- getClassName(): string;
|
|
|
|
- }
|
|
|
|
- class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera {
|
|
|
|
- constructor(name: string, alpha: number, beta: number, radius: number, target: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
- getClassName(): string;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare var HMDVRDevice: any;
|
|
|
|
-declare var VRDisplay: any;
|
|
|
|
-declare var VRFrameData: any;
|
|
|
|
-declare module BABYLON {
|
|
|
|
- /**
|
|
|
|
- * This is a copy of VRPose.
|
|
|
|
- * IMPORTANT!! The data is right-hand data.
|
|
|
|
- * @export
|
|
|
|
- * @interface DevicePose
|
|
|
|
- */
|
|
|
|
- interface DevicePose {
|
|
|
|
- readonly position?: Float32Array;
|
|
|
|
- readonly linearVelocity?: Float32Array;
|
|
|
|
- readonly linearAcceleration?: Float32Array;
|
|
|
|
- readonly orientation?: Float32Array;
|
|
|
|
- readonly angularVelocity?: Float32Array;
|
|
|
|
- readonly angularAcceleration?: Float32Array;
|
|
|
|
- }
|
|
|
|
- interface PoseControlled {
|
|
|
|
- position: Vector3;
|
|
|
|
- rotationQuaternion: Quaternion;
|
|
|
|
- devicePosition?: Vector3;
|
|
|
|
- deviceRotationQuaternion: Quaternion;
|
|
|
|
- rawPose: DevicePose;
|
|
|
|
- deviceScaleFactor: number;
|
|
|
|
- updateFromDevice(poseData: DevicePose): any;
|
|
|
|
- }
|
|
|
|
- interface WebVROptions {
|
|
|
|
- trackPosition?: boolean;
|
|
|
|
- positionScale?: number;
|
|
|
|
- displayName?: string;
|
|
|
|
- controllerMeshes?: boolean;
|
|
|
|
- defaultLightningOnControllers?: boolean;
|
|
|
|
- }
|
|
|
|
- class WebVRFreeCamera extends FreeCamera implements PoseControlled {
|
|
|
|
- private webVROptions;
|
|
|
|
- _vrDevice: any;
|
|
|
|
- rawPose: DevicePose;
|
|
|
|
- private _vrEnabled;
|
|
|
|
- private _specsVersion;
|
|
|
|
- private _attached;
|
|
|
|
- private _oldSize;
|
|
|
|
- private _oldHardwareScaleFactor;
|
|
|
|
- private _frameData;
|
|
|
|
- private _quaternionCache;
|
|
|
|
- private _positionOffset;
|
|
|
|
- protected _descendants: Array<Node>;
|
|
|
|
- devicePosition: Vector3;
|
|
|
|
- deviceRotationQuaternion: any;
|
|
|
|
- deviceScaleFactor: number;
|
|
|
|
- controllers: Array<WebVRController>;
|
|
|
|
- nonVRControllers: Array<Gamepad>;
|
|
|
|
- private _onControllersAttached;
|
|
|
|
- private _onNonVRControllerAttached;
|
|
|
|
- rigParenting: boolean;
|
|
|
|
- private _lightOnControllers;
|
|
|
|
- constructor(name: string, position: Vector3, scene: Scene, webVROptions?: WebVROptions);
|
|
|
|
- onControllersAttached: (controllers: Array<WebVRController>) => void;
|
|
|
|
- onNonVRControllerAttached: (controller: Gamepad) => void;
|
|
|
|
- getControllerByName(name: string): WebVRController;
|
|
|
|
- private _leftController;
|
|
|
|
- readonly leftController: WebVRController;
|
|
|
|
- private _rightController;
|
|
|
|
- readonly rightController: WebVRController;
|
|
|
|
- getForwardRay(length?: number): Ray;
|
|
|
|
- _checkInputs(): void;
|
|
|
|
- updateFromDevice(poseData: DevicePose): void;
|
|
|
|
- /**
|
|
|
|
- * WebVR's attach control will start broadcasting frames to the device.
|
|
|
|
- * Note that in certain browsers (chrome for example) this function must be called
|
|
|
|
- * within a user-interaction callback. Example:
|
|
|
|
- * <pre> scene.onPointerDown = function() { camera.attachControl(canvas); }</pre>
|
|
|
|
- *
|
|
|
|
- * @param {HTMLElement} element
|
|
|
|
- * @param {boolean} [noPreventDefault]
|
|
|
|
- *
|
|
|
|
- * @memberOf WebVRFreeCamera
|
|
|
|
- */
|
|
|
|
- attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
|
- detachControl(element: HTMLElement): void;
|
|
|
|
- getClassName(): string;
|
|
|
|
- resetToCurrentRotation(): void;
|
|
|
|
- _updateRigCameras(): void;
|
|
|
|
- /**
|
|
|
|
- * This function is called by the two RIG cameras.
|
|
|
|
- * 'this' is the left or right camera (and NOT (!!!) the WebVRFreeCamera instance)
|
|
|
|
- */
|
|
|
|
- protected _getWebVRViewMatrix(): Matrix;
|
|
|
|
- protected _getWebVRProjectionMatrix(): Matrix;
|
|
|
|
- initControllers(): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
class ArcRotateCameraGamepadInput implements ICameraInput<ArcRotateCamera> {
|
|
class ArcRotateCameraGamepadInput implements ICameraInput<ArcRotateCamera> {
|
|
camera: ArcRotateCamera;
|
|
camera: ArcRotateCamera;
|
|
gamepad: Gamepad;
|
|
gamepad: Gamepad;
|
|
@@ -14940,6 +14807,139 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
|
|
+ class VRCameraMetrics {
|
|
|
|
+ hResolution: number;
|
|
|
|
+ vResolution: number;
|
|
|
|
+ hScreenSize: number;
|
|
|
|
+ vScreenSize: number;
|
|
|
|
+ vScreenCenter: number;
|
|
|
|
+ eyeToScreenDistance: number;
|
|
|
|
+ lensSeparationDistance: number;
|
|
|
|
+ interpupillaryDistance: number;
|
|
|
|
+ distortionK: number[];
|
|
|
|
+ chromaAbCorrection: number[];
|
|
|
|
+ postProcessScaleFactor: number;
|
|
|
|
+ lensCenterOffset: number;
|
|
|
|
+ compensateDistortion: boolean;
|
|
|
|
+ readonly aspectRatio: number;
|
|
|
|
+ readonly aspectRatioFov: number;
|
|
|
|
+ readonly leftHMatrix: Matrix;
|
|
|
|
+ readonly rightHMatrix: Matrix;
|
|
|
|
+ readonly leftPreViewMatrix: Matrix;
|
|
|
|
+ readonly rightPreViewMatrix: Matrix;
|
|
|
|
+ static GetDefault(): VRCameraMetrics;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class VRDeviceOrientationFreeCamera extends DeviceOrientationCamera {
|
|
|
|
+ constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
+ getClassName(): string;
|
|
|
|
+ }
|
|
|
|
+ class VRDeviceOrientationGamepadCamera extends VRDeviceOrientationFreeCamera {
|
|
|
|
+ constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
+ getClassName(): string;
|
|
|
|
+ }
|
|
|
|
+ class VRDeviceOrientationArcRotateCamera extends ArcRotateCamera {
|
|
|
|
+ constructor(name: string, alpha: number, beta: number, radius: number, target: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
|
+ getClassName(): string;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare var HMDVRDevice: any;
|
|
|
|
+declare var VRDisplay: any;
|
|
|
|
+declare var VRFrameData: any;
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ /**
|
|
|
|
+ * This is a copy of VRPose.
|
|
|
|
+ * IMPORTANT!! The data is right-hand data.
|
|
|
|
+ * @export
|
|
|
|
+ * @interface DevicePose
|
|
|
|
+ */
|
|
|
|
+ interface DevicePose {
|
|
|
|
+ readonly position?: Float32Array;
|
|
|
|
+ readonly linearVelocity?: Float32Array;
|
|
|
|
+ readonly linearAcceleration?: Float32Array;
|
|
|
|
+ readonly orientation?: Float32Array;
|
|
|
|
+ readonly angularVelocity?: Float32Array;
|
|
|
|
+ readonly angularAcceleration?: Float32Array;
|
|
|
|
+ }
|
|
|
|
+ interface PoseControlled {
|
|
|
|
+ position: Vector3;
|
|
|
|
+ rotationQuaternion: Quaternion;
|
|
|
|
+ devicePosition?: Vector3;
|
|
|
|
+ deviceRotationQuaternion: Quaternion;
|
|
|
|
+ rawPose: DevicePose;
|
|
|
|
+ deviceScaleFactor: number;
|
|
|
|
+ updateFromDevice(poseData: DevicePose): any;
|
|
|
|
+ }
|
|
|
|
+ interface WebVROptions {
|
|
|
|
+ trackPosition?: boolean;
|
|
|
|
+ positionScale?: number;
|
|
|
|
+ displayName?: string;
|
|
|
|
+ controllerMeshes?: boolean;
|
|
|
|
+ defaultLightningOnControllers?: boolean;
|
|
|
|
+ }
|
|
|
|
+ class WebVRFreeCamera extends FreeCamera implements PoseControlled {
|
|
|
|
+ private webVROptions;
|
|
|
|
+ _vrDevice: any;
|
|
|
|
+ rawPose: DevicePose;
|
|
|
|
+ private _vrEnabled;
|
|
|
|
+ private _specsVersion;
|
|
|
|
+ private _attached;
|
|
|
|
+ private _oldSize;
|
|
|
|
+ private _oldHardwareScaleFactor;
|
|
|
|
+ private _frameData;
|
|
|
|
+ private _quaternionCache;
|
|
|
|
+ private _positionOffset;
|
|
|
|
+ protected _descendants: Array<Node>;
|
|
|
|
+ devicePosition: Vector3;
|
|
|
|
+ deviceRotationQuaternion: any;
|
|
|
|
+ deviceScaleFactor: number;
|
|
|
|
+ controllers: Array<WebVRController>;
|
|
|
|
+ nonVRControllers: Array<Gamepad>;
|
|
|
|
+ private _onControllersAttached;
|
|
|
|
+ private _onNonVRControllerAttached;
|
|
|
|
+ rigParenting: boolean;
|
|
|
|
+ private _lightOnControllers;
|
|
|
|
+ constructor(name: string, position: Vector3, scene: Scene, webVROptions?: WebVROptions);
|
|
|
|
+ onControllersAttached: (controllers: Array<WebVRController>) => void;
|
|
|
|
+ onNonVRControllerAttached: (controller: Gamepad) => void;
|
|
|
|
+ getControllerByName(name: string): WebVRController;
|
|
|
|
+ private _leftController;
|
|
|
|
+ readonly leftController: WebVRController;
|
|
|
|
+ private _rightController;
|
|
|
|
+ readonly rightController: WebVRController;
|
|
|
|
+ getForwardRay(length?: number): Ray;
|
|
|
|
+ _checkInputs(): void;
|
|
|
|
+ updateFromDevice(poseData: DevicePose): void;
|
|
|
|
+ /**
|
|
|
|
+ * WebVR's attach control will start broadcasting frames to the device.
|
|
|
|
+ * Note that in certain browsers (chrome for example) this function must be called
|
|
|
|
+ * within a user-interaction callback. Example:
|
|
|
|
+ * <pre> scene.onPointerDown = function() { camera.attachControl(canvas); }</pre>
|
|
|
|
+ *
|
|
|
|
+ * @param {HTMLElement} element
|
|
|
|
+ * @param {boolean} [noPreventDefault]
|
|
|
|
+ *
|
|
|
|
+ * @memberOf WebVRFreeCamera
|
|
|
|
+ */
|
|
|
|
+ attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
|
+ detachControl(element: HTMLElement): void;
|
|
|
|
+ getClassName(): string;
|
|
|
|
+ resetToCurrentRotation(): void;
|
|
|
|
+ _updateRigCameras(): void;
|
|
|
|
+ /**
|
|
|
|
+ * This function is called by the two RIG cameras.
|
|
|
|
+ * 'this' is the left or right camera (and NOT (!!!) the WebVRFreeCamera instance)
|
|
|
|
+ */
|
|
|
|
+ protected _getWebVRViewMatrix(): Matrix;
|
|
|
|
+ protected _getWebVRProjectionMatrix(): Matrix;
|
|
|
|
+ initControllers(): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
interface IOctreeContainer<T> {
|
|
interface IOctreeContainer<T> {
|
|
blocks: Array<OctreeBlock<T>>;
|
|
blocks: Array<OctreeBlock<T>>;
|
|
}
|
|
}
|