|
@@ -41410,8 +41410,8 @@ declare module BABYLON {
|
|
|
*/
|
|
|
export interface ISoundOptions {
|
|
|
/**
|
|
|
- * Does the sound autoplay once loaded.
|
|
|
- */
|
|
|
+ * Does the sound autoplay once loaded.
|
|
|
+ */
|
|
|
autoplay?: boolean;
|
|
|
/**
|
|
|
* Does the sound loop after it finishes playing once.
|
|
@@ -41434,9 +41434,9 @@ declare module BABYLON {
|
|
|
*/
|
|
|
useCustomAttenuation?: boolean;
|
|
|
/**
|
|
|
- * Define the roll off factor of spatial sounds.
|
|
|
- * @see https://doc.babylonjs.com/how_to/playing_sounds_and_music#creating-a-spatial-3d-sound
|
|
|
- */
|
|
|
+ * Define the roll off factor of spatial sounds.
|
|
|
+ * @see https://doc.babylonjs.com/how_to/playing_sounds_and_music#creating-a-spatial-3d-sound
|
|
|
+ */
|
|
|
rolloffFactor?: number;
|
|
|
/**
|
|
|
* Define the reference distance the sound should be heard perfectly.
|
|
@@ -41578,13 +41578,13 @@ declare module BABYLON {
|
|
|
/** @hidden */
|
|
|
static _SceneComponentInitialization: (scene: Scene) => void;
|
|
|
/**
|
|
|
- * 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, it also works with MediaStreams
|
|
|
- * @param scene defines the scene the sound belongs to
|
|
|
- * @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
|
|
|
- */
|
|
|
+ * 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, it also works with MediaStreams
|
|
|
+ * @param scene defines the scene the sound belongs to
|
|
|
+ * @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?: Nullable<() => void>, options?: ISoundOptions);
|
|
|
/**
|
|
|
* Release the sound and its associated resources
|
|
@@ -41627,11 +41627,11 @@ declare module BABYLON {
|
|
|
*/
|
|
|
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)
|
|
|
- */
|
|
|
+ * 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;
|
|
|
/**
|
|
|
* Gets or sets the inner angle for the directional cone.
|
|
@@ -41669,17 +41669,17 @@ declare module BABYLON {
|
|
|
*/
|
|
|
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 at a specific time in seconds
|
|
|
- * @param length (optional) Sound duration (in seconds)
|
|
|
- */
|
|
|
+ * Play the sound
|
|
|
+ * @param time (optional) Start the sound after X seconds. Start immediately (0) by default.
|
|
|
+ * @param offset (optional) Start the sound at a specific time in seconds
|
|
|
+ * @param length (optional) Sound duration (in seconds)
|
|
|
+ */
|
|
|
play(time?: number, offset?: number, length?: number): void;
|
|
|
private _onended;
|
|
|
/**
|
|
|
- * Stop the sound
|
|
|
- * @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default.
|
|
|
- */
|
|
|
+ * Stop the sound
|
|
|
+ * @param time (optional) Stop the sound after X seconds. Stop immediately (0) by default.
|
|
|
+ */
|
|
|
stop(time?: number): void;
|
|
|
/**
|
|
|
* Put the sound in pause
|
|
@@ -46800,9 +46800,10 @@ declare module BABYLON {
|
|
|
newCanvasCssStyle?: string;
|
|
|
/**
|
|
|
* Get the default values of the configuration object
|
|
|
+ * @param engine defines the engine to use (can be null)
|
|
|
* @returns default values of this configuration object
|
|
|
*/
|
|
|
- static GetDefaults(): WebXRManagedOutputCanvasOptions;
|
|
|
+ static GetDefaults(engine?: ThinEngine): WebXRManagedOutputCanvasOptions;
|
|
|
}
|
|
|
/**
|
|
|
* Creates a canvas that is added/removed from the webpage when entering/exiting XR
|
|
@@ -47082,6 +47083,10 @@ declare module BABYLON {
|
|
|
* The name of the native xr feature name, if applicable (like anchor, hit-test, or hand-tracking)
|
|
|
*/
|
|
|
xrNativeFeatureName?: string;
|
|
|
+ /**
|
|
|
+ * A list of (Babylon WebXR) features this feature depends on
|
|
|
+ */
|
|
|
+ dependsOn?: string[];
|
|
|
}
|
|
|
/**
|
|
|
* A list of the currently available features without referencing them
|
|
@@ -47119,6 +47124,10 @@ declare module BABYLON {
|
|
|
* The name of the feature points feature.
|
|
|
*/
|
|
|
static readonly FEATURE_POINTS: string;
|
|
|
+ /**
|
|
|
+ * The name of the hand tracking feature.
|
|
|
+ */
|
|
|
+ static readonly HAND_TRACKING: string;
|
|
|
}
|
|
|
/**
|
|
|
* Defining the constructor of a feature. Used to register the modules.
|
|
@@ -48065,7 +48074,7 @@ declare module BABYLON {
|
|
|
/**
|
|
|
* The mesh that will be changed when axis value changes
|
|
|
*/
|
|
|
- valueMesh: AbstractMesh;
|
|
|
+ valueMesh?: AbstractMesh;
|
|
|
}
|
|
|
/**
|
|
|
* The elements needed for change-detection of the gamepad objects in motion controllers
|
|
@@ -48215,8 +48224,8 @@ declare module BABYLON {
|
|
|
* @returns a promise that will send true when the pulse has ended and false if the device doesn't support pulse or an error accrued
|
|
|
*/
|
|
|
pulse(value: number, duration: number, hapticActuatorIndex?: number): Promise<boolean>;
|
|
|
- protected _getChildByName(node: AbstractMesh, name: string): AbstractMesh;
|
|
|
- protected _getImmediateChildByName(node: AbstractMesh, name: string): AbstractMesh;
|
|
|
+ protected _getChildByName(node: AbstractMesh, name: string): AbstractMesh | undefined;
|
|
|
+ protected _getImmediateChildByName(node: AbstractMesh, name: string): AbstractMesh | undefined;
|
|
|
/**
|
|
|
* Moves the axis on the controller mesh based on its current state
|
|
|
* @param axis the index of the axis
|
|
@@ -48467,6 +48476,7 @@ declare module BABYLON {
|
|
|
private _options;
|
|
|
private _tmpVector;
|
|
|
private _uniqueId;
|
|
|
+ private _disposed;
|
|
|
/**
|
|
|
* Represents the part of the controller that is held. This may not exist if the controller is the head mounted display itself, if thats the case only the pointer from the head will be availible
|
|
|
*/
|
|
@@ -48992,7 +49002,10 @@ declare module BABYLON {
|
|
|
options: WebXREnterExitUIOptions;
|
|
|
private _activeButton;
|
|
|
private _buttons;
|
|
|
- private _overlay;
|
|
|
+ /**
|
|
|
+ * The HTML Div Element to which buttons are added.
|
|
|
+ */
|
|
|
+ readonly overlay: HTMLDivElement;
|
|
|
/**
|
|
|
* Fired every time the active button is changed.
|
|
|
*
|
|
@@ -54865,80 +54878,111 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
- * Display a 360 degree photo on an approximately spherical surface, useful for VR applications or skyboxes.
|
|
|
- * As a subclass of TransformNode, this allow parenting to the camera with different locations in the scene.
|
|
|
+ * Display a 360/180 degree texture on an approximately spherical surface, useful for VR applications or skyboxes.
|
|
|
+ * As a subclass of TransformNode, this allow parenting to the camera or multiple textures with different locations in the scene.
|
|
|
* This class achieves its effect with a Texture and a correctly configured BackgroundMaterial on an inverted sphere.
|
|
|
* Potential additions to this helper include zoom and and non-infinite distance rendering effects.
|
|
|
*/
|
|
|
- export class PhotoDome extends TransformNode {
|
|
|
+ export abstract class TextureDome<T extends Texture> extends TransformNode {
|
|
|
+ protected onError: Nullable<(message?: string, exception?: any) => void>;
|
|
|
/**
|
|
|
- * Define the image as a Monoscopic panoramic 360 image.
|
|
|
+ * Define the source as a Monoscopic panoramic 360/180.
|
|
|
*/
|
|
|
static readonly MODE_MONOSCOPIC: number;
|
|
|
/**
|
|
|
- * Define the image as a Stereoscopic TopBottom/OverUnder panoramic 360 image.
|
|
|
+ * Define the source as a Stereoscopic TopBottom/OverUnder panoramic 360/180.
|
|
|
*/
|
|
|
static readonly MODE_TOPBOTTOM: number;
|
|
|
/**
|
|
|
- * Define the image as a Stereoscopic Side by Side panoramic 360 image.
|
|
|
+ * Define the source as a Stereoscopic Side by Side panoramic 360/180.
|
|
|
*/
|
|
|
static readonly MODE_SIDEBYSIDE: number;
|
|
|
- private _useDirectMapping;
|
|
|
+ private _halfDome;
|
|
|
+ protected _useDirectMapping: boolean;
|
|
|
/**
|
|
|
* The texture being displayed on the sphere
|
|
|
*/
|
|
|
- protected _photoTexture: Texture;
|
|
|
+ protected _texture: T;
|
|
|
/**
|
|
|
- * Gets or sets the texture being displayed on the sphere
|
|
|
+ * Gets the texture being displayed on the sphere
|
|
|
*/
|
|
|
- get photoTexture(): Texture;
|
|
|
- set photoTexture(value: Texture);
|
|
|
+ get texture(): T;
|
|
|
/**
|
|
|
- * Observable raised when an error occured while loading the 360 image
|
|
|
+ * Sets the texture being displayed on the sphere
|
|
|
*/
|
|
|
- onLoadErrorObservable: Observable<string>;
|
|
|
+ set texture(newTexture: T);
|
|
|
/**
|
|
|
* The skybox material
|
|
|
*/
|
|
|
protected _material: BackgroundMaterial;
|
|
|
/**
|
|
|
- * The surface used for the skybox
|
|
|
+ * The surface used for the dome
|
|
|
*/
|
|
|
protected _mesh: Mesh;
|
|
|
/**
|
|
|
- * Gets the mesh used for the skybox.
|
|
|
+ * Gets the mesh used for the dome.
|
|
|
*/
|
|
|
get mesh(): Mesh;
|
|
|
/**
|
|
|
+ * A mesh that will be used to mask the back of the dome in case it is a 180 degree movie.
|
|
|
+ */
|
|
|
+ private _halfDomeMask;
|
|
|
+ /**
|
|
|
* The current fov(field of view) multiplier, 0.0 - 2.0. Defaults to 1.0. Lower values "zoom in" and higher values "zoom out".
|
|
|
* Also see the options.resolution property.
|
|
|
*/
|
|
|
get fovMultiplier(): number;
|
|
|
set fovMultiplier(value: number);
|
|
|
- private _imageMode;
|
|
|
+ protected _textureMode: number;
|
|
|
/**
|
|
|
- * Gets or set the current video mode for the video. It can be:
|
|
|
- * * PhotoDome.MODE_MONOSCOPIC : Define the image as a Monoscopic panoramic 360 image.
|
|
|
- * * PhotoDome.MODE_TOPBOTTOM : Define the image as a Stereoscopic TopBottom/OverUnder panoramic 360 image.
|
|
|
- * * PhotoDome.MODE_SIDEBYSIDE : Define the image as a Stereoscopic Side by Side panoramic 360 image.
|
|
|
+ * Gets or set the current texture mode for the texture. It can be:
|
|
|
+ * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
|
|
|
+ * * TextureDome.MODE_TOPBOTTOM : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
|
|
|
+ * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
|
|
|
*/
|
|
|
- get imageMode(): number;
|
|
|
- set imageMode(value: number);
|
|
|
+ get textureMode(): number;
|
|
|
+ /**
|
|
|
+ * Sets the current texture mode for the texture. It can be:
|
|
|
+ * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
|
|
|
+ * * TextureDome.MODE_TOPBOTTOM : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
|
|
|
+ * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
|
|
|
+ */
|
|
|
+ set textureMode(value: number);
|
|
|
+ /**
|
|
|
+ * Is it a 180 degrees dome (half dome) or 360 texture (full dome)
|
|
|
+ */
|
|
|
+ get halfDome(): boolean;
|
|
|
+ /**
|
|
|
+ * Set the halfDome mode. If set, only the front (180 degrees) will be displayed and the back will be blacked out.
|
|
|
+ */
|
|
|
+ set halfDome(enabled: boolean);
|
|
|
/**
|
|
|
- * Create an instance of this class and pass through the parameters to the relevant classes, Texture, StandardMaterial, and Mesh.
|
|
|
+ * Oberserver used in Stereoscopic VR Mode.
|
|
|
+ */
|
|
|
+ private _onBeforeCameraRenderObserver;
|
|
|
+ /**
|
|
|
+ * Observable raised when an error occured while loading the 360 image
|
|
|
+ */
|
|
|
+ onLoadErrorObservable: Observable<string>;
|
|
|
+ /**
|
|
|
+ * Create an instance of this class and pass through the parameters to the relevant classes- Texture, StandardMaterial, and Mesh.
|
|
|
* @param name Element's name, child elements will append suffixes for their own names.
|
|
|
- * @param urlsOfPhoto defines the url of the photo to display
|
|
|
- * @param options defines an object containing optional or exposed sub element properties
|
|
|
- * @param onError defines a callback called when an error occured while loading the texture
|
|
|
+ * @param textureUrlOrElement defines the url(s) or the (video) HTML element to use
|
|
|
+ * @param options An object containing optional or exposed sub element properties
|
|
|
*/
|
|
|
- constructor(name: string, urlOfPhoto: string, options: {
|
|
|
+ constructor(name: string, textureUrlOrElement: string | string[] | HTMLVideoElement, options: {
|
|
|
resolution?: number;
|
|
|
+ clickToPlay?: boolean;
|
|
|
+ autoPlay?: boolean;
|
|
|
+ loop?: boolean;
|
|
|
size?: number;
|
|
|
- useDirectMapping?: boolean;
|
|
|
+ poster?: string;
|
|
|
faceForward?: boolean;
|
|
|
+ useDirectMapping?: boolean;
|
|
|
+ halfDomeMode?: boolean;
|
|
|
}, scene: Scene, onError?: Nullable<(message?: string, exception?: any) => void>);
|
|
|
- private _onBeforeCameraRenderObserver;
|
|
|
- private _changeImageMode;
|
|
|
+ protected abstract _initTexture(urlsOrElement: string | string[] | HTMLElement, scene: Scene, options: any): T;
|
|
|
+ protected _changeTextureMode(value: number): void;
|
|
|
/**
|
|
|
* Releases resources associated with this node.
|
|
|
* @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
|
|
@@ -54949,6 +54993,51 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
+ * Display a 360 degree photo on an approximately spherical surface, useful for VR applications or skyboxes.
|
|
|
+ * As a subclass of TransformNode, this allow parenting to the camera with different locations in the scene.
|
|
|
+ * This class achieves its effect with a Texture and a correctly configured BackgroundMaterial on an inverted sphere.
|
|
|
+ * Potential additions to this helper include zoom and and non-infinite distance rendering effects.
|
|
|
+ */
|
|
|
+ export class PhotoDome extends TextureDome<Texture> {
|
|
|
+ /**
|
|
|
+ * Define the image as a Monoscopic panoramic 360 image.
|
|
|
+ */
|
|
|
+ static readonly MODE_MONOSCOPIC: number;
|
|
|
+ /**
|
|
|
+ * Define the image as a Stereoscopic TopBottom/OverUnder panoramic 360 image.
|
|
|
+ */
|
|
|
+ static readonly MODE_TOPBOTTOM: number;
|
|
|
+ /**
|
|
|
+ * Define the image as a Stereoscopic Side by Side panoramic 360 image.
|
|
|
+ */
|
|
|
+ static readonly MODE_SIDEBYSIDE: number;
|
|
|
+ /**
|
|
|
+ * Gets or sets the texture being displayed on the sphere
|
|
|
+ */
|
|
|
+ get photoTexture(): Texture;
|
|
|
+ /**
|
|
|
+ * sets the texture being displayed on the sphere
|
|
|
+ */
|
|
|
+ set photoTexture(value: Texture);
|
|
|
+ /**
|
|
|
+ * Gets the current video mode for the video. It can be:
|
|
|
+ * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
|
|
|
+ * * TextureDome.MODE_TOPBOTTOM : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
|
|
|
+ * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
|
|
|
+ */
|
|
|
+ get imageMode(): number;
|
|
|
+ /**
|
|
|
+ * Sets the current video mode for the video. It can be:
|
|
|
+ * * TextureDome.MODE_MONOSCOPIC : Define the texture source as a Monoscopic panoramic 360.
|
|
|
+ * * TextureDome.MODE_TOPBOTTOM : Define the texture source as a Stereoscopic TopBottom/OverUnder panoramic 360.
|
|
|
+ * * TextureDome.MODE_SIDEBYSIDE : Define the texture source as a Stereoscopic Side by Side panoramic 360.
|
|
|
+ */
|
|
|
+ set imageMode(value: number);
|
|
|
+ protected _initTexture(urlsOrElement: string, scene: Scene, options: any): Texture;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
* Class used to host RGBD texture specific utilities
|
|
|
*/
|
|
|
export class RGBDTextureTools {
|
|
@@ -57649,7 +57738,7 @@ declare module BABYLON {
|
|
|
* This class achieves its effect with a VideoTexture and a correctly configured BackgroundMaterial on an inverted sphere.
|
|
|
* Potential additions to this helper include zoom and and non-infinite distance rendering effects.
|
|
|
*/
|
|
|
- export class VideoDome extends TransformNode {
|
|
|
+ export class VideoDome extends TextureDome<VideoTexture> {
|
|
|
/**
|
|
|
* Define the video source as a Monoscopic panoramic 360 video.
|
|
|
*/
|
|
@@ -57662,84 +57751,20 @@ declare module BABYLON {
|
|
|
* Define the video source as a Stereoscopic Side by Side panoramic 360 video.
|
|
|
*/
|
|
|
static readonly MODE_SIDEBYSIDE: number;
|
|
|
- private _halfDome;
|
|
|
- private _useDirectMapping;
|
|
|
/**
|
|
|
- * The video texture being displayed on the sphere
|
|
|
- */
|
|
|
- protected _videoTexture: VideoTexture;
|
|
|
- /**
|
|
|
- * Gets the video texture being displayed on the sphere
|
|
|
+ * Get the video texture associated with this video dome
|
|
|
*/
|
|
|
get videoTexture(): VideoTexture;
|
|
|
/**
|
|
|
- * The skybox material
|
|
|
- */
|
|
|
- protected _material: BackgroundMaterial;
|
|
|
- /**
|
|
|
- * The surface used for the video dome
|
|
|
- */
|
|
|
- protected _mesh: Mesh;
|
|
|
- /**
|
|
|
- * Gets the mesh used for the video dome.
|
|
|
- */
|
|
|
- get mesh(): Mesh;
|
|
|
- /**
|
|
|
- * A mesh that will be used to mask the back of the video dome in case it is a 180 degree movie.
|
|
|
- */
|
|
|
- private _halfDomeMask;
|
|
|
- /**
|
|
|
- * The current fov(field of view) multiplier, 0.0 - 2.0. Defaults to 1.0. Lower values "zoom in" and higher values "zoom out".
|
|
|
- * Also see the options.resolution property.
|
|
|
- */
|
|
|
- get fovMultiplier(): number;
|
|
|
- set fovMultiplier(value: number);
|
|
|
- private _videoMode;
|
|
|
- /**
|
|
|
- * Gets or set the current video mode for the video. It can be:
|
|
|
- * * VideoDome.MODE_MONOSCOPIC : Define the video source as a Monoscopic panoramic 360 video.
|
|
|
- * * VideoDome.MODE_TOPBOTTOM : Define the video source as a Stereoscopic TopBottom/OverUnder panoramic 360 video.
|
|
|
- * * VideoDome.MODE_SIDEBYSIDE : Define the video source as a Stereoscopic Side by Side panoramic 360 video.
|
|
|
+ * Get the video mode of this dome
|
|
|
*/
|
|
|
get videoMode(): number;
|
|
|
- set videoMode(value: number);
|
|
|
/**
|
|
|
- * Is the video a 180 degrees video (half dome) or 360 video (full dome)
|
|
|
- *
|
|
|
+ * Set the video mode of this dome.
|
|
|
+ * @see textureMode
|
|
|
*/
|
|
|
- get halfDome(): boolean;
|
|
|
- /**
|
|
|
- * Set the halfDome mode. If set, only the front (180 degrees) will be displayed and the back will be blacked out.
|
|
|
- */
|
|
|
- set halfDome(enabled: boolean);
|
|
|
- /**
|
|
|
- * Oberserver used in Stereoscopic VR Mode.
|
|
|
- */
|
|
|
- private _onBeforeCameraRenderObserver;
|
|
|
- /**
|
|
|
- * Create an instance of this class and pass through the parameters to the relevant classes, VideoTexture, StandardMaterial, and Mesh.
|
|
|
- * @param name Element's name, child elements will append suffixes for their own names.
|
|
|
- * @param urlsOrVideo defines the url(s) or the video element to use
|
|
|
- * @param options An object containing optional or exposed sub element properties
|
|
|
- */
|
|
|
- constructor(name: string, urlsOrVideo: string | string[] | HTMLVideoElement, options: {
|
|
|
- resolution?: number;
|
|
|
- clickToPlay?: boolean;
|
|
|
- autoPlay?: boolean;
|
|
|
- loop?: boolean;
|
|
|
- size?: number;
|
|
|
- poster?: string;
|
|
|
- faceForward?: boolean;
|
|
|
- useDirectMapping?: boolean;
|
|
|
- halfDomeMode?: boolean;
|
|
|
- }, scene: Scene);
|
|
|
- private _changeVideoMode;
|
|
|
- /**
|
|
|
- * Releases resources associated with this node.
|
|
|
- * @param doNotRecurse Set to true to not recurse into each children (recurse into each children by default)
|
|
|
- * @param disposeMaterialAndTextures Set to true to also dispose referenced materials and textures (false by default)
|
|
|
- */
|
|
|
- dispose(doNotRecurse?: boolean, disposeMaterialAndTextures?: boolean): void;
|
|
|
+ set videoMode(value: number);
|
|
|
+ protected _initTexture(urlsOrElement: string | string[] | HTMLVideoElement, scene: Scene, options: any): VideoTexture;
|
|
|
}
|
|
|
}
|
|
|
declare module BABYLON {
|
|
@@ -73900,8 +73925,9 @@ declare module BABYLON {
|
|
|
* @param antialiasing Whether antialiasing should be turned on or not (default: false)
|
|
|
* @param fileName A name for for the downloaded file.
|
|
|
* @param renderSprites Whether the sprites should be rendered or not (default: false)
|
|
|
+ * @param enableStencilBuffer Whether the stencil buffer should be enabled or not (default: false)
|
|
|
*/
|
|
|
- static CreateScreenshotUsingRenderTarget(engine: Engine, camera: Camera, size: IScreenshotSize | number, successCallback?: (data: string) => void, mimeType?: string, samples?: number, antialiasing?: boolean, fileName?: string, renderSprites?: boolean): void;
|
|
|
+ static CreateScreenshotUsingRenderTarget(engine: Engine, camera: Camera, size: IScreenshotSize | number, successCallback?: (data: string) => void, mimeType?: string, samples?: number, antialiasing?: boolean, fileName?: string, renderSprites?: boolean, enableStencilBuffer?: boolean): void;
|
|
|
/**
|
|
|
* Generates an image screenshot from the specified camera.
|
|
|
* @see https://doc.babylonjs.com/how_to/render_scene_on_a_png
|
|
@@ -74860,6 +74886,209 @@ declare module BABYLON {
|
|
|
}
|
|
|
declare module BABYLON {
|
|
|
/**
|
|
|
+ * Configuration interface for the hand tracking feature
|
|
|
+ */
|
|
|
+ export interface IWebXRHandTrackingOptions {
|
|
|
+ /**
|
|
|
+ * The xrInput that will be used as source for new hands
|
|
|
+ */
|
|
|
+ xrInput: WebXRInput;
|
|
|
+ /**
|
|
|
+ * Configuration object for the joint meshes
|
|
|
+ */
|
|
|
+ jointMeshes?: {
|
|
|
+ /**
|
|
|
+ * Should the meshes created be invisible (defaults to false)
|
|
|
+ */
|
|
|
+ invisible?: boolean;
|
|
|
+ /**
|
|
|
+ * A source mesh to be used to create instances. Defaults to a sphere.
|
|
|
+ * This mesh will be the source for all other (25) meshes.
|
|
|
+ * It should have the general size of a single unit, as the instances will be scaled according to the provided radius
|
|
|
+ */
|
|
|
+ sourceMesh?: Mesh;
|
|
|
+ /**
|
|
|
+ * Should the source mesh stay visible. Defaults to false
|
|
|
+ */
|
|
|
+ keepOriginalVisible?: boolean;
|
|
|
+ /**
|
|
|
+ * Scale factor for all instances (defaults to 2)
|
|
|
+ */
|
|
|
+ scaleFactor?: number;
|
|
|
+ /**
|
|
|
+ * Should each instance have its own physics impostor
|
|
|
+ */
|
|
|
+ enablePhysics?: boolean;
|
|
|
+ /**
|
|
|
+ * If enabled, override default physics properties
|
|
|
+ */
|
|
|
+ physicsProps?: {
|
|
|
+ friction?: number;
|
|
|
+ restitution?: number;
|
|
|
+ impostorType?: number;
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * For future use - a single hand-mesh that will be updated according to the XRHand data provided
|
|
|
+ */
|
|
|
+ handMesh?: AbstractMesh;
|
|
|
+ };
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Parts of the hands divided to writs and finger names
|
|
|
+ */
|
|
|
+ export const enum HandPart {
|
|
|
+ /**
|
|
|
+ * HandPart - Wrist
|
|
|
+ */
|
|
|
+ WRIST = "wrist",
|
|
|
+ /**
|
|
|
+ * HandPart - The THumb
|
|
|
+ */
|
|
|
+ THUMB = "thumb",
|
|
|
+ /**
|
|
|
+ * HandPart - Index finger
|
|
|
+ */
|
|
|
+ INDEX = "index",
|
|
|
+ /**
|
|
|
+ * HandPart - Middle finger
|
|
|
+ */
|
|
|
+ MIDDLE = "middle",
|
|
|
+ /**
|
|
|
+ * HandPart - Ring finger
|
|
|
+ */
|
|
|
+ RING = "ring",
|
|
|
+ /**
|
|
|
+ * HandPart - Little finger
|
|
|
+ */
|
|
|
+ LITTLE = "little"
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Representing a single hand (with its corresponding native XRHand object)
|
|
|
+ */
|
|
|
+ export class WebXRHand implements IDisposable {
|
|
|
+ /** the controller to which the hand correlates */
|
|
|
+ readonly xrController: WebXRInputSource;
|
|
|
+ /** the meshes to be used to track the hand joints */
|
|
|
+ readonly trackedMeshes: AbstractMesh[];
|
|
|
+ /**
|
|
|
+ * Hand-parts definition (key is HandPart)
|
|
|
+ */
|
|
|
+ static HandPartsDefinition: {
|
|
|
+ [key: string]: number[];
|
|
|
+ };
|
|
|
+ /**
|
|
|
+ * Populate the HandPartsDefinition object.
|
|
|
+ * This is called as a side effect since certain browsers don't have XRHand defined.
|
|
|
+ */
|
|
|
+ static _PopulateHandPartsDefinition(): void;
|
|
|
+ /**
|
|
|
+ * Construct a new hand object
|
|
|
+ * @param xrController the controller to which the hand correlates
|
|
|
+ * @param trackedMeshes the meshes to be used to track the hand joints
|
|
|
+ */
|
|
|
+ constructor(
|
|
|
+ /** the controller to which the hand correlates */
|
|
|
+ xrController: WebXRInputSource,
|
|
|
+ /** the meshes to be used to track the hand joints */
|
|
|
+ trackedMeshes: AbstractMesh[]);
|
|
|
+ /**
|
|
|
+ * Update this hand from the latest xr frame
|
|
|
+ * @param xrFrame xrFrame to update from
|
|
|
+ * @param referenceSpace The current viewer reference space
|
|
|
+ * @param scaleFactor optional scale factor for the meshes
|
|
|
+ */
|
|
|
+ updateFromXRFrame(xrFrame: XRFrame, referenceSpace: XRReferenceSpace, scaleFactor?: number): void;
|
|
|
+ /**
|
|
|
+ * Get meshes of part of the hand
|
|
|
+ * @param part the part of hand to get
|
|
|
+ * @returns An array of meshes that correlate to the hand part requested
|
|
|
+ */
|
|
|
+ getHandPartMeshes(part: HandPart): AbstractMesh[];
|
|
|
+ /**
|
|
|
+ * Dispose this Hand object
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * WebXR Hand Joint tracking feature, available for selected browsers and devices
|
|
|
+ */
|
|
|
+ export class WebXRHandTracking extends WebXRAbstractFeature {
|
|
|
+ /**
|
|
|
+ * options to use when constructing this feature
|
|
|
+ */
|
|
|
+ readonly options: IWebXRHandTrackingOptions;
|
|
|
+ private static _idCounter;
|
|
|
+ /**
|
|
|
+ * The module's name
|
|
|
+ */
|
|
|
+ static readonly Name: string;
|
|
|
+ /**
|
|
|
+ * The (Babylon) version of this module.
|
|
|
+ * This is an integer representing the implementation version.
|
|
|
+ * This number does not correspond to the WebXR specs version
|
|
|
+ */
|
|
|
+ static readonly Version: number;
|
|
|
+ /**
|
|
|
+ * This observable will notify registered observers when a new hand object was added and initialized
|
|
|
+ */
|
|
|
+ onHandAddedObservable: Observable<WebXRHand>;
|
|
|
+ /**
|
|
|
+ * This observable will notify its observers right before the hand object is disposed
|
|
|
+ */
|
|
|
+ onHandRemovedObservable: Observable<WebXRHand>;
|
|
|
+ private _hands;
|
|
|
+ /**
|
|
|
+ * Creates a new instance of the hit test feature
|
|
|
+ * @param _xrSessionManager an instance of WebXRSessionManager
|
|
|
+ * @param options options to use when constructing this feature
|
|
|
+ */
|
|
|
+ constructor(_xrSessionManager: WebXRSessionManager,
|
|
|
+ /**
|
|
|
+ * options to use when constructing this feature
|
|
|
+ */
|
|
|
+ options: IWebXRHandTrackingOptions);
|
|
|
+ /**
|
|
|
+ * Check if the needed objects are defined.
|
|
|
+ * This does not mean that the feature is enabled, but that the objects needed are well defined.
|
|
|
+ */
|
|
|
+ isCompatible(): boolean;
|
|
|
+ /**
|
|
|
+ * attach this feature
|
|
|
+ * Will usually be called by the features manager
|
|
|
+ *
|
|
|
+ * @returns true if successful.
|
|
|
+ */
|
|
|
+ attach(): boolean;
|
|
|
+ /**
|
|
|
+ * detach this feature.
|
|
|
+ * Will usually be called by the features manager
|
|
|
+ *
|
|
|
+ * @returns true if successful.
|
|
|
+ */
|
|
|
+ detach(): boolean;
|
|
|
+ /**
|
|
|
+ * Dispose this feature and all of the resources attached
|
|
|
+ */
|
|
|
+ dispose(): void;
|
|
|
+ /**
|
|
|
+ * Get the hand object according to the controller id
|
|
|
+ * @param controllerId the controller id to which we want to get the hand
|
|
|
+ * @returns null if not found or the WebXRHand object if found
|
|
|
+ */
|
|
|
+ getHandByControllerId(controllerId: string): Nullable<WebXRHand>;
|
|
|
+ /**
|
|
|
+ * Get a hand object according to the requested handedness
|
|
|
+ * @param handedness the handedness to request
|
|
|
+ * @returns null if not found or the WebXRHand object if found
|
|
|
+ */
|
|
|
+ getHandByHandedness(handedness: XRHandedness): Nullable<WebXRHand>;
|
|
|
+ protected _onXRFrame(_xrFrame: XRFrame): void;
|
|
|
+ private _attachHand;
|
|
|
+ private _detachHand;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module BABYLON {
|
|
|
+ /**
|
|
|
* The motion controller class for all microsoft mixed reality controllers
|
|
|
*/
|
|
|
export class WebXRMicrosoftMixedRealityController extends WebXRAbstractMotionController {
|
|
@@ -75588,59 +75817,23 @@ interface Window {
|
|
|
interface Gamepad {
|
|
|
readonly displayId: number;
|
|
|
}
|
|
|
-type XRSessionMode =
|
|
|
- | "inline"
|
|
|
- | "immersive-vr"
|
|
|
- | "immersive-ar";
|
|
|
-
|
|
|
-type XRReferenceSpaceType =
|
|
|
- | "viewer"
|
|
|
- | "local"
|
|
|
- | "local-floor"
|
|
|
- | "bounded-floor"
|
|
|
- | "unbounded";
|
|
|
+type XRSessionMode = "inline" | "immersive-vr" | "immersive-ar";
|
|
|
|
|
|
-type XREnvironmentBlendMode =
|
|
|
- | "opaque"
|
|
|
- | "additive"
|
|
|
- | "alpha-blend";
|
|
|
+type XRReferenceSpaceType = "viewer" | "local" | "local-floor" | "bounded-floor" | "unbounded";
|
|
|
|
|
|
-type XRVisibilityState =
|
|
|
- | "visible"
|
|
|
- | "visible-blurred"
|
|
|
- | "hidden";
|
|
|
+type XREnvironmentBlendMode = "opaque" | "additive" | "alpha-blend";
|
|
|
|
|
|
-type XRHandedness =
|
|
|
- | "none"
|
|
|
- | "left"
|
|
|
- | "right";
|
|
|
+type XRVisibilityState = "visible" | "visible-blurred" | "hidden";
|
|
|
|
|
|
-type XRTargetRayMode =
|
|
|
- | "gaze"
|
|
|
- | "tracked-pointer"
|
|
|
- | "screen";
|
|
|
+type XRHandedness = "none" | "left" | "right";
|
|
|
|
|
|
-type XREye =
|
|
|
- | "none"
|
|
|
- | "left"
|
|
|
- | "right";
|
|
|
+type XRTargetRayMode = "gaze" | "tracked-pointer" | "screen";
|
|
|
|
|
|
-type XREventType =
|
|
|
- | "devicechange"
|
|
|
- | "visibilitychange"
|
|
|
- | "end"
|
|
|
- | "inputsourceschange"
|
|
|
- | "select"
|
|
|
- | "selectstart"
|
|
|
- | "selectend"
|
|
|
- | "squeeze"
|
|
|
- | "squeezestart"
|
|
|
- | "squeezeend"
|
|
|
- | "reset";
|
|
|
+type XREye = "none" | "left" | "right";
|
|
|
|
|
|
-interface XRSpace extends EventTarget {
|
|
|
+type XREventType = "devicechange" | "visibilitychange" | "end" | "inputsourceschange" | "select" | "selectstart" | "selectend" | "squeeze" | "squeezestart" | "squeezeend" | "reset";
|
|
|
|
|
|
-}
|
|
|
+interface XRSpace extends EventTarget {}
|
|
|
|
|
|
interface XRRenderState {
|
|
|
depthNear?: number;
|
|
@@ -75656,6 +75849,7 @@ interface XRInputSource {
|
|
|
gripSpace: XRSpace | undefined;
|
|
|
gamepad: Gamepad | undefined;
|
|
|
profiles: Array<string>;
|
|
|
+ hand: XRHand | undefined;
|
|
|
}
|
|
|
|
|
|
interface XRSessionInit {
|
|
@@ -75681,9 +75875,7 @@ interface XRSession {
|
|
|
requestHitTest(ray: XRRay, referenceSpace: XRReferenceSpace): Promise<XRHitResult[]>;
|
|
|
|
|
|
// legacy plane detection
|
|
|
- updateWorldTrackingState(options: {
|
|
|
- planeDetectionState?: { enabled: boolean; }
|
|
|
- }): void;
|
|
|
+ updateWorldTrackingState(options: { planeDetectionState?: { enabled: boolean } }): void;
|
|
|
}
|
|
|
|
|
|
interface XRReferenceSpace extends XRSpace {
|
|
@@ -75700,7 +75892,7 @@ interface XRFrame {
|
|
|
getPose(space: XRSpace, baseSpace: XRSpace): XRPose | undefined;
|
|
|
|
|
|
// AR
|
|
|
- getHitTestResults(hitTestSource: XRHitTestSource): Array<XRHitTestResult> ;
|
|
|
+ getHitTestResults(hitTestSource: XRHitTestSource): Array<XRHitTestResult>;
|
|
|
getHitTestResultsForTransientInput(hitTestSource: XRTransientInputHitTestSource): Array<XRTransientInputHitTestResult>;
|
|
|
// Anchors
|
|
|
trackedAnchors?: XRAnchorSet;
|
|
@@ -75709,6 +75901,8 @@ interface XRFrame {
|
|
|
worldInformation: {
|
|
|
detectedPlanes?: XRPlaneSet;
|
|
|
};
|
|
|
+ // Hand tracking
|
|
|
+ getJointPose(joint: XRJointSpace, baseSpace: XRSpace): XRJointPose;
|
|
|
}
|
|
|
|
|
|
interface XRViewerPose extends XRPose {
|
|
@@ -75731,7 +75925,7 @@ interface XRWebGLLayerOptions {
|
|
|
|
|
|
declare var XRWebGLLayer: {
|
|
|
prototype: XRWebGLLayer;
|
|
|
- new(session: XRSession, context: WebGLRenderingContext | undefined, options?: XRWebGLLayerOptions): XRWebGLLayer;
|
|
|
+ new (session: XRSession, context: WebGLRenderingContext | undefined, options?: XRWebGLLayerOptions): XRWebGLLayer;
|
|
|
};
|
|
|
interface XRWebGLLayer {
|
|
|
framebuffer: WebGLFramebuffer;
|
|
@@ -75776,7 +75970,7 @@ declare class XRRay {
|
|
|
declare enum XRHitTestTrackableType {
|
|
|
"point",
|
|
|
"plane",
|
|
|
- "mesh"
|
|
|
+ "mesh",
|
|
|
}
|
|
|
|
|
|
interface XRHitResult {
|
|
@@ -75824,7 +76018,49 @@ interface XRPlane {
|
|
|
planeSpace: XRSpace;
|
|
|
polygon: Array<DOMPointReadOnly>;
|
|
|
lastChangedTime: number;
|
|
|
-}
|
|
|
+}
|
|
|
+
|
|
|
+interface XRJointSpace extends XRSpace {}
|
|
|
+
|
|
|
+interface XRJointPose extends XRPose {
|
|
|
+ radius: number | undefined;
|
|
|
+}
|
|
|
+
|
|
|
+declare class XRHand extends Array<XRJointSpace> {
|
|
|
+ readonly length: number;
|
|
|
+
|
|
|
+ static readonly WRIST = 0;
|
|
|
+
|
|
|
+ static readonly THUMB_METACARPAL = 1;
|
|
|
+ static readonly THUMB_PHALANX_PROXIMAL = 2;
|
|
|
+ static readonly THUMB_PHALANX_DISTAL = 3;
|
|
|
+ static readonly THUMB_PHALANX_TIP = 4;
|
|
|
+
|
|
|
+ static readonly INDEX_METACARPAL = 5;
|
|
|
+ static readonly INDEX_PHALANX_PROXIMAL = 6;
|
|
|
+ static readonly INDEX_PHALANX_INTERMEDIATE = 7;
|
|
|
+ static readonly INDEX_PHALANX_DISTAL = 8;
|
|
|
+ static readonly INDEX_PHALANX_TIP = 9;
|
|
|
+
|
|
|
+ static readonly MIDDLE_METACARPAL = 10;
|
|
|
+ static readonly MIDDLE_PHALANX_PROXIMAL = 11;
|
|
|
+ static readonly MIDDLE_PHALANX_INTERMEDIATE = 12;
|
|
|
+ static readonly MIDDLE_PHALANX_DISTAL = 13;
|
|
|
+ static readonly MIDDLE_PHALANX_TIP = 14;
|
|
|
+
|
|
|
+ static readonly RING_METACARPAL = 15;
|
|
|
+ static readonly RING_PHALANX_PROXIMAL = 16;
|
|
|
+ static readonly RING_PHALANX_INTERMEDIATE = 17;
|
|
|
+ static readonly RING_PHALANX_DISTAL = 18;
|
|
|
+ static readonly RING_PHALANX_TIP = 19;
|
|
|
+
|
|
|
+ static readonly LITTLE_METACARPAL = 20;
|
|
|
+ static readonly LITTLE_PHALANX_PROXIMAL = 21;
|
|
|
+ static readonly LITTLE_PHALANX_INTERMEDIATE = 22;
|
|
|
+ static readonly LITTLE_PHALANX_DISTAL = 23;
|
|
|
+ static readonly LITTLE_PHALANX_TIP = 24;
|
|
|
+}
|
|
|
+
|
|
|
// This file contains native only extensions for WebXR These APIs are not supported in the browser yet.
|
|
|
// They are intended for use with either Babylon Native https://github.com/BabylonJS/BabylonNative or
|
|
|
// Babylon React Native: https://github.com/BabylonJS/BabylonReactNative
|
|
@@ -80165,11 +80401,13 @@ declare module BABYLON {
|
|
|
preprocessUrlAsync: (url: string) => Promise<string>;
|
|
|
/**
|
|
|
* Observable raised when the loader creates a mesh after parsing the glTF properties of the mesh.
|
|
|
+ * Note that the observable is raised as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
|
|
|
*/
|
|
|
readonly onMeshLoadedObservable: Observable<AbstractMesh>;
|
|
|
private _onMeshLoadedObserver;
|
|
|
/**
|
|
|
* Callback raised when the loader creates a mesh after parsing the glTF properties of the mesh.
|
|
|
+ * Note that the callback is called as soon as the mesh object is created, meaning some data may not have been setup yet for this mesh (vertex data, morph targets, material, ...)
|
|
|
*/
|
|
|
set onMeshLoaded(callback: (mesh: AbstractMesh) => void);
|
|
|
/**
|