|
@@ -13930,14 +13930,13 @@ declare module BABYLON {
|
|
|
rotation?: Vector3;
|
|
|
parent?: any;
|
|
|
getBoundingInfo(): Nullable<BoundingInfo>;
|
|
|
- computeWorldMatrix(force: boolean): Matrix;
|
|
|
+ computeWorldMatrix?(force: boolean): void;
|
|
|
getWorldMatrix?(): Matrix;
|
|
|
getChildMeshes?(directDescendantsOnly?: boolean): Array<AbstractMesh>;
|
|
|
getVerticesData(kind: string): Nullable<Array<number> | Float32Array>;
|
|
|
getIndices?(): Nullable<IndicesArray>;
|
|
|
getScene?(): Scene;
|
|
|
getAbsolutePosition(): Vector3;
|
|
|
- getAbsolutePivotPoint(): Vector3;
|
|
|
}
|
|
|
class PhysicsImpostor {
|
|
|
object: IPhysicsEnabledObject;
|
|
@@ -14228,36 +14227,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);
|
|
|
- samples: number;
|
|
|
- refreshRate: number;
|
|
|
- getScene(): Scene;
|
|
|
- readonly cubeTexture: RenderTargetTexture;
|
|
|
- readonly renderList: Nullable<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 {
|
|
|
private _passedProcess;
|
|
|
constructor(name: string, options: number | PostProcessOptions, rigCameras: Camera[], samplingMode?: number, engine?: Engine, reusable?: boolean);
|
|
@@ -14784,6 +14753,36 @@ 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: Nullable<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 {
|
|
|
frontColor: Color3;
|
|
|
backColor: Color3;
|
|
@@ -15047,6 +15046,75 @@ declare module BABYLON {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+declare module BABYLON {
|
|
|
+ class Sprite {
|
|
|
+ name: string;
|
|
|
+ position: Vector3;
|
|
|
+ color: Color4;
|
|
|
+ width: number;
|
|
|
+ height: number;
|
|
|
+ angle: number;
|
|
|
+ cellIndex: number;
|
|
|
+ invertU: number;
|
|
|
+ invertV: number;
|
|
|
+ disposeWhenFinishedAnimating: boolean;
|
|
|
+ animations: Animation[];
|
|
|
+ isPickable: boolean;
|
|
|
+ actionManager: ActionManager;
|
|
|
+ private _animationStarted;
|
|
|
+ private _loopAnimation;
|
|
|
+ private _fromIndex;
|
|
|
+ private _toIndex;
|
|
|
+ private _delay;
|
|
|
+ private _direction;
|
|
|
+ private _manager;
|
|
|
+ private _time;
|
|
|
+ private _onAnimationEnd;
|
|
|
+ size: number;
|
|
|
+ constructor(name: string, manager: SpriteManager);
|
|
|
+ playAnimation(from: number, to: number, loop: boolean, delay: number, onAnimationEnd: () => void): void;
|
|
|
+ stopAnimation(): void;
|
|
|
+ _animate(deltaTime: number): void;
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class SpriteManager {
|
|
|
+ name: string;
|
|
|
+ sprites: Sprite[];
|
|
|
+ renderingGroupId: number;
|
|
|
+ layerMask: number;
|
|
|
+ fogEnabled: boolean;
|
|
|
+ isPickable: boolean;
|
|
|
+ cellWidth: number;
|
|
|
+ cellHeight: number;
|
|
|
+ /**
|
|
|
+ * An event triggered when the manager is disposed.
|
|
|
+ * @type {BABYLON.Observable}
|
|
|
+ */
|
|
|
+ onDisposeObservable: Observable<SpriteManager>;
|
|
|
+ private _onDisposeObserver;
|
|
|
+ onDispose: () => void;
|
|
|
+ private _capacity;
|
|
|
+ private _spriteTexture;
|
|
|
+ private _epsilon;
|
|
|
+ private _scene;
|
|
|
+ private _vertexData;
|
|
|
+ private _buffer;
|
|
|
+ private _vertexBuffers;
|
|
|
+ private _indexBuffer;
|
|
|
+ private _effectBase;
|
|
|
+ private _effectFog;
|
|
|
+ texture: Texture;
|
|
|
+ constructor(name: string, imgUrl: string, capacity: number, cellSize: any, scene: Scene, epsilon?: number, samplingMode?: number);
|
|
|
+ private _appendSpriteVertex(index, sprite, offsetX, offsetY, rowSize);
|
|
|
+ intersects(ray: Ray, camera: Camera, predicate?: (sprite: Sprite) => boolean, fastCheck?: boolean): Nullable<PickingInfo>;
|
|
|
+ render(): void;
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
declare module BABYLON.Internals {
|
|
|
class _AlphaState {
|
|
|
private _isAlphaBlendDirty;
|
|
@@ -16272,75 +16340,6 @@ declare module BABYLON {
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class Sprite {
|
|
|
- name: string;
|
|
|
- position: Vector3;
|
|
|
- color: Color4;
|
|
|
- width: number;
|
|
|
- height: number;
|
|
|
- angle: number;
|
|
|
- cellIndex: number;
|
|
|
- invertU: number;
|
|
|
- invertV: number;
|
|
|
- disposeWhenFinishedAnimating: boolean;
|
|
|
- animations: Animation[];
|
|
|
- isPickable: boolean;
|
|
|
- actionManager: ActionManager;
|
|
|
- private _animationStarted;
|
|
|
- private _loopAnimation;
|
|
|
- private _fromIndex;
|
|
|
- private _toIndex;
|
|
|
- private _delay;
|
|
|
- private _direction;
|
|
|
- private _manager;
|
|
|
- private _time;
|
|
|
- private _onAnimationEnd;
|
|
|
- size: number;
|
|
|
- constructor(name: string, manager: SpriteManager);
|
|
|
- playAnimation(from: number, to: number, loop: boolean, delay: number, onAnimationEnd: () => void): void;
|
|
|
- stopAnimation(): void;
|
|
|
- _animate(deltaTime: number): void;
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class SpriteManager {
|
|
|
- name: string;
|
|
|
- sprites: Sprite[];
|
|
|
- renderingGroupId: number;
|
|
|
- layerMask: number;
|
|
|
- fogEnabled: boolean;
|
|
|
- isPickable: boolean;
|
|
|
- cellWidth: number;
|
|
|
- cellHeight: number;
|
|
|
- /**
|
|
|
- * An event triggered when the manager is disposed.
|
|
|
- * @type {BABYLON.Observable}
|
|
|
- */
|
|
|
- onDisposeObservable: Observable<SpriteManager>;
|
|
|
- private _onDisposeObserver;
|
|
|
- onDispose: () => void;
|
|
|
- private _capacity;
|
|
|
- private _spriteTexture;
|
|
|
- private _epsilon;
|
|
|
- private _scene;
|
|
|
- private _vertexData;
|
|
|
- private _buffer;
|
|
|
- private _vertexBuffers;
|
|
|
- private _indexBuffer;
|
|
|
- private _effectBase;
|
|
|
- private _effectFog;
|
|
|
- texture: Texture;
|
|
|
- constructor(name: string, imgUrl: string, capacity: number, cellSize: any, scene: Scene, epsilon?: number, samplingMode?: number);
|
|
|
- private _appendSpriteVertex(index, sprite, offsetX, offsetY, rowSize);
|
|
|
- intersects(ray: Ray, camera: Camera, predicate?: (sprite: Sprite) => boolean, fastCheck?: boolean): Nullable<PickingInfo>;
|
|
|
- render(): void;
|
|
|
- dispose(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
class AutoRotationBehavior implements Behavior<ArcRotateCamera> {
|
|
|
readonly name: string;
|
|
|
private _zoomStopsAnimation;
|
|
@@ -16625,265 +16624,44 @@ 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;
|
|
|
+ class ArcRotateCameraGamepadInput implements ICameraInput<ArcRotateCamera> {
|
|
|
+ camera: ArcRotateCamera;
|
|
|
+ gamepad: Nullable<Gamepad>;
|
|
|
+ private _onGamepadConnectedObserver;
|
|
|
+ private _onGamepadDisconnectedObserver;
|
|
|
+ gamepadRotationSensibility: number;
|
|
|
+ gamepadMoveSensibility: number;
|
|
|
+ attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
+ detachControl(element: HTMLElement): void;
|
|
|
+ checkInputs(): void;
|
|
|
+ getClassName(): string;
|
|
|
+ getSimpleName(): string;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
|
- class VRDeviceOrientationFreeCamera extends DeviceOrientationCamera {
|
|
|
- constructor(name: string, position: Vector3, scene: Scene, compensateDistortion?: boolean, vrCameraMetrics?: VRCameraMetrics);
|
|
|
+ class ArcRotateCameraKeyboardMoveInput implements ICameraInput<ArcRotateCamera> {
|
|
|
+ camera: ArcRotateCamera;
|
|
|
+ private _keys;
|
|
|
+ keysUp: number[];
|
|
|
+ keysDown: number[];
|
|
|
+ keysLeft: number[];
|
|
|
+ keysRight: number[];
|
|
|
+ keysReset: number[];
|
|
|
+ panningSensibility: number;
|
|
|
+ zoomingSensibility: number;
|
|
|
+ useAltToZoom: boolean;
|
|
|
+ private _ctrlPressed;
|
|
|
+ private _altPressed;
|
|
|
+ private _onCanvasBlurObserver;
|
|
|
+ private _onKeyboardObserver;
|
|
|
+ private _engine;
|
|
|
+ private _scene;
|
|
|
+ attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
+ detachControl(element: HTMLElement): void;
|
|
|
+ checkInputs(): void;
|
|
|
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 module BABYLON {
|
|
|
- class VRExperienceHelper {
|
|
|
- webVROptions: WebVROptions;
|
|
|
- private _scene;
|
|
|
- private _position;
|
|
|
- private _btnVR;
|
|
|
- private _webVRsupported;
|
|
|
- private _webVRready;
|
|
|
- private _webVRrequesting;
|
|
|
- private _webVRpresenting;
|
|
|
- private _fullscreenVRpresenting;
|
|
|
- private _canvas;
|
|
|
- private _webVRCamera;
|
|
|
- private _vrDeviceOrientationCamera;
|
|
|
- private _deviceOrientationCamera;
|
|
|
- private _onKeyDown;
|
|
|
- private _onVrDisplayPresentChange;
|
|
|
- private _onVRDisplayChanged;
|
|
|
- private _onVRRequestPresentStart;
|
|
|
- private _onVRRequestPresentComplete;
|
|
|
- onEnteringVR: () => void;
|
|
|
- onExitingVR: () => void;
|
|
|
- onControllerMeshLoaded: (controller: WebVRController) => void;
|
|
|
- constructor(scene: Scene, webVROptions?: WebVROptions);
|
|
|
- private _onDefaultMeshLoaded(webVRController);
|
|
|
- private _onFullscreenChange();
|
|
|
- private isInVRMode();
|
|
|
- private onVrDisplayPresentChange();
|
|
|
- private onVRDisplayChanged(eventArgs);
|
|
|
- private updateButtonVisibility();
|
|
|
- /**
|
|
|
- * Attempt to enter VR. If a headset is connected and ready, will request present on that.
|
|
|
- * Otherwise, will use the fullscreen API.
|
|
|
- */
|
|
|
- enterVR(): void;
|
|
|
- /**
|
|
|
- * Attempt to exit VR, or fullscreen.
|
|
|
- */
|
|
|
- exitVR(): void;
|
|
|
- position: Vector3;
|
|
|
- dispose(): void;
|
|
|
- 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: Nullable<DevicePose>;
|
|
|
- deviceScaleFactor: number;
|
|
|
- updateFromDevice(poseData: DevicePose): void;
|
|
|
- }
|
|
|
- interface WebVROptions {
|
|
|
- trackPosition?: boolean;
|
|
|
- positionScale?: number;
|
|
|
- displayName?: string;
|
|
|
- controllerMeshes?: boolean;
|
|
|
- defaultLightingOnControllers?: boolean;
|
|
|
- }
|
|
|
- class WebVRFreeCamera extends FreeCamera implements PoseControlled {
|
|
|
- private webVROptions;
|
|
|
- _vrDevice: any;
|
|
|
- rawPose: Nullable<DevicePose>;
|
|
|
- private _onVREnabled;
|
|
|
- private _specsVersion;
|
|
|
- private _attached;
|
|
|
- private _frameData;
|
|
|
- protected _descendants: Array<Node>;
|
|
|
- devicePosition: Vector3;
|
|
|
- deviceRotationQuaternion: Quaternion;
|
|
|
- deviceScaleFactor: number;
|
|
|
- controllers: Array<WebVRController>;
|
|
|
- onControllersAttachedObservable: Observable<WebVRController[]>;
|
|
|
- onControllerMeshLoadedObservable: Observable<WebVRController>;
|
|
|
- rigParenting: boolean;
|
|
|
- private _lightOnControllers;
|
|
|
- constructor(name: string, position: Vector3, scene: Scene, webVROptions?: WebVROptions);
|
|
|
- dispose(): void;
|
|
|
- getControllerByName(name: string): Nullable<WebVRController>;
|
|
|
- private _leftController;
|
|
|
- readonly leftController: Nullable<WebVRController>;
|
|
|
- private _rightController;
|
|
|
- readonly rightController: Nullable<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;
|
|
|
- private _onGamepadConnectedObserver;
|
|
|
- private _onGamepadDisconnectedObserver;
|
|
|
- initControllers(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- interface IOctreeContainer<T> {
|
|
|
- blocks: Array<OctreeBlock<T>>;
|
|
|
- }
|
|
|
- class Octree<T> {
|
|
|
- maxDepth: number;
|
|
|
- blocks: Array<OctreeBlock<T>>;
|
|
|
- dynamicContent: T[];
|
|
|
- private _maxBlockCapacity;
|
|
|
- private _selectionContent;
|
|
|
- private _creationFunc;
|
|
|
- constructor(creationFunc: (entry: T, block: OctreeBlock<T>) => void, maxBlockCapacity?: number, maxDepth?: number);
|
|
|
- update(worldMin: Vector3, worldMax: Vector3, entries: T[]): void;
|
|
|
- addMesh(entry: T): void;
|
|
|
- select(frustumPlanes: Plane[], allowDuplicate?: boolean): SmartArray<T>;
|
|
|
- intersects(sphereCenter: Vector3, sphereRadius: number, allowDuplicate?: boolean): SmartArray<T>;
|
|
|
- intersectsRay(ray: Ray): SmartArray<T>;
|
|
|
- static _CreateBlocks<T>(worldMin: Vector3, worldMax: Vector3, entries: T[], maxBlockCapacity: number, currentDepth: number, maxDepth: number, target: IOctreeContainer<T>, creationFunc: (entry: T, block: OctreeBlock<T>) => void): void;
|
|
|
- static CreationFuncForMeshes: (entry: AbstractMesh, block: OctreeBlock<AbstractMesh>) => void;
|
|
|
- static CreationFuncForSubMeshes: (entry: SubMesh, block: OctreeBlock<SubMesh>) => void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class OctreeBlock<T> {
|
|
|
- entries: T[];
|
|
|
- blocks: Array<OctreeBlock<T>>;
|
|
|
- private _depth;
|
|
|
- private _maxDepth;
|
|
|
- private _capacity;
|
|
|
- private _minPoint;
|
|
|
- private _maxPoint;
|
|
|
- private _boundingVectors;
|
|
|
- private _creationFunc;
|
|
|
- constructor(minPoint: Vector3, maxPoint: Vector3, capacity: number, depth: number, maxDepth: number, creationFunc: (entry: T, block: OctreeBlock<T>) => void);
|
|
|
- readonly capacity: number;
|
|
|
- readonly minPoint: Vector3;
|
|
|
- readonly maxPoint: Vector3;
|
|
|
- addEntry(entry: T): void;
|
|
|
- addEntries(entries: T[]): void;
|
|
|
- select(frustumPlanes: Plane[], selection: SmartArray<T>, allowDuplicate?: boolean): void;
|
|
|
- intersects(sphereCenter: Vector3, sphereRadius: number, selection: SmartArray<T>, allowDuplicate?: boolean): void;
|
|
|
- intersectsRay(ray: Ray, selection: SmartArray<T>): void;
|
|
|
- createInnerBlocks(): void;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class ArcRotateCameraGamepadInput implements ICameraInput<ArcRotateCamera> {
|
|
|
- camera: ArcRotateCamera;
|
|
|
- gamepad: Nullable<Gamepad>;
|
|
|
- private _onGamepadConnectedObserver;
|
|
|
- private _onGamepadDisconnectedObserver;
|
|
|
- gamepadRotationSensibility: number;
|
|
|
- gamepadMoveSensibility: number;
|
|
|
- attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
- detachControl(element: HTMLElement): void;
|
|
|
- checkInputs(): void;
|
|
|
- getClassName(): string;
|
|
|
- getSimpleName(): string;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-declare module BABYLON {
|
|
|
- class ArcRotateCameraKeyboardMoveInput implements ICameraInput<ArcRotateCamera> {
|
|
|
- camera: ArcRotateCamera;
|
|
|
- private _keys;
|
|
|
- keysUp: number[];
|
|
|
- keysDown: number[];
|
|
|
- keysLeft: number[];
|
|
|
- keysRight: number[];
|
|
|
- keysReset: number[];
|
|
|
- panningSensibility: number;
|
|
|
- zoomingSensibility: number;
|
|
|
- useAltToZoom: boolean;
|
|
|
- private _ctrlPressed;
|
|
|
- private _altPressed;
|
|
|
- private _onCanvasBlurObserver;
|
|
|
- private _onKeyboardObserver;
|
|
|
- private _engine;
|
|
|
- private _scene;
|
|
|
- attachControl(element: HTMLElement, noPreventDefault?: boolean): void;
|
|
|
- detachControl(element: HTMLElement): void;
|
|
|
- checkInputs(): void;
|
|
|
- getClassName(): string;
|
|
|
- getSimpleName(): string;
|
|
|
+ getSimpleName(): string;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -17078,6 +16856,227 @@ 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 module BABYLON {
|
|
|
+ class VRExperienceHelper {
|
|
|
+ webVROptions: WebVROptions;
|
|
|
+ private _scene;
|
|
|
+ private _position;
|
|
|
+ private _btnVR;
|
|
|
+ private _webVRsupported;
|
|
|
+ private _webVRready;
|
|
|
+ private _webVRrequesting;
|
|
|
+ private _webVRpresenting;
|
|
|
+ private _fullscreenVRpresenting;
|
|
|
+ private _canvas;
|
|
|
+ private _webVRCamera;
|
|
|
+ private _vrDeviceOrientationCamera;
|
|
|
+ private _deviceOrientationCamera;
|
|
|
+ private _onKeyDown;
|
|
|
+ private _onVrDisplayPresentChange;
|
|
|
+ private _onVRDisplayChanged;
|
|
|
+ private _onVRRequestPresentStart;
|
|
|
+ private _onVRRequestPresentComplete;
|
|
|
+ onEnteringVR: () => void;
|
|
|
+ onExitingVR: () => void;
|
|
|
+ onControllerMeshLoaded: (controller: WebVRController) => void;
|
|
|
+ constructor(scene: Scene, webVROptions?: WebVROptions);
|
|
|
+ private _onDefaultMeshLoaded(webVRController);
|
|
|
+ private _onFullscreenChange();
|
|
|
+ private isInVRMode();
|
|
|
+ private onVrDisplayPresentChange();
|
|
|
+ private onVRDisplayChanged(eventArgs);
|
|
|
+ private updateButtonVisibility();
|
|
|
+ /**
|
|
|
+ * Attempt to enter VR. If a headset is connected and ready, will request present on that.
|
|
|
+ * Otherwise, will use the fullscreen API.
|
|
|
+ */
|
|
|
+ enterVR(): void;
|
|
|
+ /**
|
|
|
+ * Attempt to exit VR, or fullscreen.
|
|
|
+ */
|
|
|
+ exitVR(): void;
|
|
|
+ position: Vector3;
|
|
|
+ dispose(): void;
|
|
|
+ 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: Nullable<DevicePose>;
|
|
|
+ deviceScaleFactor: number;
|
|
|
+ updateFromDevice(poseData: DevicePose): void;
|
|
|
+ }
|
|
|
+ interface WebVROptions {
|
|
|
+ trackPosition?: boolean;
|
|
|
+ positionScale?: number;
|
|
|
+ displayName?: string;
|
|
|
+ controllerMeshes?: boolean;
|
|
|
+ defaultLightingOnControllers?: boolean;
|
|
|
+ }
|
|
|
+ class WebVRFreeCamera extends FreeCamera implements PoseControlled {
|
|
|
+ private webVROptions;
|
|
|
+ _vrDevice: any;
|
|
|
+ rawPose: Nullable<DevicePose>;
|
|
|
+ private _onVREnabled;
|
|
|
+ private _specsVersion;
|
|
|
+ private _attached;
|
|
|
+ private _frameData;
|
|
|
+ protected _descendants: Array<Node>;
|
|
|
+ devicePosition: Vector3;
|
|
|
+ deviceRotationQuaternion: Quaternion;
|
|
|
+ deviceScaleFactor: number;
|
|
|
+ controllers: Array<WebVRController>;
|
|
|
+ onControllersAttachedObservable: Observable<WebVRController[]>;
|
|
|
+ onControllerMeshLoadedObservable: Observable<WebVRController>;
|
|
|
+ rigParenting: boolean;
|
|
|
+ private _lightOnControllers;
|
|
|
+ constructor(name: string, position: Vector3, scene: Scene, webVROptions?: WebVROptions);
|
|
|
+ dispose(): void;
|
|
|
+ getControllerByName(name: string): Nullable<WebVRController>;
|
|
|
+ private _leftController;
|
|
|
+ readonly leftController: Nullable<WebVRController>;
|
|
|
+ private _rightController;
|
|
|
+ readonly rightController: Nullable<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;
|
|
|
+ private _onGamepadConnectedObserver;
|
|
|
+ private _onGamepadDisconnectedObserver;
|
|
|
+ initControllers(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ interface IOctreeContainer<T> {
|
|
|
+ blocks: Array<OctreeBlock<T>>;
|
|
|
+ }
|
|
|
+ class Octree<T> {
|
|
|
+ maxDepth: number;
|
|
|
+ blocks: Array<OctreeBlock<T>>;
|
|
|
+ dynamicContent: T[];
|
|
|
+ private _maxBlockCapacity;
|
|
|
+ private _selectionContent;
|
|
|
+ private _creationFunc;
|
|
|
+ constructor(creationFunc: (entry: T, block: OctreeBlock<T>) => void, maxBlockCapacity?: number, maxDepth?: number);
|
|
|
+ update(worldMin: Vector3, worldMax: Vector3, entries: T[]): void;
|
|
|
+ addMesh(entry: T): void;
|
|
|
+ select(frustumPlanes: Plane[], allowDuplicate?: boolean): SmartArray<T>;
|
|
|
+ intersects(sphereCenter: Vector3, sphereRadius: number, allowDuplicate?: boolean): SmartArray<T>;
|
|
|
+ intersectsRay(ray: Ray): SmartArray<T>;
|
|
|
+ static _CreateBlocks<T>(worldMin: Vector3, worldMax: Vector3, entries: T[], maxBlockCapacity: number, currentDepth: number, maxDepth: number, target: IOctreeContainer<T>, creationFunc: (entry: T, block: OctreeBlock<T>) => void): void;
|
|
|
+ static CreationFuncForMeshes: (entry: AbstractMesh, block: OctreeBlock<AbstractMesh>) => void;
|
|
|
+ static CreationFuncForSubMeshes: (entry: SubMesh, block: OctreeBlock<SubMesh>) => void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
+ class OctreeBlock<T> {
|
|
|
+ entries: T[];
|
|
|
+ blocks: Array<OctreeBlock<T>>;
|
|
|
+ private _depth;
|
|
|
+ private _maxDepth;
|
|
|
+ private _capacity;
|
|
|
+ private _minPoint;
|
|
|
+ private _maxPoint;
|
|
|
+ private _boundingVectors;
|
|
|
+ private _creationFunc;
|
|
|
+ constructor(minPoint: Vector3, maxPoint: Vector3, capacity: number, depth: number, maxDepth: number, creationFunc: (entry: T, block: OctreeBlock<T>) => void);
|
|
|
+ readonly capacity: number;
|
|
|
+ readonly minPoint: Vector3;
|
|
|
+ readonly maxPoint: Vector3;
|
|
|
+ addEntry(entry: T): void;
|
|
|
+ addEntries(entries: T[]): void;
|
|
|
+ select(frustumPlanes: Plane[], selection: SmartArray<T>, allowDuplicate?: boolean): void;
|
|
|
+ intersects(sphereCenter: Vector3, sphereRadius: number, selection: SmartArray<T>, allowDuplicate?: boolean): void;
|
|
|
+ intersectsRay(ray: Ray, selection: SmartArray<T>): void;
|
|
|
+ createInnerBlocks(): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+declare module BABYLON {
|
|
|
class GenericController extends WebVRController {
|
|
|
static readonly MODEL_BASE_URL: string;
|
|
|
static readonly MODEL_FILENAME: string;
|