|
@@ -2448,6 +2448,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;
|
|
@@ -2679,188 +2861,6 @@ 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;
|
|
@@ -4018,149 +4018,35 @@ declare module BABYLON {
|
|
onUpdate(payload: UpdatePayload): void;
|
|
onUpdate(payload: UpdatePayload): void;
|
|
onCollision(payload: CollidePayload): void;
|
|
onCollision(payload: CollidePayload): void;
|
|
}
|
|
}
|
|
- class CollisionDetectorTransferable implements ICollisionDetector {
|
|
|
|
- private _collisionCache;
|
|
|
|
- onInit(payload: InitPayload): void;
|
|
|
|
- onUpdate(payload: UpdatePayload): void;
|
|
|
|
- onCollision(payload: CollidePayload): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class IntersectionInfo {
|
|
|
|
- bu: number;
|
|
|
|
- bv: number;
|
|
|
|
- distance: number;
|
|
|
|
- faceId: number;
|
|
|
|
- subMeshId: number;
|
|
|
|
- constructor(bu: number, bv: number, distance: number);
|
|
|
|
- }
|
|
|
|
- class PickingInfo {
|
|
|
|
- hit: boolean;
|
|
|
|
- distance: number;
|
|
|
|
- pickedPoint: Vector3;
|
|
|
|
- pickedMesh: AbstractMesh;
|
|
|
|
- bu: number;
|
|
|
|
- bv: number;
|
|
|
|
- faceId: number;
|
|
|
|
- subMeshId: number;
|
|
|
|
- pickedSprite: Sprite;
|
|
|
|
- getNormal(useWorldCoordinates?: boolean, useVerticesNormals?: boolean): Vector3;
|
|
|
|
- getTextureCoordinates(): Vector2;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class BoundingBox implements ICullable {
|
|
|
|
- minimum: Vector3;
|
|
|
|
- maximum: Vector3;
|
|
|
|
- vectors: Vector3[];
|
|
|
|
- center: Vector3;
|
|
|
|
- centerWorld: Vector3;
|
|
|
|
- extendSize: Vector3;
|
|
|
|
- extendSizeWorld: Vector3;
|
|
|
|
- directions: Vector3[];
|
|
|
|
- vectorsWorld: Vector3[];
|
|
|
|
- minimumWorld: Vector3;
|
|
|
|
- maximumWorld: Vector3;
|
|
|
|
- private _worldMatrix;
|
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
- getWorldMatrix(): Matrix;
|
|
|
|
- setWorldMatrix(matrix: Matrix): BoundingBox;
|
|
|
|
- _update(world: Matrix): void;
|
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
|
- intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
|
- intersectsMinMax(min: Vector3, max: Vector3): boolean;
|
|
|
|
- static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
|
|
|
|
- static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
|
|
|
|
- static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
|
- static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- interface ICullable {
|
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- }
|
|
|
|
- class BoundingInfo implements ICullable {
|
|
|
|
- minimum: Vector3;
|
|
|
|
- maximum: Vector3;
|
|
|
|
- boundingBox: BoundingBox;
|
|
|
|
- boundingSphere: BoundingSphere;
|
|
|
|
- private _isLocked;
|
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
- isLocked: boolean;
|
|
|
|
- update(world: Matrix): void;
|
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- _checkCollision(collider: Collider): boolean;
|
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
|
- intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class BoundingSphere {
|
|
|
|
- minimum: Vector3;
|
|
|
|
- maximum: Vector3;
|
|
|
|
- center: Vector3;
|
|
|
|
- radius: number;
|
|
|
|
- centerWorld: Vector3;
|
|
|
|
- radiusWorld: number;
|
|
|
|
- private _tempRadiusVector;
|
|
|
|
- constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
- _update(world: Matrix): void;
|
|
|
|
- isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
- intersectsPoint(point: Vector3): boolean;
|
|
|
|
- static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
|
|
|
|
|
|
+ class CollisionDetectorTransferable implements ICollisionDetector {
|
|
|
|
+ private _collisionCache;
|
|
|
|
+ onInit(payload: InitPayload): void;
|
|
|
|
+ onUpdate(payload: UpdatePayload): void;
|
|
|
|
+ onCollision(payload: CollidePayload): void;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- class Ray {
|
|
|
|
- origin: Vector3;
|
|
|
|
- direction: Vector3;
|
|
|
|
- length: number;
|
|
|
|
- private _edge1;
|
|
|
|
- private _edge2;
|
|
|
|
- private _pvec;
|
|
|
|
- private _tvec;
|
|
|
|
- private _qvec;
|
|
|
|
- private _tmpRay;
|
|
|
|
- private _rayHelper;
|
|
|
|
- constructor(origin: Vector3, direction: Vector3, length?: number);
|
|
|
|
- intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean;
|
|
|
|
- intersectsBox(box: BoundingBox): boolean;
|
|
|
|
- intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
|
- intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo;
|
|
|
|
- intersectsPlane(plane: Plane): number;
|
|
|
|
- intersectsMesh(mesh: AbstractMesh, fastCheck?: boolean): PickingInfo;
|
|
|
|
- intersectsMeshes(meshes: Array<AbstractMesh>, fastCheck?: boolean, results?: Array<PickingInfo>): Array<PickingInfo>;
|
|
|
|
- private _comparePickingInfo(pickingInfoA, pickingInfoB);
|
|
|
|
- private static smallnum;
|
|
|
|
- private static rayl;
|
|
|
|
- /**
|
|
|
|
- * Intersection test between the ray and a given segment whithin a given tolerance (threshold)
|
|
|
|
- * @param sega the first point of the segment to test the intersection against
|
|
|
|
- * @param segb the second point of the segment to test the intersection against
|
|
|
|
- * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
|
|
|
|
- * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
|
|
|
|
- */
|
|
|
|
- intersectionSegment(sega: Vector3, segb: Vector3, threshold: number): number;
|
|
|
|
- static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray;
|
|
|
|
- /**
|
|
|
|
- * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
|
|
|
|
- * transformed to the given world matrix.
|
|
|
|
- * @param origin The origin point
|
|
|
|
- * @param end The end point
|
|
|
|
- * @param world a matrix to transform the ray to. Default is the identity matrix.
|
|
|
|
- */
|
|
|
|
- static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray;
|
|
|
|
- static Transform(ray: Ray, matrix: Matrix): Ray;
|
|
|
|
- static TransformToRef(ray: Ray, matrix: Matrix, result: Ray): void;
|
|
|
|
|
|
+ class IntersectionInfo {
|
|
|
|
+ bu: number;
|
|
|
|
+ bv: number;
|
|
|
|
+ distance: number;
|
|
|
|
+ faceId: number;
|
|
|
|
+ subMeshId: number;
|
|
|
|
+ constructor(bu: number, bv: number, distance: number);
|
|
|
|
+ }
|
|
|
|
+ class PickingInfo {
|
|
|
|
+ hit: boolean;
|
|
|
|
+ distance: number;
|
|
|
|
+ pickedPoint: Vector3;
|
|
|
|
+ pickedMesh: AbstractMesh;
|
|
|
|
+ bu: number;
|
|
|
|
+ bv: number;
|
|
|
|
+ faceId: number;
|
|
|
|
+ subMeshId: number;
|
|
|
|
+ pickedSprite: Sprite;
|
|
|
|
+ getNormal(useWorldCoordinates?: boolean, useVerticesNormals?: boolean): Vector3;
|
|
|
|
+ getTextureCoordinates(): Vector2;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -4594,6 +4480,120 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
|
|
+ class BoundingBox implements ICullable {
|
|
|
|
+ minimum: Vector3;
|
|
|
|
+ maximum: Vector3;
|
|
|
|
+ vectors: Vector3[];
|
|
|
|
+ center: Vector3;
|
|
|
|
+ centerWorld: Vector3;
|
|
|
|
+ extendSize: Vector3;
|
|
|
|
+ extendSizeWorld: Vector3;
|
|
|
|
+ directions: Vector3[];
|
|
|
|
+ vectorsWorld: Vector3[];
|
|
|
|
+ minimumWorld: Vector3;
|
|
|
|
+ maximumWorld: Vector3;
|
|
|
|
+ private _worldMatrix;
|
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
+ getWorldMatrix(): Matrix;
|
|
|
|
+ setWorldMatrix(matrix: Matrix): BoundingBox;
|
|
|
|
+ _update(world: Matrix): void;
|
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
|
+ intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
|
+ intersectsMinMax(min: Vector3, max: Vector3): boolean;
|
|
|
|
+ static Intersects(box0: BoundingBox, box1: BoundingBox): boolean;
|
|
|
|
+ static IntersectsSphere(minPoint: Vector3, maxPoint: Vector3, sphereCenter: Vector3, sphereRadius: number): boolean;
|
|
|
|
+ static IsCompletelyInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
|
+ static IsInFrustum(boundingVectors: Vector3[], frustumPlanes: Plane[]): boolean;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ interface ICullable {
|
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ }
|
|
|
|
+ class BoundingInfo implements ICullable {
|
|
|
|
+ minimum: Vector3;
|
|
|
|
+ maximum: Vector3;
|
|
|
|
+ boundingBox: BoundingBox;
|
|
|
|
+ boundingSphere: BoundingSphere;
|
|
|
|
+ private _isLocked;
|
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
+ isLocked: boolean;
|
|
|
|
+ update(world: Matrix): void;
|
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ isCompletelyInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ _checkCollision(collider: Collider): boolean;
|
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
|
+ intersects(boundingInfo: BoundingInfo, precise: boolean): boolean;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class BoundingSphere {
|
|
|
|
+ minimum: Vector3;
|
|
|
|
+ maximum: Vector3;
|
|
|
|
+ center: Vector3;
|
|
|
|
+ radius: number;
|
|
|
|
+ centerWorld: Vector3;
|
|
|
|
+ radiusWorld: number;
|
|
|
|
+ private _tempRadiusVector;
|
|
|
|
+ constructor(minimum: Vector3, maximum: Vector3);
|
|
|
|
+ _update(world: Matrix): void;
|
|
|
|
+ isInFrustum(frustumPlanes: Plane[]): boolean;
|
|
|
|
+ intersectsPoint(point: Vector3): boolean;
|
|
|
|
+ static Intersects(sphere0: BoundingSphere, sphere1: BoundingSphere): boolean;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class Ray {
|
|
|
|
+ origin: Vector3;
|
|
|
|
+ direction: Vector3;
|
|
|
|
+ length: number;
|
|
|
|
+ private _edge1;
|
|
|
|
+ private _edge2;
|
|
|
|
+ private _pvec;
|
|
|
|
+ private _tvec;
|
|
|
|
+ private _qvec;
|
|
|
|
+ private _tmpRay;
|
|
|
|
+ private _rayHelper;
|
|
|
|
+ constructor(origin: Vector3, direction: Vector3, length?: number);
|
|
|
|
+ intersectsBoxMinMax(minimum: Vector3, maximum: Vector3): boolean;
|
|
|
|
+ intersectsBox(box: BoundingBox): boolean;
|
|
|
|
+ intersectsSphere(sphere: BoundingSphere): boolean;
|
|
|
|
+ intersectsTriangle(vertex0: Vector3, vertex1: Vector3, vertex2: Vector3): IntersectionInfo;
|
|
|
|
+ intersectsPlane(plane: Plane): number;
|
|
|
|
+ intersectsMesh(mesh: AbstractMesh, fastCheck?: boolean): PickingInfo;
|
|
|
|
+ intersectsMeshes(meshes: Array<AbstractMesh>, fastCheck?: boolean, results?: Array<PickingInfo>): Array<PickingInfo>;
|
|
|
|
+ private _comparePickingInfo(pickingInfoA, pickingInfoB);
|
|
|
|
+ private static smallnum;
|
|
|
|
+ private static rayl;
|
|
|
|
+ /**
|
|
|
|
+ * Intersection test between the ray and a given segment whithin a given tolerance (threshold)
|
|
|
|
+ * @param sega the first point of the segment to test the intersection against
|
|
|
|
+ * @param segb the second point of the segment to test the intersection against
|
|
|
|
+ * @param threshold the tolerance margin, if the ray doesn't intersect the segment but is close to the given threshold, the intersection is successful
|
|
|
|
+ * @return the distance from the ray origin to the intersection point if there's intersection, or -1 if there's no intersection
|
|
|
|
+ */
|
|
|
|
+ intersectionSegment(sega: Vector3, segb: Vector3, threshold: number): number;
|
|
|
|
+ static CreateNew(x: number, y: number, viewportWidth: number, viewportHeight: number, world: Matrix, view: Matrix, projection: Matrix): Ray;
|
|
|
|
+ /**
|
|
|
|
+ * Function will create a new transformed ray starting from origin and ending at the end point. Ray's length will be set, and ray will be
|
|
|
|
+ * transformed to the given world matrix.
|
|
|
|
+ * @param origin The origin point
|
|
|
|
+ * @param end The end point
|
|
|
|
+ * @param world a matrix to transform the ray to. Default is the identity matrix.
|
|
|
|
+ */
|
|
|
|
+ static CreateNewFromTo(origin: Vector3, end: Vector3, world?: Matrix): Ray;
|
|
|
|
+ static Transform(ray: Ray, matrix: Matrix): Ray;
|
|
|
|
+ static TransformToRef(ray: Ray, matrix: Matrix, result: Ray): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
class DirectionalLight extends ShadowLight {
|
|
class DirectionalLight extends ShadowLight {
|
|
private _shadowFrustumSize;
|
|
private _shadowFrustumSize;
|
|
/**
|
|
/**
|
|
@@ -13059,36 +13059,6 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
- samples: number;
|
|
|
|
- refreshRate: number;
|
|
|
|
- getScene(): Scene;
|
|
|
|
- readonly cubeTexture: RenderTargetTexture;
|
|
|
|
- readonly renderList: AbstractMesh[];
|
|
|
|
- attachToMesh(mesh: AbstractMesh): void;
|
|
|
|
- /**
|
|
|
|
- * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
|
|
|
|
- *
|
|
|
|
- * @param renderingGroupId The rendering group id corresponding to its index
|
|
|
|
- * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
|
|
|
|
- */
|
|
|
|
- setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean): void;
|
|
|
|
- dispose(): void;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
class AnaglyphPostProcess extends PostProcess {
|
|
class AnaglyphPostProcess extends PostProcess {
|
|
private _passedProcess;
|
|
private _passedProcess;
|
|
constructor(name: string, options: number | PostProcessOptions, rigCameras: Camera[], samplingMode?: number, engine?: Engine, reusable?: boolean);
|
|
constructor(name: string, options: number | PostProcessOptions, rigCameras: Camera[], samplingMode?: number, engine?: Engine, reusable?: boolean);
|
|
@@ -13612,6 +13582,36 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
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);
|
|
|
|
+ samples: number;
|
|
|
|
+ refreshRate: number;
|
|
|
|
+ getScene(): Scene;
|
|
|
|
+ readonly cubeTexture: RenderTargetTexture;
|
|
|
|
+ readonly renderList: AbstractMesh[];
|
|
|
|
+ attachToMesh(mesh: AbstractMesh): void;
|
|
|
|
+ /**
|
|
|
|
+ * Specifies whether or not the stencil and depth buffer are cleared between two rendering groups.
|
|
|
|
+ *
|
|
|
|
+ * @param renderingGroupId The rendering group id corresponding to its index
|
|
|
|
+ * @param autoClearDepthStencil Automatically clears depth and stencil between groups if true.
|
|
|
|
+ */
|
|
|
|
+ setRenderingAutoClearDepthStencil(renderingGroupId: number, autoClearDepthStencil: boolean): void;
|
|
|
|
+ dispose(): void;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
class BoundingBoxRenderer {
|
|
class BoundingBoxRenderer {
|
|
frontColor: Color3;
|
|
frontColor: Color3;
|
|
backColor: Color3;
|
|
backColor: Color3;
|