UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

39 lines (38 loc) 1.75 kB
"use strict"; import { ParamConfig } from "../../../engine/nodes/utils/params/ParamsConfig"; import { CameraWebXRVRSopOperation } from "../../../engine/operations/sop/CameraWebXRVR"; import { DEFAULT_WEBXR_REFERENCE_SPACE_TYPE, WEBXR_FEATURE_PARAM_OPTIONS, WEBXR_REFERENCE_SPACE_TYPES } from "../../webXR/Common"; const DEFAULT = CameraWebXRVRSopOperation.DEFAULT_PARAMS; export function CoreCameraWebXRVRParamConfig(Base) { return class Mixin extends Base { constructor() { super(...arguments); /** @param loads AR session with 'local-floor' feature */ this.localFloor = ParamConfig.INTEGER(DEFAULT.localFloor, WEBXR_FEATURE_PARAM_OPTIONS); /** @param loads AR session with 'bounded-floor' feature */ this.boundedFloor = ParamConfig.INTEGER(DEFAULT.boundedFloor, WEBXR_FEATURE_PARAM_OPTIONS); /** @param loads AR session with 'hand-tracking' feature */ this.handTracking = ParamConfig.INTEGER(DEFAULT.handTracking, WEBXR_FEATURE_PARAM_OPTIONS); /** @param loads AR session with 'layers' feature */ this.layers = ParamConfig.INTEGER(DEFAULT.layers, WEBXR_FEATURE_PARAM_OPTIONS); /** @param overrides referenceSpaceType */ this.overrideReferenceSpaceType = ParamConfig.BOOLEAN(0); /** @param set referenceSpaceType ( see doc: https://immersive-web.github.io/webxr/#xrreferencespace-interface ) */ this.referenceSpaceType = ParamConfig.INTEGER( WEBXR_REFERENCE_SPACE_TYPES.indexOf(DEFAULT_WEBXR_REFERENCE_SPACE_TYPE), { menu: { entries: WEBXR_REFERENCE_SPACE_TYPES.map((name, value) => ({ name, value })) }, visibleIf: { overrideReferenceSpaceType: 1 } } ); } }; }