|
@@ -3967,6 +3967,69 @@ declare module BABYLON.Debug {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
|
|
+ class KeyboardEventTypes {
|
|
|
|
+ static _KEYDOWN: number;
|
|
|
|
+ static _KEYUP: number;
|
|
|
|
+ static readonly KEYDOWN: number;
|
|
|
|
+ static readonly KEYUP: number;
|
|
|
|
+ }
|
|
|
|
+ class KeyboardInfo {
|
|
|
|
+ type: number;
|
|
|
|
+ event: KeyboardEvent;
|
|
|
|
+ constructor(type: number, event: KeyboardEvent);
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * This class is used to store keyboard related info for the onPreKeyboardObservable event.
|
|
|
|
+ * Set the skipOnKeyboardObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onKeyboardObservable
|
|
|
|
+ */
|
|
|
|
+ class KeyboardInfoPre extends KeyboardInfo {
|
|
|
|
+ constructor(type: number, event: KeyboardEvent);
|
|
|
|
+ skipOnPointerObservable: boolean;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
|
|
+ class PointerEventTypes {
|
|
|
|
+ static _POINTERDOWN: number;
|
|
|
|
+ static _POINTERUP: number;
|
|
|
|
+ static _POINTERMOVE: number;
|
|
|
|
+ static _POINTERWHEEL: number;
|
|
|
|
+ static _POINTERPICK: number;
|
|
|
|
+ static _POINTERTAP: number;
|
|
|
|
+ static _POINTERDOUBLETAP: number;
|
|
|
|
+ static readonly POINTERDOWN: number;
|
|
|
|
+ static readonly POINTERUP: number;
|
|
|
|
+ static readonly POINTERMOVE: number;
|
|
|
|
+ static readonly POINTERWHEEL: number;
|
|
|
|
+ static readonly POINTERPICK: number;
|
|
|
|
+ static readonly POINTERTAP: number;
|
|
|
|
+ static readonly POINTERDOUBLETAP: number;
|
|
|
|
+ }
|
|
|
|
+ class PointerInfoBase {
|
|
|
|
+ type: number;
|
|
|
|
+ event: PointerEvent | MouseWheelEvent;
|
|
|
|
+ constructor(type: number, event: PointerEvent | MouseWheelEvent);
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * This class is used to store pointer related info for the onPrePointerObservable event.
|
|
|
|
+ * Set the skipOnPointerObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onPointerObservable
|
|
|
|
+ */
|
|
|
|
+ class PointerInfoPre extends PointerInfoBase {
|
|
|
|
+ constructor(type: number, event: PointerEvent | MouseWheelEvent, localX: number, localY: number);
|
|
|
|
+ localPosition: Vector2;
|
|
|
|
+ skipOnPointerObservable: boolean;
|
|
|
|
+ }
|
|
|
|
+ /**
|
|
|
|
+ * This type contains all the data related to a pointer event in Babylon.js.
|
|
|
|
+ * The event member is an instance of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel. The different event types can be found in the PointerEventTypes class.
|
|
|
|
+ */
|
|
|
|
+ class PointerInfo extends PointerInfoBase {
|
|
|
|
+ pickInfo: Nullable<PickingInfo>;
|
|
|
|
+ constructor(type: number, event: PointerEvent | MouseWheelEvent, pickInfo: Nullable<PickingInfo>);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+declare module BABYLON {
|
|
class InstancingAttributeInfo {
|
|
class InstancingAttributeInfo {
|
|
/**
|
|
/**
|
|
* Index/offset of the attribute in the vertex shader
|
|
* Index/offset of the attribute in the vertex shader
|
|
@@ -4812,69 +4875,6 @@ declare var WebGLVertexArrayObject: {
|
|
};
|
|
};
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- class KeyboardEventTypes {
|
|
|
|
- static _KEYDOWN: number;
|
|
|
|
- static _KEYUP: number;
|
|
|
|
- static readonly KEYDOWN: number;
|
|
|
|
- static readonly KEYUP: number;
|
|
|
|
- }
|
|
|
|
- class KeyboardInfo {
|
|
|
|
- type: number;
|
|
|
|
- event: KeyboardEvent;
|
|
|
|
- constructor(type: number, event: KeyboardEvent);
|
|
|
|
- }
|
|
|
|
- /**
|
|
|
|
- * This class is used to store keyboard related info for the onPreKeyboardObservable event.
|
|
|
|
- * Set the skipOnKeyboardObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onKeyboardObservable
|
|
|
|
- */
|
|
|
|
- class KeyboardInfoPre extends KeyboardInfo {
|
|
|
|
- constructor(type: number, event: KeyboardEvent);
|
|
|
|
- skipOnPointerObservable: boolean;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
- class PointerEventTypes {
|
|
|
|
- static _POINTERDOWN: number;
|
|
|
|
- static _POINTERUP: number;
|
|
|
|
- static _POINTERMOVE: number;
|
|
|
|
- static _POINTERWHEEL: number;
|
|
|
|
- static _POINTERPICK: number;
|
|
|
|
- static _POINTERTAP: number;
|
|
|
|
- static _POINTERDOUBLETAP: number;
|
|
|
|
- static readonly POINTERDOWN: number;
|
|
|
|
- static readonly POINTERUP: number;
|
|
|
|
- static readonly POINTERMOVE: number;
|
|
|
|
- static readonly POINTERWHEEL: number;
|
|
|
|
- static readonly POINTERPICK: number;
|
|
|
|
- static readonly POINTERTAP: number;
|
|
|
|
- static readonly POINTERDOUBLETAP: number;
|
|
|
|
- }
|
|
|
|
- class PointerInfoBase {
|
|
|
|
- type: number;
|
|
|
|
- event: PointerEvent | MouseWheelEvent;
|
|
|
|
- constructor(type: number, event: PointerEvent | MouseWheelEvent);
|
|
|
|
- }
|
|
|
|
- /**
|
|
|
|
- * This class is used to store pointer related info for the onPrePointerObservable event.
|
|
|
|
- * Set the skipOnPointerObservable property to true if you want the engine to stop any process after this event is triggered, even not calling onPointerObservable
|
|
|
|
- */
|
|
|
|
- class PointerInfoPre extends PointerInfoBase {
|
|
|
|
- constructor(type: number, event: PointerEvent | MouseWheelEvent, localX: number, localY: number);
|
|
|
|
- localPosition: Vector2;
|
|
|
|
- skipOnPointerObservable: boolean;
|
|
|
|
- }
|
|
|
|
- /**
|
|
|
|
- * This type contains all the data related to a pointer event in Babylon.js.
|
|
|
|
- * The event member is an instance of PointerEvent for all types except PointerWheel and is of type MouseWheelEvent when type equals PointerWheel. The different event types can be found in the PointerEventTypes class.
|
|
|
|
- */
|
|
|
|
- class PointerInfo extends PointerInfoBase {
|
|
|
|
- pickInfo: Nullable<PickingInfo>;
|
|
|
|
- constructor(type: number, event: PointerEvent | MouseWheelEvent, pickInfo: Nullable<PickingInfo>);
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-declare module BABYLON {
|
|
|
|
class StickValues {
|
|
class StickValues {
|
|
x: number;
|
|
x: number;
|
|
y: number;
|
|
y: number;
|
|
@@ -15082,75 +15082,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.Internals {
|
|
declare module BABYLON.Internals {
|
|
class _AlphaState {
|
|
class _AlphaState {
|
|
private _isAlphaBlendDirty;
|
|
private _isAlphaBlendDirty;
|
|
@@ -16379,24 +16310,93 @@ declare module BABYLON {
|
|
}
|
|
}
|
|
|
|
|
|
declare module BABYLON {
|
|
declare module BABYLON {
|
|
- class AutoRotationBehavior implements Behavior<ArcRotateCamera> {
|
|
|
|
- readonly name: string;
|
|
|
|
- private _zoomStopsAnimation;
|
|
|
|
- private _idleRotationSpeed;
|
|
|
|
- private _idleRotationWaitTime;
|
|
|
|
- private _idleRotationSpinupTime;
|
|
|
|
- /**
|
|
|
|
- * Gets the flag that indicates if user zooming should stop animation.
|
|
|
|
- */
|
|
|
|
- /**
|
|
|
|
- * Sets the flag that indicates if user zooming should stop animation.
|
|
|
|
- */
|
|
|
|
- zoomStopsAnimation: boolean;
|
|
|
|
- /**
|
|
|
|
- * Gets the default speed at which the camera rotates around the model.
|
|
|
|
- */
|
|
|
|
|
|
+ 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;
|
|
/**
|
|
/**
|
|
- * Sets the default speed at which the camera rotates around the model.
|
|
|
|
|
|
+ * 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;
|
|
|
|
+ private _idleRotationSpeed;
|
|
|
|
+ private _idleRotationWaitTime;
|
|
|
|
+ private _idleRotationSpinupTime;
|
|
|
|
+ /**
|
|
|
|
+ * Gets the flag that indicates if user zooming should stop animation.
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Sets the flag that indicates if user zooming should stop animation.
|
|
|
|
+ */
|
|
|
|
+ zoomStopsAnimation: boolean;
|
|
|
|
+ /**
|
|
|
|
+ * Gets the default speed at which the camera rotates around the model.
|
|
|
|
+ */
|
|
|
|
+ /**
|
|
|
|
+ * Sets the default speed at which the camera rotates around the model.
|
|
*/
|
|
*/
|
|
idleRotationSpeed: number;
|
|
idleRotationSpeed: number;
|
|
/**
|
|
/**
|
|
@@ -16663,6 +16663,180 @@ 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 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 {
|
|
class ArcRotateCameraGamepadInput implements ICameraInput<ArcRotateCamera> {
|
|
class ArcRotateCameraGamepadInput implements ICameraInput<ArcRotateCamera> {
|
|
camera: ArcRotateCamera;
|
|
camera: ArcRotateCamera;
|
|
gamepad: Nullable<Gamepad>;
|
|
gamepad: Nullable<Gamepad>;
|
|
@@ -16891,180 +17065,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 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> {
|
|
interface IOctreeContainer<T> {
|
|
blocks: Array<OctreeBlock<T>>;
|
|
blocks: Array<OctreeBlock<T>>;
|
|
}
|
|
}
|