5179f10f7cd14dac93df92c11c55cd72b1704cb2c60426d040deb22a39fe5c7e.json 8.9 KB

1
  1. {"ast":null,"code":"import { RegisterNativeTypeAsync } from \"../../Engines/nativeEngine.js\";\n/** @internal */\nexport class NativeXRFrame {\n get session() {\n return this._nativeImpl.session;\n }\n constructor(_nativeImpl) {\n this._nativeImpl = _nativeImpl;\n this._xrTransform = new XRRigidTransform();\n this._xrPose = {\n transform: this._xrTransform,\n emulatedPosition: false\n };\n // Enough space for position, orientation\n this._xrPoseVectorData = new Float32Array(4 + 4);\n this.fillPoses = this._nativeImpl.fillPoses.bind(this._nativeImpl);\n this.getViewerPose = this._nativeImpl.getViewerPose.bind(this._nativeImpl);\n this.getHitTestResults = this._nativeImpl.getHitTestResults.bind(this._nativeImpl);\n this.getHitTestResultsForTransientInput = () => {\n throw new Error(\"XRFrame.getHitTestResultsForTransientInput not supported on native.\");\n };\n this.createAnchor = this._nativeImpl.createAnchor.bind(this._nativeImpl);\n this.getJointPose = this._nativeImpl.getJointPose.bind(this._nativeImpl);\n this.fillJointRadii = this._nativeImpl.fillJointRadii.bind(this._nativeImpl);\n this.getLightEstimate = () => {\n throw new Error(\"XRFrame.getLightEstimate not supported on native.\");\n };\n this.getImageTrackingResults = () => {\n var _this$_nativeImpl$_im;\n return (_this$_nativeImpl$_im = this._nativeImpl._imageTrackingResults) !== null && _this$_nativeImpl$_im !== void 0 ? _this$_nativeImpl$_im : [];\n };\n }\n getPose(space, baseSpace) {\n if (!this._nativeImpl.getPoseData(space, baseSpace, this._xrPoseVectorData.buffer, this._xrTransform.matrix.buffer)) {\n return undefined;\n }\n const position = this._xrTransform.position;\n position.x = this._xrPoseVectorData[0];\n position.y = this._xrPoseVectorData[1];\n position.z = this._xrPoseVectorData[2];\n position.w = this._xrPoseVectorData[3];\n const orientation = this._xrTransform.orientation;\n orientation.x = this._xrPoseVectorData[4];\n orientation.y = this._xrPoseVectorData[5];\n orientation.z = this._xrPoseVectorData[6];\n orientation.w = this._xrPoseVectorData[7];\n return this._xrPose;\n }\n get trackedAnchors() {\n return this._nativeImpl.trackedAnchors;\n }\n get worldInformation() {\n return this._nativeImpl.worldInformation;\n }\n get detectedPlanes() {\n return this._nativeImpl.detectedPlanes;\n }\n get featurePointCloud() {\n return this._nativeImpl.featurePointCloud;\n }\n getDepthInformation(view) {\n throw new Error(\"This function is not available in Babylon Native\");\n // return this._nativeImpl.getDepthInformation(view);\n }\n}\nRegisterNativeTypeAsync(\"NativeXRFrame\", NativeXRFrame);","map":{"version":3,"names":["RegisterNativeTypeAsync","NativeXRFrame","session","_nativeImpl","constructor","_xrTransform","XRRigidTransform","_xrPose","transform","emulatedPosition","_xrPoseVectorData","Float32Array","fillPoses","bind","getViewerPose","getHitTestResults","getHitTestResultsForTransientInput","Error","createAnchor","getJointPose","fillJointRadii","getLightEstimate","getImageTrackingResults","_this$_nativeImpl$_im","_imageTrackingResults","getPose","space","baseSpace","getPoseData","buffer","matrix","undefined","position","x","y","z","w","orientation","trackedAnchors","worldInformation","detectedPlanes","featurePointCloud","getDepthInformation","view"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/XR/native/nativeXRFrame.js"],"sourcesContent":["import { RegisterNativeTypeAsync } from \"../../Engines/nativeEngine.js\";\n/** @internal */\nexport class NativeXRFrame {\n get session() {\n return this._nativeImpl.session;\n }\n constructor(_nativeImpl) {\n this._nativeImpl = _nativeImpl;\n this._xrTransform = new XRRigidTransform();\n this._xrPose = {\n transform: this._xrTransform,\n emulatedPosition: false,\n };\n // Enough space for position, orientation\n this._xrPoseVectorData = new Float32Array(4 + 4);\n this.fillPoses = this._nativeImpl.fillPoses.bind(this._nativeImpl);\n this.getViewerPose = this._nativeImpl.getViewerPose.bind(this._nativeImpl);\n this.getHitTestResults = this._nativeImpl.getHitTestResults.bind(this._nativeImpl);\n this.getHitTestResultsForTransientInput = () => {\n throw new Error(\"XRFrame.getHitTestResultsForTransientInput not supported on native.\");\n };\n this.createAnchor = this._nativeImpl.createAnchor.bind(this._nativeImpl);\n this.getJointPose = this._nativeImpl.getJointPose.bind(this._nativeImpl);\n this.fillJointRadii = this._nativeImpl.fillJointRadii.bind(this._nativeImpl);\n this.getLightEstimate = () => {\n throw new Error(\"XRFrame.getLightEstimate not supported on native.\");\n };\n this.getImageTrackingResults = () => {\n return this._nativeImpl._imageTrackingResults ?? [];\n };\n }\n getPose(space, baseSpace) {\n if (!this._nativeImpl.getPoseData(space, baseSpace, this._xrPoseVectorData.buffer, this._xrTransform.matrix.buffer)) {\n return undefined;\n }\n const position = this._xrTransform.position;\n position.x = this._xrPoseVectorData[0];\n position.y = this._xrPoseVectorData[1];\n position.z = this._xrPoseVectorData[2];\n position.w = this._xrPoseVectorData[3];\n const orientation = this._xrTransform.orientation;\n orientation.x = this._xrPoseVectorData[4];\n orientation.y = this._xrPoseVectorData[5];\n orientation.z = this._xrPoseVectorData[6];\n orientation.w = this._xrPoseVectorData[7];\n return this._xrPose;\n }\n get trackedAnchors() {\n return this._nativeImpl.trackedAnchors;\n }\n get worldInformation() {\n return this._nativeImpl.worldInformation;\n }\n get detectedPlanes() {\n return this._nativeImpl.detectedPlanes;\n }\n get featurePointCloud() {\n return this._nativeImpl.featurePointCloud;\n }\n getDepthInformation(view) {\n throw new Error(\"This function is not available in Babylon Native\");\n // return this._nativeImpl.getDepthInformation(view);\n }\n}\nRegisterNativeTypeAsync(\"NativeXRFrame\", NativeXRFrame);\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ,+BAA+B;AACvE;AACA,OAAO,MAAMC,aAAa,CAAC;EACvB,IAAIC,OAAOA,CAAA,EAAG;IACV,OAAO,IAAI,CAACC,WAAW,CAACD,OAAO;EACnC;EACAE,WAAWA,CAACD,WAAW,EAAE;IACrB,IAAI,CAACA,WAAW,GAAGA,WAAW;IAC9B,IAAI,CAACE,YAAY,GAAG,IAAIC,gBAAgB,CAAC,CAAC;IAC1C,IAAI,CAACC,OAAO,GAAG;MACXC,SAAS,EAAE,IAAI,CAAC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