gps-plus-slam-app-framework 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -15
- package/dist/{app-selectors-BeU0_ab8.d.ts → app-selectors-CR9OWodf.d.ts} +1 -1
- package/dist/ar/camera-blit-capture.d.ts +1 -1
- package/dist/ar/capability-checker.d.ts +2 -0
- package/dist/ar/capability-checker.js +25 -0
- package/dist/ar/capture-failure-tracker.d.ts +1 -1
- package/dist/ar/chromium-camera-access-workaround.d.ts +2 -2
- package/dist/ar/chromium-camera-access-workaround.js +197 -8
- package/dist/ar/depth-sampler.d.ts +2 -2
- package/dist/ar/enable-gps-ar.d.ts +2 -0
- package/dist/ar/enable-gps-ar.js +137 -0
- package/dist/ar/frame-loop.d.ts +1 -1
- package/dist/ar/frame-loop.js +24 -1
- package/dist/ar/image-capture.d.ts +1 -1
- package/dist/ar/index.d.ts +15 -11
- package/dist/ar/index.js +7 -3
- package/dist/ar/replay-scene.d.ts +1 -1
- package/dist/ar/scene-node-names.d.ts +1 -1
- package/dist/ar/webxr-session.d.ts +4 -4
- package/dist/ar/webxr-session.js +23 -38
- package/dist/ar/xr-error-handler.d.ts +1 -1
- package/dist/ar/xr-frame-loop.d.ts +2 -0
- package/dist/ar/xr-frame-loop.js +69 -0
- package/dist/ar-world-group-alignment-Dn4rQk_c.d.ts +43 -0
- package/dist/capability-checker-BTCmZRL4.d.ts +43 -0
- package/dist/chromium-camera-access-workaround-MifIwK9x.d.ts +137 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/{create-slam-app-store-CNsZ3rcX.d.ts → create-slam-app-store-B76AGaI0.d.ts} +5 -5
- package/dist/{depth-sampler-xg8vna6c.d.ts → depth-sampler-CqrkRr2N.d.ts} +1 -1
- package/dist/enable-gps-ar-DNbO0zbg.d.ts +95 -0
- package/dist/{file-system-DTApEv_Q.d.ts → file-system-TIsDfamK.d.ts} +1 -1
- package/dist/frame-conversions-D2EYjeNa.d.ts +54 -0
- package/dist/{frame-loop-QJIxLin0.d.ts → frame-loop-BTeRpDm4.d.ts} +5 -0
- package/dist/{fused-path-CB4DwWOG.d.ts → fused-path-BdVHmDW9.d.ts} +1 -1
- package/dist/geo/h3-proximity.d.ts +1 -1
- package/dist/geo/index.d.ts +1 -1
- package/dist/{gps-anchor-CnWY61XK.d.ts → gps-anchor-CISLPQIb.d.ts} +12 -1
- package/dist/{gps-ar-pose-sampler-DsM1Kb2N.d.ts → gps-ar-pose-sampler-BypXZUqC.d.ts} +1 -1
- package/dist/{gps-event-coordinator-DBx9I1YX.d.ts → gps-event-coordinator-BKVZbS1M.d.ts} +3 -3
- package/dist/hit-test-reticle-BGXOxrUh.d.ts +45 -0
- package/dist/{image-capture-DZLxHDN9.d.ts → image-capture-BXZUmj7j.d.ts} +1 -1
- package/dist/index-22v8MXJX.d.ts +23 -0
- package/dist/index-BB2KEWbN2.d.ts +37 -0
- package/dist/index.d.ts +63 -57
- package/dist/index.js +14 -7
- package/dist/{leaflet-map-overlay-Cew7XAoO.d.ts → leaflet-map-overlay-jNt-kcUr.d.ts} +1 -1
- package/dist/{map-data-sih4g64v.d.ts → map-data-BGIBM5rv.d.ts} +1 -1
- package/dist/{map-overlay-draw-B3R1c9Xp.d.ts → map-overlay-draw-DcGs9UV3.d.ts} +1 -1
- package/dist/{null-storage-backend-BKOS7JpL.d.ts → null-storage-backend-BPQJSaMw.d.ts} +2 -2
- package/dist/{opfs-storage-backend-Cj_7PWoq.d.ts → opfs-storage-backend-u4QKvgvP.d.ts} +2 -2
- package/dist/{persistence-middleware-BkHIqvaA.d.ts → persistence-middleware-xB5sTllJ.d.ts} +1 -1
- package/dist/{recording-options-Dq6IsKAv.d.ts → recording-options-BSFpBSZH.d.ts} +10 -4
- package/dist/{recording-replayer-CmCIIZ02.d.ts → recording-replayer-CTL2cUE0.d.ts} +2 -2
- package/dist/{recording-slice-d6OtCrza.d.ts → recording-slice-Cb888P6d.d.ts} +2 -2
- package/dist/{replay-engine-BGBRQyXs.d.ts → replay-engine-B-5GIZtc.d.ts} +1 -1
- package/dist/{replay-scene-DpAGcAKY.d.ts → replay-scene-DkNfldPh.d.ts} +3 -3
- package/dist/sensors/gps-error-handler.d.ts +1 -1
- package/dist/sensors/gps.d.ts +1 -1
- package/dist/sensors/index.d.ts +3 -3
- package/dist/sensors/index.js +1 -1
- package/dist/sensors/permission-checker.d.ts +1 -1
- package/dist/session-disposers-M-oashRH.js +57 -0
- package/dist/state/app-selectors.d.ts +1 -1
- package/dist/state/combined-root-state.d.ts +1 -1
- package/dist/state/create-slam-app-store.d.ts +1 -1
- package/dist/state/gps-ar-pose-sampler.d.ts +3 -3
- package/dist/state/gps-event-coordinator.d.ts +1 -1
- package/dist/state/index.d.ts +17 -17
- package/dist/state/index.js +2 -2
- package/dist/state/persistence-middleware.d.ts +1 -1
- package/dist/state/persistence-middleware.js +9 -3
- package/dist/state/recording-options.d.ts +1 -1
- package/dist/state/recording-replayer.d.ts +2 -2
- package/dist/state/recording-slice.d.ts +1 -1
- package/dist/state/replay-engine.d.ts +1 -1
- package/dist/state/store-subscribers.d.ts +2 -2
- package/dist/state/subscribe-to-selector.d.ts +1 -1
- package/dist/state/tracking-quality.d.ts +1 -1
- package/dist/state/tracking-slice.d.ts +1 -1
- package/dist/state-BkIfpiyA.js +87 -0
- package/dist/storage/file-system-utils.d.ts +1 -1
- package/dist/storage/file-system.d.ts +1 -1
- package/dist/storage/index.d.ts +8 -8
- package/dist/storage/null-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage-backend.d.ts +1 -1
- package/dist/storage/opfs-storage.d.ts +1 -1
- package/dist/storage/storage-backend.d.ts +1 -1
- package/dist/storage/zip-export.d.ts +1 -1
- package/dist/storage/zip-reader.d.ts +1 -1
- package/dist/{storage-backend-CT0Il_AB.d.ts → storage-backend-yDSKafAQ.d.ts} +1 -1
- package/dist/{store-subscribers-Dce_CoJF.d.ts → store-subscribers-swlbtg_z.d.ts} +2 -2
- package/dist/{subscribe-to-selector-DIHm3BRZ.d.ts → subscribe-to-selector--KQpgLXG.d.ts} +1 -1
- package/dist/test-utils/browser-mocks.d.ts +1 -1
- package/dist/test-utils/zip-round-trip-helpers.d.ts +1 -1
- package/dist/{tracking-slice-utCNND8t.d.ts → tracking-slice-CDREeoZ_.d.ts} +1 -1
- package/dist/types/ar-types.d.ts +1 -1
- package/dist/types/geo-types.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/utils/concurrency.d.ts +1 -1
- package/dist/utils/failure-tracker.d.ts +1 -1
- package/dist/utils/format-file-size.d.ts +1 -1
- package/dist/utils/fused-path.d.ts +1 -1
- package/dist/utils/index.d.ts +6 -6
- package/dist/utils/list-formatter.d.ts +1 -1
- package/dist/utils/logger.d.ts +1 -1
- package/dist/visualization/accuracy-circles.d.ts +1 -1
- package/dist/visualization/alignment-lerper.d.ts +1 -1
- package/dist/visualization/ar-world-group-alignment.d.ts +2 -0
- package/dist/visualization/ar-world-group-alignment.js +51 -0
- package/dist/visualization/camera-follower.d.ts +1 -1
- package/dist/visualization/css3d-renderer-manager.d.ts +1 -1
- package/dist/visualization/frame-conversions.d.ts +2 -0
- package/dist/visualization/frame-conversions.js +88 -0
- package/dist/visualization/frustum-visibility.d.ts +1 -1
- package/dist/visualization/gps-anchor.d.ts +1 -1
- package/dist/visualization/gps-anchor.js +216 -1
- package/dist/visualization/gps-compass-cubes.d.ts +1 -1
- package/dist/visualization/gps-event-markers.d.ts +1 -1
- package/dist/visualization/hit-test-reticle.d.ts +2 -0
- package/dist/visualization/hit-test-reticle.js +81 -0
- package/dist/visualization/index.d.ts +19 -17
- package/dist/visualization/index.js +5 -2
- package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
- package/dist/visualization/lerp-utils.d.ts +1 -1
- package/dist/visualization/map-data.d.ts +1 -1
- package/dist/visualization/map-overlay-draw.d.ts +1 -1
- package/dist/visualization/map-overlay.d.ts +1 -1
- package/dist/visualization/three-dispose.d.ts +1 -1
- package/dist/visualization/vis-colors.d.ts +1 -1
- package/dist/webxr-nue-basis-BbdqhqY6.js +54 -0
- package/dist/{webxr-session-DB5cIZnN.d.ts → webxr-session-BnArFCew.d.ts} +29 -8
- package/dist/xr-frame-loop-BKckC7xC.d.ts +70 -0
- package/package.json +1 -1
- package/dist/chromium-camera-access-workaround-NvChXsi8.d.ts +0 -61
- package/dist/gps-anchor-DjC_3MoT.js +0 -257
- package/dist/index-pOjUCKEP.d.ts +0 -24
- /package/dist/{accuracy-circles-CsxE_7x1.d.ts → accuracy-circles-DEKr0Hoh.d.ts} +0 -0
- /package/dist/{alignment-lerper-L1RbWHQ4.d.ts → alignment-lerper-CCZJf-Xb.d.ts} +0 -0
- /package/dist/{ar-types-Ck8LEq8k.d.ts → ar-types-isPsQptb.d.ts} +0 -0
- /package/dist/{camera-blit-capture-C1V9I1Z6.d.ts → camera-blit-capture-75WWa9Xb.d.ts} +0 -0
- /package/dist/{camera-follower-1k8mnw5J.d.ts → camera-follower-B-nS1sr6.d.ts} +0 -0
- /package/dist/{capture-failure-tracker-JKb1ST8E.d.ts → capture-failure-tracker-D4HYJNOj.d.ts} +0 -0
- /package/dist/{concurrency-CMw8pSaG.d.ts → concurrency-Bsmv53qw.d.ts} +0 -0
- /package/dist/{css3d-renderer-manager-CkjCb2HW.d.ts → css3d-renderer-manager-EDED3nvg.d.ts} +0 -0
- /package/dist/{failure-tracker-DnHXOIRa.d.ts → failure-tracker-D7ELffm0.d.ts} +0 -0
- /package/dist/{file-system-utils-CtKiiw27.d.ts → file-system-utils-BH6uIs2i.d.ts} +0 -0
- /package/dist/{format-file-size-BTS5H62-.d.ts → format-file-size-B7gJb3Md.d.ts} +0 -0
- /package/dist/{frustum-visibility-BHnFrSKQ.d.ts → frustum-visibility-DGnJqls0.d.ts} +0 -0
- /package/dist/{geo-types-CTuF23gG.d.ts → geo-types-clgzl8b5.d.ts} +0 -0
- /package/dist/{gps-DXoQb9Kf.d.ts → gps-B7AlMPz5.d.ts} +0 -0
- /package/dist/{gps-compass-cubes-CsLtFv4B.d.ts → gps-compass-cubes-Ys6Hf1nc.d.ts} +0 -0
- /package/dist/{gps-error-handler-Dg3ziRVY.d.ts → gps-error-handler-BLDhUlw5.d.ts} +0 -0
- /package/dist/{gps-event-markers-BGr-iLvi.d.ts → gps-event-markers-BlHq3jYV.d.ts} +0 -0
- /package/dist/{h3-proximity-BhfgNbdW.d.ts → h3-proximity-DJnghtir.d.ts} +0 -0
- /package/dist/{index-gzWJMVpo.d.ts → index--ldLph4V.d.ts} +0 -0
- /package/dist/{lerp-utils-B8MM8zCR.d.ts → lerp-utils-DNcSmKVX.d.ts} +0 -0
- /package/dist/{list-formatter-CNqi-E2j.d.ts → list-formatter-CsqcU4v5.d.ts} +0 -0
- /package/dist/{logger-C9vugiQb.d.ts → logger-BZ44Dhd3.d.ts} +0 -0
- /package/dist/{map-overlay-DAmreyA3.d.ts → map-overlay-yrFsUtGv.d.ts} +0 -0
- /package/dist/{opfs-storage-DOPkzgeT.d.ts → opfs-storage-LsLY6VZV.d.ts} +0 -0
- /package/dist/{permission-checker-DPJl_RU6.d.ts → permission-checker-CfV7INCa.d.ts} +0 -0
- /package/dist/{scene-node-names-6LBjPmwz.d.ts → scene-node-names-IHW7HR4S.d.ts} +0 -0
- /package/dist/{three-dispose-C2drkp6f.d.ts → three-dispose-WTBAfaWU.d.ts} +0 -0
- /package/dist/{vis-colors-CHQhjal3.d.ts → vis-colors-Djnyg_UH.d.ts} +0 -0
- /package/dist/{xr-error-handler-CDY5QxGb.d.ts → xr-error-handler-DcUFshNF.d.ts} +0 -0
- /package/dist/{zip-export-QO4iLIi7.d.ts → zip-export-C0_ErAqT.d.ts} +0 -0
- /package/dist/{zip-reader-D1105idz.d.ts → zip-reader-B2lzN8F5.d.ts} +0 -0
package/dist/ar/index.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { i as computeCaptureSize, n as CameraBlitCaptureConfig, r as DEFAULT_BLIT_CONFIG, t as CameraBlitCapture } from "../camera-blit-capture-
|
|
2
|
-
import {
|
|
3
|
-
import { n as
|
|
4
|
-
import { i as
|
|
5
|
-
import { r as
|
|
6
|
-
import { a as ImageCaptureManager, i as ImageCaptureConfig, n as DEFAULT_CAPTURE_CONFIG, o as MIN_VALID_IMAGE_BYTES, r as ImageCaptureCallbacks, t as CapturedImage } from "../image-capture-
|
|
7
|
-
import { a as getCameraFollower, c as getReplayState, d as updateOrbitTarget, i as getAlignmentLerper, l as initReplayScene, n as ReplaySceneState, o as getCameraMode, r as disposeReplayScene, t as CameraMode, u as toggleCameraMode } from "../replay-scene-DpAGcAKY.js";
|
|
8
|
-
import { t as SCENE_NODE } from "../scene-node-names-6LBjPmwz.js";
|
|
1
|
+
import { i as computeCaptureSize, n as CameraBlitCaptureConfig, r as DEFAULT_BLIT_CONFIG, t as CameraBlitCapture } from "../camera-blit-capture-75WWa9Xb.js";
|
|
2
|
+
import { i as isFullySupported, n as CapabilitySupport, r as capabilityMessage, t as CapabilityMessageOptions } from "../capability-checker-BTCmZRL4.js";
|
|
3
|
+
import { a as createCaptureFailureTracker, i as DEFAULT_CAPTURE_TRACKER_CONFIG, n as CaptureFailureTracker, r as CaptureFailureTrackerConfig, t as CAPTURE_FAILURE_WARNING } from "../capture-failure-tracker-D4HYJNOj.js";
|
|
4
|
+
import { a as applyChromiumProjectionLayerWorkaround, i as ChromiumProjectionLayerWorkaroundResult, n as BASELAYER_WINDOW_MIN, o as needsBaseLayerPersistence, r as ChromeVersion, s as parseChromeVersion, t as BASELAYER_WINDOW_MAX } from "../chromium-camera-access-workaround-MifIwK9x.js";
|
|
5
|
+
import { i as DepthSamplerConfig, n as DepthSampler, r as DepthSamplerCallbacks, t as DepthInfo } from "../depth-sampler-CqrkRr2N.js";
|
|
6
|
+
import { a as ImageCaptureManager, i as ImageCaptureConfig, n as DEFAULT_CAPTURE_CONFIG, o as MIN_VALID_IMAGE_BYTES, r as ImageCaptureCallbacks, t as CapturedImage } from "../image-capture-BXZUmj7j.js";
|
|
9
7
|
import { i as acquireCameraTexture, n as RendererLike, r as XRCameraLike, t as CameraTextureResult } from "../xr-camera-texture-BU5YvKAM.js";
|
|
10
|
-
import {
|
|
11
|
-
import { n as
|
|
12
|
-
|
|
8
|
+
import { D as setDepthCaptureCallback, I as startDepthCapture, L as startImageCapture, M as setTrackingLostCallback, O as setFrameCallback, P as setTrackingStore, R as stopDepthCapture, d as getCamera, f as getCurrentArPose, g as getScene, h as getLiveCss3dManager, j as setTrackingCallbacks, k as setImageCaptureCallback, m as getImageCaptureFrameCount, o as endARSession, p as getDepthSampleCount, t as SessionFeatureOptions, u as getArWorldGroup, v as initAR, z as stopImageCapture } from "../webxr-session-BnArFCew.js";
|
|
9
|
+
import { a as EnableGpsArState, i as EnableGpsArResult, n as EnableGpsArController, o as EnableGpsArStatus, r as EnableGpsArDeps, s as createEnableGpsArController, t as EnableGpsArConfig } from "../enable-gps-ar-DNbO0zbg.js";
|
|
10
|
+
import { r as registerFrameUpdate, t as FrameUpdate } from "../frame-loop-BTeRpDm4.js";
|
|
11
|
+
import { i as registerXrFrameUpdate, n as XrFrameUpdate, t as XrFrameContext } from "../xr-frame-loop-BKckC7xC.js";
|
|
12
|
+
import { a as getCameraFollower, c as getReplayState, d as updateOrbitTarget, i as getAlignmentLerper, l as initReplayScene, n as ReplaySceneState, o as getCameraMode, r as disposeReplayScene, t as CameraMode, u as toggleCameraMode } from "../replay-scene-DkNfldPh.js";
|
|
13
|
+
import { t as SCENE_NODE } from "../scene-node-names-IHW7HR4S.js";
|
|
14
|
+
import { t as WEBXR_TO_NUE } from "../index-22v8MXJX.js";
|
|
15
|
+
import { n as XR_ERROR_MESSAGE_UNKNOWN, r as getXrErrorMessage, t as XR_ERROR_MESSAGES } from "../xr-error-handler-DcUFshNF.js";
|
|
16
|
+
export { BASELAYER_WINDOW_MAX, BASELAYER_WINDOW_MIN, CAPTURE_FAILURE_WARNING, CameraBlitCapture, CameraBlitCaptureConfig, CameraMode, CameraTextureResult, CapabilityMessageOptions, CapabilitySupport, CaptureFailureTracker, CaptureFailureTrackerConfig, CapturedImage, ChromeVersion, ChromiumProjectionLayerWorkaroundResult, DEFAULT_BLIT_CONFIG, DEFAULT_CAPTURE_CONFIG, DEFAULT_CAPTURE_TRACKER_CONFIG, DepthInfo, DepthSampler, DepthSamplerCallbacks, DepthSamplerConfig, EnableGpsArConfig, EnableGpsArController, EnableGpsArDeps, EnableGpsArResult, EnableGpsArState, EnableGpsArStatus, FrameUpdate, ImageCaptureCallbacks, ImageCaptureConfig, ImageCaptureManager, MIN_VALID_IMAGE_BYTES, RendererLike, ReplaySceneState, SCENE_NODE, SessionFeatureOptions, WEBXR_TO_NUE, XRCameraLike, XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, XrFrameContext, XrFrameUpdate, acquireCameraTexture, applyChromiumProjectionLayerWorkaround, capabilityMessage, computeCaptureSize, createCaptureFailureTracker, createEnableGpsArController, disposeReplayScene, endARSession, getAlignmentLerper, getArWorldGroup, getCamera, getCameraFollower, getCameraMode, getCurrentArPose, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, getReplayState, getScene, getXrErrorMessage, initAR, initReplayScene, isFullySupported, needsBaseLayerPersistence, parseChromeVersion, registerFrameUpdate, registerXrFrameUpdate, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, setTrackingStore, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture, toggleCameraMode, updateOrbitTarget };
|
package/dist/ar/index.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { CameraBlitCapture, DEFAULT_BLIT_CONFIG, computeCaptureSize } from "./camera-blit-capture.js";
|
|
2
|
-
import {
|
|
2
|
+
import { capabilityMessage, isFullySupported } from "./capability-checker.js";
|
|
3
|
+
import { BASELAYER_WINDOW_MAX, BASELAYER_WINDOW_MIN, applyChromiumProjectionLayerWorkaround, needsBaseLayerPersistence, parseChromeVersion } from "./chromium-camera-access-workaround.js";
|
|
3
4
|
import { CAPTURE_FAILURE_WARNING, DEFAULT_CAPTURE_TRACKER_CONFIG, createCaptureFailureTracker } from "./capture-failure-tracker.js";
|
|
4
5
|
import { DepthSampler } from "./depth-sampler.js";
|
|
5
6
|
import { registerFrameUpdate } from "./frame-loop.js";
|
|
7
|
+
import { registerXrFrameUpdate } from "./xr-frame-loop.js";
|
|
8
|
+
import { t as WEBXR_TO_NUE } from "../webxr-nue-basis-BbdqhqY6.js";
|
|
6
9
|
import { DEFAULT_CAPTURE_CONFIG, ImageCaptureManager, MIN_VALID_IMAGE_BYTES } from "./image-capture.js";
|
|
7
10
|
import { acquireCameraTexture } from "./xr-camera-texture.js";
|
|
8
11
|
import { SCENE_NODE } from "./scene-node-names.js";
|
|
9
|
-
import { endARSession, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, initAR, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, setTrackingStore, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture } from "./webxr-session.js";
|
|
12
|
+
import { endARSession, getArWorldGroup, getCamera, getCurrentArPose, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, getScene, initAR, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, setTrackingStore, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture } from "./webxr-session.js";
|
|
13
|
+
import { createEnableGpsArController } from "./enable-gps-ar.js";
|
|
10
14
|
import { disposeReplayScene, getAlignmentLerper, getCameraFollower, getCameraMode, getReplayState, initReplayScene, toggleCameraMode, updateOrbitTarget } from "./replay-scene.js";
|
|
11
15
|
import { XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, getXrErrorMessage } from "./xr-error-handler.js";
|
|
12
|
-
export { CAPTURE_FAILURE_WARNING, CameraBlitCapture, DEFAULT_BLIT_CONFIG, DEFAULT_CAPTURE_CONFIG, DEFAULT_CAPTURE_TRACKER_CONFIG, DepthSampler, ImageCaptureManager, MIN_VALID_IMAGE_BYTES, SCENE_NODE, XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, acquireCameraTexture, applyChromiumProjectionLayerWorkaround, computeCaptureSize, createCaptureFailureTracker, disposeReplayScene, endARSession, getAlignmentLerper, getCameraFollower, getCameraMode, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, getReplayState, getXrErrorMessage, initAR, initReplayScene, registerFrameUpdate, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, setTrackingStore, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture, toggleCameraMode, updateOrbitTarget };
|
|
16
|
+
export { BASELAYER_WINDOW_MAX, BASELAYER_WINDOW_MIN, CAPTURE_FAILURE_WARNING, CameraBlitCapture, DEFAULT_BLIT_CONFIG, DEFAULT_CAPTURE_CONFIG, DEFAULT_CAPTURE_TRACKER_CONFIG, DepthSampler, ImageCaptureManager, MIN_VALID_IMAGE_BYTES, SCENE_NODE, WEBXR_TO_NUE, XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, acquireCameraTexture, applyChromiumProjectionLayerWorkaround, capabilityMessage, computeCaptureSize, createCaptureFailureTracker, createEnableGpsArController, disposeReplayScene, endARSession, getAlignmentLerper, getArWorldGroup, getCamera, getCameraFollower, getCameraMode, getCurrentArPose, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, getReplayState, getScene, getXrErrorMessage, initAR, initReplayScene, isFullySupported, needsBaseLayerPersistence, parseChromeVersion, registerFrameUpdate, registerXrFrameUpdate, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setTrackingCallbacks, setTrackingLostCallback, setTrackingStore, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture, toggleCameraMode, updateOrbitTarget };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as getCameraFollower, c as getReplayState, d as updateOrbitTarget, i as getAlignmentLerper, l as initReplayScene, n as ReplaySceneState, o as getCameraMode, r as disposeReplayScene, s as getCss3dManager, t as CameraMode, u as toggleCameraMode } from "../replay-scene-
|
|
1
|
+
import { a as getCameraFollower, c as getReplayState, d as updateOrbitTarget, i as getAlignmentLerper, l as initReplayScene, n as ReplaySceneState, o as getCameraMode, r as disposeReplayScene, s as getCss3dManager, t as CameraMode, u as toggleCameraMode } from "../replay-scene-DkNfldPh.js";
|
|
2
2
|
export { CameraMode, ReplaySceneState, disposeReplayScene, getAlignmentLerper, getCameraFollower, getCameraMode, getCss3dManager, getReplayState, initReplayScene, toggleCameraMode, updateOrbitTarget };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as SCENE_NODE } from "../scene-node-names-
|
|
1
|
+
import { t as SCENE_NODE } from "../scene-node-names-IHW7HR4S.js";
|
|
2
2
|
export { SCENE_NODE };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as DepthSample, t as ARPose } from "../ar-types-
|
|
2
|
-
import { t as CapturedImage } from "../image-capture-
|
|
3
|
-
import { A as
|
|
4
|
-
export { ARPose, CapturedImage, DepthSample, TrackingSubscribableStore, applyAlignmentMatrix, buildSessionOptions, createSceneHierarchy, endARSession, extractPoseFromViewer, extractResetTransformData, getArPose, getArWorldGroup, getCamera, getCurrentArPose, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, getScene, getXrCameraFromPose, initAR, isWebXRSupported, isXRCameraLike, nuePositionToWebXR, nueQuaternionToWebXR, resetWebXRState, setArPose, setArWorldGroup, setCamera, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setScene, setTrackingCallbacks, setTrackingLostCallback, setTrackingRecoveredCallback, setTrackingStore, shouldLogCameraAccessDiagnostic, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture };
|
|
1
|
+
import { i as DepthSample, t as ARPose } from "../ar-types-isPsQptb.js";
|
|
2
|
+
import { t as CapturedImage } from "../image-capture-BXZUmj7j.js";
|
|
3
|
+
import { A as setScene, C as resetWebXRState, D as setDepthCaptureCallback, E as setCamera, F as shouldLogCameraAccessDiagnostic, I as startDepthCapture, L as startImageCapture, M as setTrackingLostCallback, N as setTrackingRecoveredCallback, O as setFrameCallback, P as setTrackingStore, R as stopDepthCapture, S as nueQuaternionToWebXR, T as setArWorldGroup, _ as getXrCameraFromPose, a as createSceneHierarchy, b as isXRCameraLike, c as extractResetTransformData, d as getCamera, f as getCurrentArPose, g as getScene, h as getLiveCss3dManager, i as buildSessionOptions, j as setTrackingCallbacks, k as setImageCaptureCallback, l as getArPose, m as getImageCaptureFrameCount, n as TrackingSubscribableStore, o as endARSession, p as getDepthSampleCount, r as applyAlignmentMatrix, s as extractPoseFromViewer, t as SessionFeatureOptions, u as getArWorldGroup, v as initAR, w as setArPose, x as nuePositionToWebXR, y as isWebXRSupported, z as stopImageCapture } from "../webxr-session-BnArFCew.js";
|
|
4
|
+
export { ARPose, CapturedImage, DepthSample, SessionFeatureOptions, TrackingSubscribableStore, applyAlignmentMatrix, buildSessionOptions, createSceneHierarchy, endARSession, extractPoseFromViewer, extractResetTransformData, getArPose, getArWorldGroup, getCamera, getCurrentArPose, getDepthSampleCount, getImageCaptureFrameCount, getLiveCss3dManager, getScene, getXrCameraFromPose, initAR, isWebXRSupported, isXRCameraLike, nuePositionToWebXR, nueQuaternionToWebXR, resetWebXRState, setArPose, setArWorldGroup, setCamera, setDepthCaptureCallback, setFrameCallback, setImageCaptureCallback, setScene, setTrackingCallbacks, setTrackingLostCallback, setTrackingRecoveredCallback, setTrackingStore, shouldLogCameraAccessDiagnostic, startDepthCapture, startImageCapture, stopDepthCapture, stopImageCapture };
|
package/dist/ar/webxr-session.js
CHANGED
|
@@ -3,9 +3,12 @@ import { CameraBlitCapture, computeCaptureSize } from "./camera-blit-capture.js"
|
|
|
3
3
|
import { getLastDeviceOrientation } from "../state/gps-event-coordinator.js";
|
|
4
4
|
import { DepthSampler } from "./depth-sampler.js";
|
|
5
5
|
import { clearFrameUpdates, runFrameUpdates } from "./frame-loop.js";
|
|
6
|
+
import { clearXrFrameUpdates, runXrFrameUpdates } from "./xr-frame-loop.js";
|
|
7
|
+
import { t as WEBXR_TO_NUE } from "../webxr-nue-basis-BbdqhqY6.js";
|
|
6
8
|
import { DEFAULT_CAPTURE_CONFIG, ImageCaptureManager } from "./image-capture.js";
|
|
7
9
|
import { clearLastRestartedPayload, originReset, poseLost, poseReceived, resetTracking, selectLastRestartedPayload, selectTrackingPhase } from "../state/tracking-slice.js";
|
|
8
10
|
import { acquireCameraTexture } from "./xr-camera-texture.js";
|
|
11
|
+
import { n as runSessionDisposers } from "../session-disposers-M-oashRH.js";
|
|
9
12
|
import { DEFAULT_RECORDING_OPTIONS, validateArCrashIsolationOptions } from "../state/recording-options.js";
|
|
10
13
|
import { SCENE_NODE } from "./scene-node-names.js";
|
|
11
14
|
import { createCss3dRendererManager } from "../visualization/css3d-renderer-manager.js";
|
|
@@ -110,6 +113,8 @@ function resetWebXRState() {
|
|
|
110
113
|
latestArPose = null;
|
|
111
114
|
lastFrameTime = 0;
|
|
112
115
|
clearFrameUpdates();
|
|
116
|
+
clearXrFrameUpdates();
|
|
117
|
+
runSessionDisposers();
|
|
113
118
|
imageCaptureManager = null;
|
|
114
119
|
onImageCaptured = null;
|
|
115
120
|
getScreenRotation = null;
|
|
@@ -350,10 +355,14 @@ function getCurrentArPose() {
|
|
|
350
355
|
* Extracted as a pure function for testability.
|
|
351
356
|
*
|
|
352
357
|
* @param rootElement - The DOM element for DOM overlay
|
|
358
|
+
* @param isolationOptions - Crash-isolation diagnostic flags (DOM overlay,
|
|
359
|
+
* depth-sensing, camera-access)
|
|
360
|
+
* @param sessionFeatures - Opt-in standard WebXR features that are independent
|
|
361
|
+
* of crash isolation (currently `requestHitTest`)
|
|
353
362
|
* @returns XRSessionInit options
|
|
354
363
|
* @throws Error if rootElement is null
|
|
355
364
|
*/
|
|
356
|
-
function buildSessionOptions(rootElement, isolationOptions = {}) {
|
|
365
|
+
function buildSessionOptions(rootElement, isolationOptions = {}, sessionFeatures = {}) {
|
|
357
366
|
if (!rootElement) throw new Error("App root element not found");
|
|
358
367
|
const normalizedOptions = validateArCrashIsolationOptions(isolationOptions);
|
|
359
368
|
const optionalFeatures = [];
|
|
@@ -370,6 +379,7 @@ function buildSessionOptions(rootElement, isolationOptions = {}) {
|
|
|
370
379
|
} });
|
|
371
380
|
}
|
|
372
381
|
if (normalizedOptions.enableCameraAccess) optionalFeatures.push("camera-access");
|
|
382
|
+
if (sessionFeatures.requestHitTest) optionalFeatures.push("hit-test");
|
|
373
383
|
if (optionalFeatures.length > 0) sessionOptions.optionalFeatures = optionalFeatures;
|
|
374
384
|
return sessionOptions;
|
|
375
385
|
}
|
|
@@ -449,8 +459,11 @@ function createSceneHierarchy() {
|
|
|
449
459
|
/**
|
|
450
460
|
* Initialize the AR session and Three.js renderer.
|
|
451
461
|
* @param container - DOM element to host the AR canvas and CSS3D overlay.
|
|
462
|
+
* @param isolationOptions - Crash-isolation diagnostic flags.
|
|
463
|
+
* @param sessionFeatures - Opt-in standard WebXR features (e.g.
|
|
464
|
+
* `requestHitTest`) forwarded to the session negotiation.
|
|
452
465
|
*/
|
|
453
|
-
async function initAR(container, isolationOptions = {}) {
|
|
466
|
+
async function initAR(container, isolationOptions = {}, sessionFeatures = {}) {
|
|
454
467
|
if (!navigator.xr) throw new Error("WebXR not available");
|
|
455
468
|
if (renderer || xrSession) throw new Error("AR session already initialized — call endARSession() before initAR() again");
|
|
456
469
|
currentArCrashIsolationOptions = validateArCrashIsolationOptions(isolationOptions);
|
|
@@ -468,7 +481,7 @@ async function initAR(container, isolationOptions = {}) {
|
|
|
468
481
|
arWorldGroup = hierarchy.arWorldGroup;
|
|
469
482
|
arPoseNode = hierarchy.arpose;
|
|
470
483
|
camera = hierarchy.camera;
|
|
471
|
-
const sessionOptions = buildSessionOptions(container, currentArCrashIsolationOptions);
|
|
484
|
+
const sessionOptions = buildSessionOptions(container, currentArCrashIsolationOptions, sessionFeatures);
|
|
472
485
|
xrSession = await navigator.xr.requestSession("immersive-ar", sessionOptions);
|
|
473
486
|
xrSession.addEventListener("end", () => {
|
|
474
487
|
log.info("Session ended");
|
|
@@ -578,6 +591,13 @@ function onXRFrame(time, frame) {
|
|
|
578
591
|
const elapsed = time / 1e3;
|
|
579
592
|
lastFrameTime = time;
|
|
580
593
|
runFrameUpdates(dt, elapsed);
|
|
594
|
+
if (xrSession) runXrFrameUpdates({
|
|
595
|
+
frame,
|
|
596
|
+
referenceSpace,
|
|
597
|
+
session: xrSession,
|
|
598
|
+
dt,
|
|
599
|
+
elapsed
|
|
600
|
+
});
|
|
581
601
|
if (arPose) latestArPose = arPose;
|
|
582
602
|
latestCameraTexture = null;
|
|
583
603
|
if (currentArCrashIsolationOptions.enableCameraTextureAcquisition) {
|
|
@@ -688,41 +708,6 @@ function setArPose(a) {
|
|
|
688
708
|
arPoseNode = a;
|
|
689
709
|
}
|
|
690
710
|
/**
|
|
691
|
-
* Constant matrix converting WebXR local-floor coordinates to the internal
|
|
692
|
-
* NUE (North-Up-East) convention.
|
|
693
|
-
*
|
|
694
|
-
* WebXR: X=East, Y=Up, Z=South (right-handed, toward viewer)
|
|
695
|
-
* NUE: X=North, Y=Up, Z=East (right-handed)
|
|
696
|
-
*
|
|
697
|
-
* Mapping: NUE_X = -WebXR_Z, NUE_Y = WebXR_Y, NUE_Z = WebXR_X
|
|
698
|
-
*
|
|
699
|
-
* Row-major:
|
|
700
|
-
* [ 0 0 -1 0 ]
|
|
701
|
-
* [ 0 1 0 0 ]
|
|
702
|
-
* [ 1 0 0 0 ]
|
|
703
|
-
* [ 0 0 0 1 ]
|
|
704
|
-
*
|
|
705
|
-
* Stored column-major (Three.js / gl-matrix convention).
|
|
706
|
-
*/
|
|
707
|
-
const WEBXR_TO_NUE = new THREE.Matrix4().fromArray([
|
|
708
|
-
0,
|
|
709
|
-
0,
|
|
710
|
-
1,
|
|
711
|
-
0,
|
|
712
|
-
0,
|
|
713
|
-
1,
|
|
714
|
-
0,
|
|
715
|
-
0,
|
|
716
|
-
-1,
|
|
717
|
-
0,
|
|
718
|
-
0,
|
|
719
|
-
0,
|
|
720
|
-
0,
|
|
721
|
-
0,
|
|
722
|
-
0,
|
|
723
|
-
1
|
|
724
|
-
]);
|
|
725
|
-
/**
|
|
726
711
|
* Apply an alignment matrix to the AR world group.
|
|
727
712
|
*
|
|
728
713
|
* The alignment matrix maps odometry positions in NUE space
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as XR_ERROR_MESSAGE_UNKNOWN, r as getXrErrorMessage, t as XR_ERROR_MESSAGES } from "../xr-error-handler-
|
|
1
|
+
import { n as XR_ERROR_MESSAGE_UNKNOWN, r as getXrErrorMessage, t as XR_ERROR_MESSAGES } from "../xr-error-handler-DcUFshNF.js";
|
|
2
2
|
export { XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, getXrErrorMessage };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createLogger } from "../utils/logger.js";
|
|
2
|
+
//#region ../src/ar/xr-frame-loop.ts
|
|
3
|
+
/**
|
|
4
|
+
* Per-frame **XR-access** callback registry — the safe seam that lets app
|
|
5
|
+
* code run standard WebXR work (hit-test, light estimation, depth, the WebXR
|
|
6
|
+
* Anchors API, …) without the framework wrapping each capability.
|
|
7
|
+
*
|
|
8
|
+
* The framework owns the single `renderer.setAnimationLoop(onXRFrame)` hook,
|
|
9
|
+
* and the live `XRFrame` never leaves `onXRFrame`. The plain `FrameUpdate`
|
|
10
|
+
* registry (`frame-loop.ts`) only passes `(dt, elapsed)`, which is enough for
|
|
11
|
+
* pose-free ticks but cannot drive hit-test. This registry additionally hands
|
|
12
|
+
* the callback the live `frame`, `referenceSpace`, and `session`.
|
|
13
|
+
*
|
|
14
|
+
* SAFETY CONTRACT (non-negotiable): `frame` / `referenceSpace` / `session` are
|
|
15
|
+
* valid **only synchronously inside the callback**. The `XRFrame` is
|
|
16
|
+
* use-after-frame-unsafe — storing it and reading it on a later tick throws or
|
|
17
|
+
* crashes. Passing them as arguments (never a stashable `getXrFrame()` getter)
|
|
18
|
+
* makes correct use the easy path and stashing the awkward one. Do NOT retain
|
|
19
|
+
* `ctx` or its fields beyond the callback's synchronous execution.
|
|
20
|
+
*
|
|
21
|
+
* See `2026-06-03-threejs-arbutton-minimal-ar-example-user-feedback.md`
|
|
22
|
+
* §6.2/§6.3 (option H-A2) for the design rationale.
|
|
23
|
+
*/
|
|
24
|
+
const log = createLogger("XrFrameLoop");
|
|
25
|
+
const updates = /* @__PURE__ */ new Set();
|
|
26
|
+
/**
|
|
27
|
+
* Register a per-frame XR-access callback. Returns an unregister function.
|
|
28
|
+
*
|
|
29
|
+
* Registration is idempotent — registering the same `fn` twice is a no-op
|
|
30
|
+
* (it remains a single entry in the underlying `Set`).
|
|
31
|
+
*/
|
|
32
|
+
function registerXrFrameUpdate(fn) {
|
|
33
|
+
updates.add(fn);
|
|
34
|
+
return () => {
|
|
35
|
+
updates.delete(fn);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Invoke all registered XR-access callbacks. Called by the WebXR session's
|
|
40
|
+
* `onXRFrame` once per frame, only when a live `frame` / `referenceSpace` /
|
|
41
|
+
* `session` are all available.
|
|
42
|
+
*
|
|
43
|
+
* The set is snapshotted before iterating so that
|
|
44
|
+
* `registerXrFrameUpdate` / unregister calls made by a handler during the
|
|
45
|
+
* same frame are deferred to the next tick — mirroring `runFrameUpdates`.
|
|
46
|
+
*
|
|
47
|
+
* Each callback is invoked in its own `try/catch`: this registry is the public
|
|
48
|
+
* app seam, so a bug in one app-registered callback (which throws every frame)
|
|
49
|
+
* must not abort the remaining callbacks nor propagate up through `onXRFrame`
|
|
50
|
+
* and kill the scene render for the whole session. Failures are logged and the
|
|
51
|
+
* loop continues — mirroring `runFrameUpdates`.
|
|
52
|
+
*/
|
|
53
|
+
function runXrFrameUpdates(ctx) {
|
|
54
|
+
const snapshot = Array.from(updates);
|
|
55
|
+
for (const fn of snapshot) try {
|
|
56
|
+
fn(ctx);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
log.error("A registered XrFrameUpdate threw; continuing the loop", error);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Clear all registrations. Called from `resetWebXRState()` so a fresh
|
|
63
|
+
* session starts with an empty registry.
|
|
64
|
+
*/
|
|
65
|
+
function clearXrFrameUpdates() {
|
|
66
|
+
updates.clear();
|
|
67
|
+
}
|
|
68
|
+
//#endregion
|
|
69
|
+
export { clearXrFrameUpdates, registerXrFrameUpdate, runXrFrameUpdates };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { t as SubscribableStore } from "./subscribe-to-selector--KQpgLXG.js";
|
|
2
|
+
import * as THREE from "three";
|
|
3
|
+
|
|
4
|
+
//#region ../src/visualization/ar-world-group-alignment.d.ts
|
|
5
|
+
interface ArWorldGroupAlignmentOptions {
|
|
6
|
+
/** The store whose alignment selector drives the lerper. */
|
|
7
|
+
readonly store: SubscribableStore;
|
|
8
|
+
/** The AR world group whose `.matrix` is lerped toward each alignment. */
|
|
9
|
+
readonly arWorldGroup: THREE.Object3D;
|
|
10
|
+
/**
|
|
11
|
+
* Lerp speed multiplier forwarded to {@link createAlignmentLerper}
|
|
12
|
+
* (default matches the lerper's own `DEFAULT_LERP_RATE`).
|
|
13
|
+
*/
|
|
14
|
+
readonly lerpRate?: number;
|
|
15
|
+
}
|
|
16
|
+
interface ArWorldGroupAlignmentHandle {
|
|
17
|
+
/** Stop the subscription and the per-frame update. */
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Begin applying the store's (lerped) alignment to `arWorldGroup`. Returns a
|
|
22
|
+
* handle whose `dispose()` removes both the store subscription and the
|
|
23
|
+
* per-frame update.
|
|
24
|
+
*
|
|
25
|
+
* Disposal is tied to the AR session lifecycle: the binding registers itself
|
|
26
|
+
* with the session-disposer registry that `resetWebXRState()` flushes on
|
|
27
|
+
* teardown, so a caller can `enableArWorldGroupAlignment(...)` once and never
|
|
28
|
+
* hold the handle — the binding cannot outlive the session (which is what two
|
|
29
|
+
* apps independently leaked: the store subscription survives a teardown because
|
|
30
|
+
* `clearFrameUpdates` only drops the per-frame tick). Because `initAR()` throws
|
|
31
|
+
* while a prior session is live, every restart passes through that flush. The
|
|
32
|
+
* handle is still returned for callers that want to stop alignment mid-session,
|
|
33
|
+
* and is idempotent + self-deregistering so a manual `dispose()` and the
|
|
34
|
+
* teardown flush never double-run. See
|
|
35
|
+
* gps-plus-slam/GpsPlusSlamJs_Docs/docs/2026-06-08-arworldgroup-alignment-session-scoped-disposal.md.
|
|
36
|
+
*
|
|
37
|
+
* Double-drive is still the caller's concern: the recorder owns its own lerper
|
|
38
|
+
* and must NOT also call this (it would double-lerp the same group). It does not
|
|
39
|
+
* call this helper, so flushing the registry on teardown never affects it.
|
|
40
|
+
*/
|
|
41
|
+
declare function enableArWorldGroupAlignment(options: ArWorldGroupAlignmentOptions): ArWorldGroupAlignmentHandle;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { ArWorldGroupAlignmentOptions as n, enableArWorldGroupAlignment as r, ArWorldGroupAlignmentHandle as t };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region ../src/ar/capability-checker.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Pure capability-gating helpers, promoted from the AnchorStarter app so the
|
|
4
|
+
* minimal AR example and AnchorStarter share the *decision* and *message*
|
|
5
|
+
* without sharing app-specific copy.
|
|
6
|
+
*
|
|
7
|
+
* The async feature probing (`isWebXRSupported()` / geolocation availability)
|
|
8
|
+
* stays in each app's `main.ts`; only the browser-free decision and the
|
|
9
|
+
* user-facing message live here so they can be unit-tested without a browser.
|
|
10
|
+
*
|
|
11
|
+
* See `2026-06-03-threejs-arbutton-minimal-ar-example-user-feedback.md` §6.4.
|
|
12
|
+
*/
|
|
13
|
+
/** The two capabilities every GPS+AR demo requires to run. */
|
|
14
|
+
interface CapabilitySupport {
|
|
15
|
+
/** Browser supports a WebXR `immersive-ar` session. */
|
|
16
|
+
readonly webxr: boolean;
|
|
17
|
+
/** Geolocation API is available. */
|
|
18
|
+
readonly geolocation: boolean;
|
|
19
|
+
}
|
|
20
|
+
/** Options that let an app flavour the otherwise-neutral gating message. */
|
|
21
|
+
interface CapabilityMessageOptions {
|
|
22
|
+
/**
|
|
23
|
+
* App-specific "what this demo lets you do" phrase, appended as
|
|
24
|
+
* `…outdoors, to try ${contextLabel}.`. Omit for a neutral message that
|
|
25
|
+
* ends at `…outdoors.`. Example: `'the persistent-anchor flow'`.
|
|
26
|
+
*/
|
|
27
|
+
readonly contextLabel?: string;
|
|
28
|
+
}
|
|
29
|
+
/** True only when both AR and GPS are available — the demo can run. */
|
|
30
|
+
declare function isFullySupported(support: CapabilitySupport): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Build the capability-gated message shown when the demo cannot run. Names
|
|
33
|
+
* exactly which capabilities are missing so the user understands *why*, and
|
|
34
|
+
* always points them at the supported environment (an AR phone, outdoors).
|
|
35
|
+
* Returns `null` when everything is supported (no message needed).
|
|
36
|
+
*
|
|
37
|
+
* The trailing "to try …" clause is app-specific and supplied via
|
|
38
|
+
* `options.contextLabel`; without it the message ends neutrally at
|
|
39
|
+
* "…outdoors.".
|
|
40
|
+
*/
|
|
41
|
+
declare function capabilityMessage(support: CapabilitySupport, options?: CapabilityMessageOptions): string | null;
|
|
42
|
+
//#endregion
|
|
43
|
+
export { isFullySupported as i, CapabilitySupport as n, capabilityMessage as r, CapabilityMessageOptions as t };
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
//#region ../src/ar/chromium-camera-access-workaround.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Chromium WebXR camera-access tab-crash workaround.
|
|
4
|
+
*
|
|
5
|
+
* Background:
|
|
6
|
+
* Requesting `camera-access` as an optional WebXR feature on Android Chrome
|
|
7
|
+
* 147+ causes a fatal renderer-process crash (`CrRendererMain`) 1–2 seconds
|
|
8
|
+
* after entering AR. The crash reproduces in the upstream three.js
|
|
9
|
+
* `webxr_ar_hittest.html` example with `optionalFeatures: ['camera-access']`
|
|
10
|
+
* added — i.e. it is not specific to this app's session setup. See:
|
|
11
|
+
*
|
|
12
|
+
* - GpsPlusSlamJs_Docs/docs/2026-04-22-camera-access-reproducer-plan.md
|
|
13
|
+
* - GpsPlusSlamJs_Docs/docs/2026-06-04-camera-access-crash-regression-chrome-148.md
|
|
14
|
+
* - https://github.com/mrdoob/three.js/issues/33404
|
|
15
|
+
* - https://issues.chromium.org/issues/507508099 (root-cause, marked Fixed)
|
|
16
|
+
*
|
|
17
|
+
* There is NOT a single crash here — the Chromium tracker notes the crash on
|
|
18
|
+
* Chrome 147 is different from the crash on 148+, and the simple workaround
|
|
19
|
+
* below only helped on a subset of versions. The empirically-verified
|
|
20
|
+
* (on-device) timeline is:
|
|
21
|
+
*
|
|
22
|
+
* - 147 : deleting `createProjectionLayer` / `layers` forces three.js onto
|
|
23
|
+
* `XRWebGLLayer` and sidesteps the crash (deletes-only is sufficient).
|
|
24
|
+
* - 148.0.7778.12 .. 149.0.7821 : the delete-only trick is NOT sufficient on
|
|
25
|
+
* its own. An ADDITIONAL patch is needed: persist the `baseLayer`
|
|
26
|
+
* reference across `XRSession.prototype.updateRenderState` so three.js's
|
|
27
|
+
* later `depthNear`/`depthFar` update does not drop the active
|
|
28
|
+
* `glBaseLayer`. (Confirmed on-device on `148.0.7778.215`: BOTH the
|
|
29
|
+
* deletes and the baseLayer patch are required for the page not to
|
|
30
|
+
* crash. Earlier 148 builds (`< .7778.12`) are below the window per the
|
|
31
|
+
* tracker, which reported delete-only worked there.)
|
|
32
|
+
* - > 149.0.7821 (incl. Chrome 150) : the delete-only path is STILL required
|
|
33
|
+
* (confirmed on-device: Chrome 150 only stops crashing when the deletes
|
|
34
|
+
* are applied), but the extra baseLayer-persistence patch is NOT needed.
|
|
35
|
+
* The earlier assumption that Chromium fully fixed this on patched
|
|
36
|
+
* builds did not hold on real devices, so we no longer skip the
|
|
37
|
+
* workaround on "patched" Chrome.
|
|
38
|
+
*
|
|
39
|
+
* Resulting policy (see {@link applyChromiumProjectionLayerWorkaround}):
|
|
40
|
+
* - ALWAYS apply the deletes (every Chrome build, and unknown/non-Chromium
|
|
41
|
+
* environments — restoring the original always-on behavior).
|
|
42
|
+
* - Apply the baseLayer-persistence patch ONLY when a detected Chrome build
|
|
43
|
+
* falls inside the affected window
|
|
44
|
+
* [{@link BASELAYER_WINDOW_MIN} .. {@link BASELAYER_WINDOW_MAX}].
|
|
45
|
+
*
|
|
46
|
+
* Caveats:
|
|
47
|
+
* - This is a Chromium-specific hack and the upstream comment explicitly
|
|
48
|
+
* warns it "might break webxr on other devices" — keep it opt-in.
|
|
49
|
+
* - Must run BEFORE any WebXR session setup. Three.js reads these prototype
|
|
50
|
+
* members lazily when the first session starts, so calling this at app
|
|
51
|
+
* bootstrap (before `initAR()`) is sufficient.
|
|
52
|
+
* - Idempotent: safe to call repeatedly. Safe on environments where the
|
|
53
|
+
* prototypes do not exist (e.g. desktop browsers, jsdom).
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* Parsed Chrome version as `[major, minor, build, patch]`.
|
|
57
|
+
*/
|
|
58
|
+
type ChromeVersion = [number, number, number, number];
|
|
59
|
+
/**
|
|
60
|
+
* Inclusive lower bound of the Chrome window that additionally needs the
|
|
61
|
+
* `baseLayer`-persistence patch (on top of the deletes).
|
|
62
|
+
*
|
|
63
|
+
* Set to `148.0.7778.12`, the issue tracker's figure for when the delete-only
|
|
64
|
+
* trick stopped being sufficient. On-device confirmation: `148.0.7778.215`
|
|
65
|
+
* (well inside this window) crashes with deletes-only and needs BOTH patches.
|
|
66
|
+
* Earlier 148 builds (`< .7778.12`) and all of Chrome 147 stay below this
|
|
67
|
+
* bound (deletes-only) per the documented timeline — we have no on-device
|
|
68
|
+
* evidence that they need the baseLayer patch, so we do not apply it there.
|
|
69
|
+
*/
|
|
70
|
+
declare const BASELAYER_WINDOW_MIN: ChromeVersion;
|
|
71
|
+
/**
|
|
72
|
+
* Inclusive upper bound of the Chrome window that additionally needs the
|
|
73
|
+
* `baseLayer`-persistence patch. The crash is fixed after `149.0.7819.0` and
|
|
74
|
+
* the camera image is correctly populated after `149.0.7821.0`; above this
|
|
75
|
+
* build the extra patch is no longer required (the deletes still are — see
|
|
76
|
+
* the module header and the on-device matrix for Chrome 150).
|
|
77
|
+
*
|
|
78
|
+
* @see https://github.com/mrdoob/three.js/issues/33404
|
|
79
|
+
*/
|
|
80
|
+
declare const BASELAYER_WINDOW_MAX: ChromeVersion;
|
|
81
|
+
/**
|
|
82
|
+
* Result of {@link applyChromiumProjectionLayerWorkaround}.
|
|
83
|
+
* Useful for logging and tests.
|
|
84
|
+
*/
|
|
85
|
+
interface ChromiumProjectionLayerWorkaroundResult {
|
|
86
|
+
/** True if `XRWebGLBinding.prototype.createProjectionLayer` was deleted on this call. */
|
|
87
|
+
deletedCreateProjectionLayer: boolean;
|
|
88
|
+
/** True if `XRRenderState.prototype.layers` was deleted on this call. */
|
|
89
|
+
deletedRenderStateLayers: boolean;
|
|
90
|
+
/** True if `XRSession.prototype.updateRenderState` was wrapped on this call. */
|
|
91
|
+
patchedUpdateRenderState: boolean;
|
|
92
|
+
/** The detected Chrome version (`"major.minor.build.patch"`), or null. */
|
|
93
|
+
detectedChromeVersion: string | null;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Parse a Chrome/Chromium version from a user-agent string.
|
|
97
|
+
*
|
|
98
|
+
* Matches the `Chrome/<major>.<minor>.<build>.<patch>` token (and the iOS
|
|
99
|
+
* `CriOS/...` variant). Returns null for non-Chromium user agents.
|
|
100
|
+
*/
|
|
101
|
+
declare function parseChromeVersion(userAgent: string): ChromeVersion | null;
|
|
102
|
+
/**
|
|
103
|
+
* True when the detected Chrome build falls inside the affected window
|
|
104
|
+
* [{@link BASELAYER_WINDOW_MIN} .. {@link BASELAYER_WINDOW_MAX}] (inclusive)
|
|
105
|
+
* and therefore additionally needs the `baseLayer`-persistence patch. Outside
|
|
106
|
+
* the window (including non-Chromium user agents) returns false — only the
|
|
107
|
+
* deletes are needed there.
|
|
108
|
+
*/
|
|
109
|
+
declare function needsBaseLayerPersistence(userAgent: string): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Apply the Chromium camera-access tab-crash workaround.
|
|
112
|
+
*
|
|
113
|
+
* Policy (derived from on-device testing — see the module header):
|
|
114
|
+
*
|
|
115
|
+
* - ALWAYS removes `XRWebGLBinding.prototype.createProjectionLayer`
|
|
116
|
+
* (three.js r184) and `XRRenderState.prototype.layers` (three.js r158) so
|
|
117
|
+
* three.js falls back to `XRWebGLLayer`. This is required on every affected
|
|
118
|
+
* Chrome build observed so far, including Chrome 150, and is also applied
|
|
119
|
+
* on unknown/non-Chromium environments (restoring the original always-on
|
|
120
|
+
* behavior).
|
|
121
|
+
* - ADDITIONALLY persists the `baseLayer` across
|
|
122
|
+
* `XRSession.prototype.updateRenderState`, but ONLY when a detected Chrome
|
|
123
|
+
* build falls inside the affected window
|
|
124
|
+
* [{@link BASELAYER_WINDOW_MIN} .. {@link BASELAYER_WINDOW_MAX}]. Outside
|
|
125
|
+
* that window the extra patch is unnecessary (and is skipped on unknown
|
|
126
|
+
* environments to avoid touching projection-layer devices like Quest).
|
|
127
|
+
*
|
|
128
|
+
* Call once during bootstrap, before any `requestSession()` call.
|
|
129
|
+
*
|
|
130
|
+
* @param options.userAgent override the detected user agent (for testing).
|
|
131
|
+
* @returns which prototype members were actually changed on this call.
|
|
132
|
+
*/
|
|
133
|
+
declare function applyChromiumProjectionLayerWorkaround(options?: {
|
|
134
|
+
userAgent?: string;
|
|
135
|
+
}): ChromiumProjectionLayerWorkaroundResult;
|
|
136
|
+
//#endregion
|
|
137
|
+
export { applyChromiumProjectionLayerWorkaround as a, ChromiumProjectionLayerWorkaroundResult as i, BASELAYER_WINDOW_MIN as n, needsBaseLayerPersistence as o, ChromeVersion as r, parseChromeVersion as s, BASELAYER_WINDOW_MAX as t };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as LibraryRootState, c as RootState, d as calcRelativeCoordsInMeters, f as createGpsSlamStore, g as webxrToNUE, h as validateLicenseKey, i as LatLongAlt, l as Vector3, m as odometryTrackingRestarted, n as GpsPoint, o as Matrix4, p as isIdentityMatrix4, r as LatLong, s as Quaternion, t as ArImageCapture, u as calcGpsCoords } from "../index
|
|
1
|
+
import { a as LibraryRootState, c as RootState, d as calcRelativeCoordsInMeters, f as createGpsSlamStore, g as webxrToNUE, h as validateLicenseKey, i as LatLongAlt, l as Vector3, m as odometryTrackingRestarted, n as GpsPoint, o as Matrix4, p as isIdentityMatrix4, r as LatLong, s as Quaternion, t as ArImageCapture, u as calcGpsCoords } from "../index--ldLph4V.js";
|
|
2
2
|
export { ArImageCapture, GpsPoint, LatLong, LatLongAlt, LibraryRootState, Matrix4, Quaternion, RootState, Vector3, calcGpsCoords, calcRelativeCoordsInMeters, createGpsSlamStore, isIdentityMatrix4, odometryTrackingRestarted, validateLicenseKey, webxrToNUE };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as ARPose } from "./ar-types-
|
|
2
|
-
import { a as TrackingSliceState, t as DeviceOrientation } from "./tracking-slice-
|
|
3
|
-
import { t as RecordingState } from "./recording-slice-
|
|
4
|
-
import { n as SessionMetadata } from "./opfs-storage-
|
|
5
|
-
import { n as StorageBackend } from "./storage-backend-
|
|
1
|
+
import { t as ARPose } from "./ar-types-isPsQptb.js";
|
|
2
|
+
import { a as TrackingSliceState, t as DeviceOrientation } from "./tracking-slice-CDREeoZ_.js";
|
|
3
|
+
import { t as RecordingState } from "./recording-slice-Cb888P6d.js";
|
|
4
|
+
import { n as SessionMetadata } from "./opfs-storage-LsLY6VZV.js";
|
|
5
|
+
import { n as StorageBackend } from "./storage-backend-yDSKafAQ.js";
|
|
6
6
|
import { GpsPoint, LatLong, Matrix4, RootState, Vector3 } from "gps-plus-slam-js";
|
|
7
7
|
import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
|
|
8
8
|
import { Middleware, Reducer, ReducersMapObject, configureStore } from "@reduxjs/toolkit";
|