UNPKG

@polygonjs/polygonjs

Version:

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

37 lines (36 loc) 1.61 kB
"use strict"; import { ParamConfig } from "../../../engine/nodes/utils/params/ParamsConfig"; import { CameraWebXRARSopOperation } from "../../../engine/operations/sop/CameraWebXRAR"; import { DEFAULT_WEBXR_REFERENCE_SPACE_TYPE, WEBXR_FEATURE_PARAM_OPTIONS, WEBXR_REFERENCE_SPACE_TYPES } from "../../webXR/Common"; const DEFAULT = CameraWebXRARSopOperation.DEFAULT_PARAMS; export function CoreCameraWebXRARParamConfig(Base) { return class Mixin extends Base { constructor() { super(...arguments); /** @param loads AR session with 'hit-test' feature */ this.hitTest = ParamConfig.INTEGER(DEFAULT.hitTest, WEBXR_FEATURE_PARAM_OPTIONS); /** @param loads AR session with 'light-estimation' feature */ this.lightEstimation = ParamConfig.INTEGER(DEFAULT.lightEstimation, WEBXR_FEATURE_PARAM_OPTIONS); /** @param loads AR session with 'camera-access' feature */ this.cameraAccess = ParamConfig.INTEGER(DEFAULT.cameraAccess, 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 } } ); } }; }