1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- import type { WebXRSessionManager } from "../webXRSessionManager";
- import { WebXRAbstractFeature } from "./WebXRAbstractFeature";
- import { Observable } from "../../Misc/observable";
- import { BaseTexture } from "../../Materials/Textures/baseTexture";
- /**
- * Options for raw camera access
- */
- export interface IWebXRRawCameraAccessOptions {
- /**
- * Keep the created textures and metadata when detaching the feature.
- */
- doNotDisposeOnDetach?: boolean;
- }
- /**
- * WebXR Feature for WebXR raw camera access
- * @since 6.31.0
- * @see https://immersive-web.github.io/raw-camera-access/
- */
- export declare class WebXRRawCameraAccess extends WebXRAbstractFeature {
- readonly options: IWebXRRawCameraAccessOptions;
- private _cachedInternalTextures;
- /**
- * This is an array of camera views
- * Note that mostly the array will contain a single view
- * If you want to know the order of the views, use the `viewIndex` array
- */
- texturesData: BaseTexture[];
- /**
- * If needed, this array will contain the eye definition of each texture in `texturesArray`
- */
- viewIndex: string[];
- /**
- * If needed, this array will contain the camera's intrinsics
- * You can use this data to convert from camera space to screen space and vice versa
- */
- cameraIntrinsics: {
- u0: number;
- v0: number;
- ax: number;
- ay: number;
- gamma: number;
- width: number;
- height: number;
- viewportX: number;
- viewportY: number;
- }[];
- /**
- * An observable that will notify when the camera's textures are updated
- */
- onTexturesUpdatedObservable: Observable<BaseTexture[]>;
- private _glBinding?;
- private _glContext;
- /**
- * The module's name
- */
- static readonly Name = "xr-raw-camera-access";
- /**
- * 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 = 1;
- /**
- * Creates a new instance of the feature
- * @param _xrSessionManager the WebXRSessionManager
- * @param options options for the Feature
- */
- constructor(_xrSessionManager: WebXRSessionManager, options?: IWebXRRawCameraAccessOptions);
- attach(force?: boolean | undefined): boolean;
- detach(): boolean;
- /**
- * Dispose this feature and all of the resources attached
- */
- dispose(): void;
- /**
- * @see https://github.com/immersive-web/raw-camera-access/blob/main/explainer.md
- * @param view the XRView to update
- * @param index the index of the view in the views array
- */
- private _updateCameraIntrinsics;
- private _updateInternalTextures;
- protected _onXRFrame(_xrFrame: XRFrame): void;
- }
|