gps-plus-slam-app-framework 1.0.6 → 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.
Files changed (198) hide show
  1. package/LICENSE +4 -4
  2. package/README.md +310 -115
  3. package/dist/accuracy-circles-DEKr0Hoh.d.ts +43 -0
  4. package/dist/{app-selectors-CHt7DLuq.d.ts → app-selectors-CR9OWodf.d.ts} +8 -10
  5. package/dist/ar/camera-blit-capture.d.ts +1 -1
  6. package/dist/ar/capability-checker.d.ts +2 -0
  7. package/dist/ar/capability-checker.js +25 -0
  8. package/dist/ar/capture-failure-tracker.d.ts +1 -1
  9. package/dist/ar/chromium-camera-access-workaround.d.ts +2 -2
  10. package/dist/ar/chromium-camera-access-workaround.js +197 -8
  11. package/dist/ar/depth-sampler.d.ts +2 -2
  12. package/dist/ar/enable-gps-ar.d.ts +2 -0
  13. package/dist/ar/enable-gps-ar.js +137 -0
  14. package/dist/ar/frame-loop.d.ts +2 -0
  15. package/dist/ar/frame-loop.js +63 -0
  16. package/dist/ar/image-capture.d.ts +1 -1
  17. package/dist/ar/image-capture.js +1 -1
  18. package/dist/ar/index.d.ts +16 -12
  19. package/dist/ar/index.js +8 -4
  20. package/dist/ar/replay-scene.d.ts +1 -1
  21. package/dist/ar/scene-node-names.d.ts +1 -1
  22. package/dist/ar/webxr-session.d.ts +4 -4
  23. package/dist/ar/webxr-session.js +173 -93
  24. package/dist/ar/xr-camera-texture.d.ts +1 -1
  25. package/dist/ar/xr-error-handler.d.ts +1 -1
  26. package/dist/ar/xr-frame-loop.d.ts +2 -0
  27. package/dist/ar/xr-frame-loop.js +69 -0
  28. package/dist/ar-world-group-alignment-Dn4rQk_c.d.ts +43 -0
  29. package/dist/capability-checker-BTCmZRL4.d.ts +43 -0
  30. package/dist/chromium-camera-access-workaround-MifIwK9x.d.ts +137 -0
  31. package/dist/core/index.d.ts +2 -2
  32. package/dist/core/index.js +2 -2
  33. package/dist/create-slam-app-store-B76AGaI0.d.ts +371 -0
  34. package/dist/{depth-sampler-BNCtnEoP.d.ts → depth-sampler-CqrkRr2N.d.ts} +1 -1
  35. package/dist/enable-gps-ar-DNbO0zbg.d.ts +95 -0
  36. package/dist/{file-system-DD5TczSO.d.ts → file-system-TIsDfamK.d.ts} +32 -2
  37. package/dist/frame-conversions-D2EYjeNa.d.ts +54 -0
  38. package/dist/frame-loop-BTeRpDm4.d.ts +47 -0
  39. package/dist/frustum-visibility-DGnJqls0.d.ts +58 -0
  40. package/dist/{fused-path-DtqCSqJh.d.ts → fused-path-BdVHmDW9.d.ts} +1 -1
  41. package/dist/geo/h3-proximity.d.ts +1 -1
  42. package/dist/geo/index.d.ts +1 -1
  43. package/dist/{geo-types-Xx-LVcnw.d.ts → geo-types-clgzl8b5.d.ts} +16 -1
  44. package/dist/{gps-GKc6_Cly.d.ts → gps-B7AlMPz5.d.ts} +1 -1
  45. package/dist/gps-anchor-CISLPQIb.d.ts +59 -0
  46. package/dist/{gps-ar-pose-sampler-D_Zso40V.d.ts → gps-ar-pose-sampler-BypXZUqC.d.ts} +1 -1
  47. package/dist/{gps-event-coordinator-fwvmVfku.d.ts → gps-event-coordinator-BKVZbS1M.d.ts} +3 -3
  48. package/dist/gps-event-markers-BlHq3jYV.d.ts +103 -0
  49. package/dist/hit-test-reticle-BGXOxrUh.d.ts +45 -0
  50. package/dist/{image-capture-2pKjYUS6.d.ts → image-capture-BXZUmj7j.d.ts} +1 -1
  51. package/dist/index--ldLph4V.d.ts +2 -0
  52. package/dist/index-22v8MXJX.d.ts +23 -0
  53. package/dist/index-BB2KEWbN2.d.ts +37 -0
  54. package/dist/index.d.ts +64 -52
  55. package/dist/index.js +21 -8
  56. package/dist/{leaflet-map-overlay-CQZcnxbc.d.ts → leaflet-map-overlay-jNt-kcUr.d.ts} +22 -11
  57. package/dist/{logger-B81iwxx0.d.ts → logger-BZ44Dhd3.d.ts} +7 -1
  58. package/dist/map-data-BGIBM5rv.d.ts +49 -0
  59. package/dist/map-overlay-draw-DcGs9UV3.d.ts +42 -0
  60. package/dist/{null-storage-backend-C0TiwwzQ.d.ts → null-storage-backend-BPQJSaMw.d.ts} +2 -2
  61. package/dist/{opfs-storage-backend-Gt3rd76D.d.ts → opfs-storage-backend-u4QKvgvP.d.ts} +2 -2
  62. package/dist/{permission-checker-Cu3nbH1S.d.ts → permission-checker-CfV7INCa.d.ts} +41 -1
  63. package/dist/persistence-middleware-xB5sTllJ.d.ts +55 -0
  64. package/dist/{recording-options-BYUFX8iU.d.ts → recording-options-BSFpBSZH.d.ts} +10 -4
  65. package/dist/{recording-replayer-BFhFs7Mc.d.ts → recording-replayer-CTL2cUE0.d.ts} +2 -2
  66. package/dist/{recording-slice-BiktUIWF.d.ts → recording-slice-Cb888P6d.d.ts} +2 -2
  67. package/dist/{replay-engine-B88Va62x.d.ts → replay-engine-B-5GIZtc.d.ts} +1 -1
  68. package/dist/{replay-scene-DtUm6bsr.d.ts → replay-scene-DkNfldPh.d.ts} +3 -3
  69. package/dist/sensors/gps-error-handler.d.ts +1 -1
  70. package/dist/sensors/gps.d.ts +1 -1
  71. package/dist/sensors/gps.js +2 -2
  72. package/dist/sensors/index.d.ts +3 -3
  73. package/dist/sensors/index.js +1 -1
  74. package/dist/sensors/permission-checker.d.ts +2 -2
  75. package/dist/sensors/permission-checker.js +79 -1
  76. package/dist/session-disposers-M-oashRH.js +57 -0
  77. package/dist/state/app-selectors.d.ts +2 -2
  78. package/dist/state/app-selectors.js +33 -3
  79. package/dist/state/combined-root-state.d.ts +2 -0
  80. package/dist/state/combined-root-state.js +1 -0
  81. package/dist/state/create-slam-app-store.d.ts +1 -1
  82. package/dist/state/create-slam-app-store.js +27 -13
  83. package/dist/state/gps-ar-pose-sampler.d.ts +3 -3
  84. package/dist/state/gps-event-coordinator.d.ts +1 -1
  85. package/dist/state/index.d.ts +17 -16
  86. package/dist/state/index.js +6 -4
  87. package/dist/state/persistence-middleware.d.ts +2 -2
  88. package/dist/state/persistence-middleware.js +43 -9
  89. package/dist/state/recording-options.d.ts +1 -1
  90. package/dist/state/recording-replayer.d.ts +2 -2
  91. package/dist/state/recording-slice.d.ts +1 -1
  92. package/dist/state/replay-engine.d.ts +1 -1
  93. package/dist/state/store-subscribers.d.ts +2 -2
  94. package/dist/state/store-subscribers.js +38 -12
  95. package/dist/state/subscribe-to-selector.d.ts +1 -1
  96. package/dist/state/tracking-quality.d.ts +2 -0
  97. package/dist/state/tracking-quality.js +723 -0
  98. package/dist/state/tracking-slice.d.ts +2 -0
  99. package/dist/state/tracking-slice.js +147 -0
  100. package/dist/state-BkIfpiyA.js +87 -0
  101. package/dist/storage/file-system-utils.d.ts +1 -1
  102. package/dist/storage/file-system.d.ts +2 -2
  103. package/dist/storage/file-system.js +52 -1
  104. package/dist/storage/index.d.ts +8 -8
  105. package/dist/storage/null-storage-backend.d.ts +1 -1
  106. package/dist/storage/opfs-storage-backend.d.ts +1 -1
  107. package/dist/storage/opfs-storage.d.ts +1 -1
  108. package/dist/storage/storage-backend.d.ts +1 -1
  109. package/dist/storage/zip-export.d.ts +1 -1
  110. package/dist/storage/zip-reader.d.ts +1 -1
  111. package/dist/storage/zip-reader.js +8 -4
  112. package/dist/{storage-backend-yVnuWGTr.d.ts → storage-backend-yDSKafAQ.d.ts} +1 -1
  113. package/dist/{store-subscribers-DKKHld49.d.ts → store-subscribers-swlbtg_z.d.ts} +31 -6
  114. package/dist/{subscribe-to-selector-ghDKYtap.d.ts → subscribe-to-selector--KQpgLXG.d.ts} +1 -1
  115. package/dist/test-utils/browser-mocks.d.ts +1 -1
  116. package/dist/test-utils/zip-round-trip-helpers.d.ts +7 -1
  117. package/dist/test-utils/zip-round-trip-helpers.js +2 -1
  118. package/dist/tracking-slice-CDREeoZ_.d.ts +86 -0
  119. package/dist/types/ar-types.d.ts +1 -1
  120. package/dist/types/geo-types.d.ts +2 -2
  121. package/dist/types/index.d.ts +3 -3
  122. package/dist/utils/concurrency.d.ts +1 -1
  123. package/dist/utils/failure-tracker.d.ts +1 -1
  124. package/dist/utils/format-file-size.d.ts +1 -1
  125. package/dist/utils/fused-path.d.ts +1 -1
  126. package/dist/utils/index.d.ts +6 -6
  127. package/dist/utils/list-formatter.d.ts +1 -1
  128. package/dist/utils/logger.d.ts +1 -1
  129. package/dist/utils/logger.js +68 -8
  130. package/dist/visualization/accuracy-circles.d.ts +2 -0
  131. package/dist/visualization/accuracy-circles.js +57 -0
  132. package/dist/visualization/alignment-lerper.d.ts +1 -1
  133. package/dist/visualization/ar-world-group-alignment.d.ts +2 -0
  134. package/dist/visualization/ar-world-group-alignment.js +51 -0
  135. package/dist/visualization/camera-follower.d.ts +1 -1
  136. package/dist/visualization/css3d-renderer-manager.d.ts +1 -1
  137. package/dist/visualization/frame-conversions.d.ts +2 -0
  138. package/dist/visualization/frame-conversions.js +88 -0
  139. package/dist/visualization/frustum-visibility.d.ts +2 -0
  140. package/dist/visualization/frustum-visibility.js +139 -0
  141. package/dist/visualization/gps-anchor.d.ts +2 -0
  142. package/dist/visualization/gps-anchor.js +217 -0
  143. package/dist/visualization/gps-compass-cubes.d.ts +1 -1
  144. package/dist/visualization/gps-event-markers.d.ts +2 -2
  145. package/dist/visualization/gps-event-markers.js +69 -2
  146. package/dist/visualization/hit-test-reticle.d.ts +2 -0
  147. package/dist/visualization/hit-test-reticle.js +81 -0
  148. package/dist/visualization/index.d.ts +19 -12
  149. package/dist/visualization/index.js +9 -2
  150. package/dist/visualization/leaflet-map-overlay.d.ts +1 -1
  151. package/dist/visualization/leaflet-map-overlay.js +33 -79
  152. package/dist/visualization/lerp-utils.d.ts +1 -1
  153. package/dist/visualization/map-data.d.ts +2 -0
  154. package/dist/visualization/map-data.js +33 -0
  155. package/dist/visualization/map-overlay-draw.d.ts +2 -0
  156. package/dist/visualization/map-overlay-draw.js +107 -0
  157. package/dist/visualization/map-overlay.d.ts +1 -1
  158. package/dist/visualization/three-dispose.d.ts +1 -1
  159. package/dist/visualization/vis-colors.d.ts +1 -1
  160. package/dist/webxr-nue-basis-BbdqhqY6.js +54 -0
  161. package/dist/{webxr-session-COlSrXdL.d.ts → webxr-session-BnArFCew.d.ts} +76 -14
  162. package/dist/xr-frame-loop-BKckC7xC.d.ts +70 -0
  163. package/dist/{zip-reader-KgJEXbca.d.ts → zip-reader-B2lzN8F5.d.ts} +5 -0
  164. package/package.json +16 -16
  165. package/dist/ar/tracking-state.d.ts +0 -2
  166. package/dist/ar/tracking-state.js +0 -164
  167. package/dist/chromium-camera-access-workaround-CU5zSKNr.d.ts +0 -61
  168. package/dist/combined-root-state-B3SvPNjU.d.ts +0 -6
  169. package/dist/create-slam-app-store-DBm7g2Zd.d.ts +0 -85
  170. package/dist/gps-anchored-mesh-manager-CovAFK4g.d.ts +0 -56
  171. package/dist/gps-event-markers-sVyO9utS.d.ts +0 -67
  172. package/dist/persistence-middleware-z-75iisb.d.ts +0 -31
  173. package/dist/tracking-state-B9QfuZCg.d.ts +0 -101
  174. package/dist/visualization/gps-anchored-mesh-manager.d.ts +0 -2
  175. package/dist/visualization/gps-anchored-mesh-manager.js +0 -128
  176. /package/dist/{alignment-lerper-D9BeDwZX.d.ts → alignment-lerper-CCZJf-Xb.d.ts} +0 -0
  177. /package/dist/{ar-types-B-ORgk6Z.d.ts → ar-types-isPsQptb.d.ts} +0 -0
  178. /package/dist/{camera-blit-capture-DHuyrrxr.d.ts → camera-blit-capture-75WWa9Xb.d.ts} +0 -0
  179. /package/dist/{camera-follower-BMqPddxx.d.ts → camera-follower-B-nS1sr6.d.ts} +0 -0
  180. /package/dist/{capture-failure-tracker-2Q6oI2uQ.d.ts → capture-failure-tracker-D4HYJNOj.d.ts} +0 -0
  181. /package/dist/{concurrency-p6gB30fT.d.ts → concurrency-Bsmv53qw.d.ts} +0 -0
  182. /package/dist/{css3d-renderer-manager-rgLMVAvd.d.ts → css3d-renderer-manager-EDED3nvg.d.ts} +0 -0
  183. /package/dist/{failure-tracker-1sQ_Cgyw.d.ts → failure-tracker-D7ELffm0.d.ts} +0 -0
  184. /package/dist/{file-system-utils-BH8FdyIu.d.ts → file-system-utils-BH6uIs2i.d.ts} +0 -0
  185. /package/dist/{format-file-size-onGq0k1Q.d.ts → format-file-size-B7gJb3Md.d.ts} +0 -0
  186. /package/dist/{gps-compass-cubes-jRIJMOuh.d.ts → gps-compass-cubes-Ys6Hf1nc.d.ts} +0 -0
  187. /package/dist/{gps-error-handler-CH1S528z.d.ts → gps-error-handler-BLDhUlw5.d.ts} +0 -0
  188. /package/dist/{h3-proximity-GwesPTFT.d.ts → h3-proximity-DJnghtir.d.ts} +0 -0
  189. /package/dist/{lerp-utils-CZgQlrmu.d.ts → lerp-utils-DNcSmKVX.d.ts} +0 -0
  190. /package/dist/{list-formatter-DKQQVLcl.d.ts → list-formatter-CsqcU4v5.d.ts} +0 -0
  191. /package/dist/{map-overlay-C9ifl_4-.d.ts → map-overlay-yrFsUtGv.d.ts} +0 -0
  192. /package/dist/{opfs-storage-Dlq1I_Gb.d.ts → opfs-storage-LsLY6VZV.d.ts} +0 -0
  193. /package/dist/{scene-node-names-DPsaE2z3.d.ts → scene-node-names-IHW7HR4S.d.ts} +0 -0
  194. /package/dist/{three-dispose-qt_r5wR1.d.ts → three-dispose-WTBAfaWU.d.ts} +0 -0
  195. /package/dist/{vis-colors-BKkdTIKb.d.ts → vis-colors-Djnyg_UH.d.ts} +0 -0
  196. /package/dist/{xr-camera-texture-BbukNE79.d.ts → xr-camera-texture-BU5YvKAM.d.ts} +0 -0
  197. /package/dist/{xr-error-handler-DTHfmvrl.d.ts → xr-error-handler-DcUFshNF.d.ts} +0 -0
  198. /package/dist/{zip-export-BjrQPv0X.d.ts → zip-export-C0_ErAqT.d.ts} +0 -0
@@ -0,0 +1,54 @@
1
+ import { i as LatLongAlt, r as LatLong } from "./index--ldLph4V.js";
2
+ import * as THREE from "three";
3
+
4
+ //#region ../src/visualization/frame-conversions.d.ts
5
+ /**
6
+ * Convert a GPS-world NUE point into the AR-local position to write into a
7
+ * direct child of `arWorldGroup`, given the current alignment matrix.
8
+ *
9
+ * Computes `alignment⁻¹ · nue`. When the result is later composed back by the
10
+ * group's matrix (the same `alignment`), the child's WORLD position equals
11
+ * `nue` exactly.
12
+ *
13
+ * @param alignment - The alignment matrix as a 16-element **column-major**
14
+ * array (AR-odometry NUE → GPS-world NUE), e.g. from `getAlignmentMatrix()`
15
+ * or `THREE.Matrix4.toArray()`. Not mutated.
16
+ * @param nue - The GPS-world NUE point `[north, up, east]` in metres. Not
17
+ * mutated.
18
+ * @param out - Optional target vector to write into and return (pass a reused
19
+ * scratch to avoid allocation on hot paths). Defaults to a fresh
20
+ * `THREE.Vector3`.
21
+ * @returns `out`, set to the AR-local position.
22
+ */
23
+ declare function nueToArLocal(alignment: readonly number[], nue: readonly [number, number, number], out?: THREE.Vector3): THREE.Vector3;
24
+ /**
25
+ * Convert an object's **GPS-world NUE world position** back into a GPS
26
+ * coordinate, for the GPS-anchor bootstrap that medians where an object was
27
+ * actually placed (mirrors the C# `DetermineAndStoreGpsWorldPose`, which
28
+ * medians the object's world pose and converts via `zero.CalcGpsCoordsOf`).
29
+ *
30
+ * Precondition: `worldNue` must already be in GPS-world NUE — i.e. the object
31
+ * lives under an `arWorldGroup` whose `.matrix` carries the alignment (see
32
+ * `enableArWorldGroupAlignment`), so `object3D.getWorldPosition()` is the
33
+ * GPS-world position. Sampling a pure-VIO (identity-`arWorldGroup`) world
34
+ * position would yield a wrong GPS coordinate.
35
+ *
36
+ * Altitude round-trip: `calcGpsCoords` returns only `lat`/`lon` (it derives
37
+ * them from the North/East axes and ignores Up). The Up axis (`worldNue.y`,
38
+ * NUE index 1) is carried through verbatim as `altitude`, so a later
39
+ * `calcRelativeCoordsInMeters(zero, result, result.altitude, 0)` reproduces the
40
+ * same Up value — keeping the steady-state vertical target consistent with
41
+ * where the object was sampled.
42
+ *
43
+ * @param worldNue - The object's world position in GPS-world NUE metres
44
+ * (`x = North`, `y = Up`, `z = East`). A `THREE.Vector3` satisfies this.
45
+ * @param zero - The GPS zero reference (origin for the conversion).
46
+ * @returns The GPS coordinate of `worldNue`, with `altitude = worldNue.y`.
47
+ */
48
+ declare function worldNueToGps(worldNue: {
49
+ readonly x: number;
50
+ readonly y: number;
51
+ readonly z: number;
52
+ }, zero: LatLong): LatLongAlt;
53
+ //#endregion
54
+ export { worldNueToGps as n, nueToArLocal as t };
@@ -0,0 +1,47 @@
1
+ //#region ../src/ar/frame-loop.d.ts
2
+ /**
3
+ * Per-frame callback registry. The WebXR session owns the single
4
+ * `renderer.setAnimationLoop(...)` hook for the page; components that need
5
+ * a per-frame tick register here and the session's `onXRFrame` invokes
6
+ * `runFrameUpdates(dt, elapsed)` once per frame.
7
+ *
8
+ * Plain functions, not a class: there is exactly one frame loop per session
9
+ * and singletons-of-singletons add no value. See
10
+ * `2026-05-13-ecs-migration-plan.md` for the design rationale and the
11
+ * rules new `FrameUpdate` bodies must follow (pure function of `dt` plus
12
+ * selectors; no direct Redux dispatch from inside a tick).
13
+ */
14
+ type FrameUpdate = (dt: number, elapsed: number) => void;
15
+ /**
16
+ * Register a per-frame callback. Returns an unregister function.
17
+ *
18
+ * Registration is idempotent — calling with the same `fn` twice is a no-op
19
+ * (it remains a single entry in the underlying `Set`).
20
+ */
21
+ declare function registerFrameUpdate(fn: FrameUpdate): () => void;
22
+ /**
23
+ * Invoke all registered callbacks. Called by the WebXR session's
24
+ * `onXRFrame` once per frame with the XR-derived `dt` (seconds since the
25
+ * previous frame; 0 on the first frame after a reset) and `elapsed`
26
+ * (seconds since the session started).
27
+ *
28
+ * The set is snapshotted before iterating so that
29
+ * `registerFrameUpdate` / unregister calls made by a handler during the
30
+ * same frame are deferred to the next tick. Iterating the live `Set`
31
+ * would otherwise skip a not-yet-visited entry that an earlier handler
32
+ * unregistered — a hard-to-debug source of non-determinism.
33
+ *
34
+ * Each callback is invoked in its own `try/catch` so a throwing handler is
35
+ * isolated: it cannot abort the remaining callbacks nor propagate up through
36
+ * `onXRFrame` and kill the scene render for the whole frame. Failures are
37
+ * logged and the loop continues — mirrored by `runXrFrameUpdates`.
38
+ */
39
+ declare function runFrameUpdates(dt: number, elapsed: number): void;
40
+ /**
41
+ * Clear all registrations. Called from `resetWebXRState()` so a fresh
42
+ * session starts with an empty registry (any callbacks from the previous
43
+ * session are dropped along with their owning components).
44
+ */
45
+ declare function clearFrameUpdates(): void;
46
+ //#endregion
47
+ export { runFrameUpdates as i, clearFrameUpdates as n, registerFrameUpdate as r, FrameUpdate as t };
@@ -0,0 +1,58 @@
1
+ import * as THREE from "three";
2
+
3
+ //#region ../src/visualization/frustum-visibility.d.ts
4
+ /**
5
+ * Build (or refresh) a Three.js `Frustum` from `camera`'s current world
6
+ * transform and projection matrix. If `out` is provided, the frustum is
7
+ * written into it and returned; otherwise the module-level scratch frustum
8
+ * is used. Callers MUST treat the returned frustum as immutable until they
9
+ * next call this function or use one of the predicates without an injected
10
+ * frustum (both reuse the same scratch).
11
+ */
12
+ declare function buildCameraFrustum(camera: THREE.Camera, out?: THREE.Frustum): THREE.Frustum;
13
+ /**
14
+ * Strictly check whether a single world-space point lies inside all six
15
+ * frustum planes. Useful for HUD/follow logic where the caller already has
16
+ * the target world position and wants the cheapest possible check.
17
+ */
18
+ declare function isPointInCameraFrustum(camera: THREE.Camera, point: THREE.Vector3, frustum?: THREE.Frustum): boolean;
19
+ /**
20
+ * Check whether a world-space bounding sphere intersects the camera frustum
21
+ * (returns true even for partial overlap). Useful for callers that maintain
22
+ * a precomputed bounding sphere (LOD systems, instanced meshes, future
23
+ * `ArPowerSaver`).
24
+ */
25
+ declare function isSphereInCameraFrustum(camera: THREE.Camera, sphere: THREE.Sphere, frustum?: THREE.Frustum): boolean;
26
+ /**
27
+ * Check whether an `Object3D` is currently (at least partially) inside the
28
+ * camera frustum. The world bounding volume is resolved in tiers, cheapest
29
+ * first, so each common Three.js object type is gated by where it actually
30
+ * draws:
31
+ *
32
+ * 1. **Sprites** (`isSprite`) are screen-space billboards with no meaningful
33
+ * world geometry, so their world-space origin is tested as a point.
34
+ * 2. **Objects carrying an object-level `boundingSphere`** (`InstancedMesh`,
35
+ * `SkinnedMesh`, or any caller that pre-populates one) use that sphere,
36
+ * which reflects the instance spread / posed extent — unlike the base
37
+ * geometry sphere. It is computed lazily via `computeBoundingSphere()`
38
+ * when missing.
39
+ * 3. **Single renderables carrying a `geometry`** (`Mesh`, `Points`, `Line`,
40
+ * …) use the geometry's local bounding sphere × `matrixWorld`.
41
+ * 4. **Containers with children** (`Group`, `LOD`, …) use the world-space
42
+ * union of their descendants' bounding boxes (`Box3.setFromObject`),
43
+ * converted to a sphere.
44
+ * 5. **Truly empty / geometry-less objects** have no bounding volume and are
45
+ * treated as visible (`true`) — the conservative default for visibility
46
+ * gating.
47
+ *
48
+ * This deliberately avoids `Frustum.intersectsObject`, which unconditionally
49
+ * dereferences `object.geometry.boundingSphere` and therefore throws a
50
+ * `TypeError` for geometry-less objects such as `Group`s.
51
+ *
52
+ * Callers should ensure `object.updateMatrixWorld()` (with descendants, for
53
+ * containers: `updateMatrixWorld(true)`) has already run this frame (it
54
+ * normally has, via `renderer.render`).
55
+ */
56
+ declare function isObjectInCameraFrustum(camera: THREE.Camera, object: THREE.Object3D, frustum?: THREE.Frustum): boolean;
57
+ //#endregion
58
+ export { isSphereInCameraFrustum as i, isObjectInCameraFrustum as n, isPointInCameraFrustum as r, buildCameraFrustum as t };
@@ -1,4 +1,4 @@
1
- import { t as GpsCoord } from "./geo-types-Xx-LVcnw.js";
1
+ import { t as GpsCoord } from "./geo-types-clgzl8b5.js";
2
2
  import { LatLong, Matrix4, Vector3, fusedGpsFromOdom } from "gps-plus-slam-js";
3
3
 
4
4
  //#region ../src/utils/fused-path.d.ts
@@ -1,2 +1,2 @@
1
- import { a as gpsToH3, i as findNearbyGeoAnchor, n as KnownGeoAnchor, o as h3CellsMatch, r as approxDistanceMetres, s as isH3Index, t as H3_RESOLUTION } from "../h3-proximity-GwesPTFT.js";
1
+ import { a as gpsToH3, i as findNearbyGeoAnchor, n as KnownGeoAnchor, o as h3CellsMatch, r as approxDistanceMetres, s as isH3Index, t as H3_RESOLUTION } from "../h3-proximity-DJnghtir.js";
2
2
  export { H3_RESOLUTION, KnownGeoAnchor, approxDistanceMetres, findNearbyGeoAnchor, gpsToH3, h3CellsMatch, isH3Index };
@@ -1,2 +1,2 @@
1
- import { a as gpsToH3, i as findNearbyGeoAnchor, n as KnownGeoAnchor, o as h3CellsMatch, r as approxDistanceMetres, s as isH3Index, t as H3_RESOLUTION } from "../h3-proximity-GwesPTFT.js";
1
+ import { a as gpsToH3, i as findNearbyGeoAnchor, n as KnownGeoAnchor, o as h3CellsMatch, r as approxDistanceMetres, s as isH3Index, t as H3_RESOLUTION } from "../h3-proximity-DJnghtir.js";
2
2
  export { H3_RESOLUTION, type KnownGeoAnchor, approxDistanceMetres, findNearbyGeoAnchor, gpsToH3, h3CellsMatch, isH3Index };
@@ -18,6 +18,21 @@ interface GpsCoord {
18
18
  readonly lat: number;
19
19
  readonly lng: number;
20
20
  }
21
+ /**
22
+ * A raw GPS sample with optional accuracy (1σ horizontal radius in meters,
23
+ * mirroring the browser's `GeolocationCoordinates.accuracy`).
24
+ *
25
+ * Used for 2D map visualizations that draw a per-event accuracy circle
26
+ * alongside the GPS polyline so that low-quality fixes (large radius) are
27
+ * visually distinguishable from accurate fixes (small radius).
28
+ */
29
+ interface RawGpsSample extends GpsCoord {
30
+ /**
31
+ * Horizontal accuracy in meters (1σ / 68% confidence).
32
+ * `undefined` when the source GPS event lacked the field.
33
+ */
34
+ readonly accuracy?: number;
35
+ }
21
36
  /**
22
37
  * A reference point with GPS location and a human-readable name.
23
38
  * Extends GpsCoord so it is usable wherever GpsCoord is expected.
@@ -26,4 +41,4 @@ interface RefPointMarker extends GpsCoord {
26
41
  readonly name: string;
27
42
  }
28
43
  //#endregion
29
- export { RefPointMarker as n, GpsCoord as t };
44
+ export { RawGpsSample as n, RefPointMarker as r, GpsCoord as t };
@@ -17,7 +17,7 @@ interface GpsPosition {
17
17
  /**
18
18
  * Raw device orientation from the browser's DeviceOrientationEvent API.
19
19
  * Fields are nullable because sensors may be unavailable on some devices.
20
- * See also: DeviceOrientation in ar/tracking-state.ts (resolved, non-nullable).
20
+ * See also: DeviceOrientation in state/tracking-slice.ts (resolved, non-nullable).
21
21
  */
22
22
  interface RawDeviceOrientation {
23
23
  alpha: number | null;
@@ -0,0 +1,59 @@
1
+ import { i as LatLongAlt, r as LatLong } from "./index--ldLph4V.js";
2
+ import * as THREE from "three";
3
+
4
+ //#region ../src/visualization/gps-anchor.d.ts
5
+ type GpsAnchorMode = 'snap-when-offscreen' | 'snap-every-tick';
6
+ type GpsAnchorPhase = 'bootstrap' | 'anchored';
7
+ /**
8
+ * The minimum shape needed for the bootstrap median — a `LatLong` with
9
+ * optional altitude. Re-exported as a named alias so the sidecar and
10
+ * tests can refer to "the kind of point the anchor samples" without
11
+ * importing core types.
12
+ */
13
+ type GpsAnchorSamplePoint = LatLong | LatLongAlt;
14
+ interface GpsAnchorOptions {
15
+ readonly object3D: THREE.Object3D;
16
+ readonly arWorldGroup: THREE.Object3D;
17
+ readonly camera: THREE.Camera;
18
+ readonly gpsPoint: LatLong | LatLongAlt;
19
+ readonly skipBootstrap?: boolean;
20
+ readonly getAlignmentMatrix: () => readonly number[] | null;
21
+ readonly getGpsZeroRef: () => LatLong | null;
22
+ /** Returns the current GPS reading at "now", or null when no fix yet. */
23
+ readonly getCurrentGpsPoint: () => GpsAnchorSamplePoint | null;
24
+ /**
25
+ * Optional callback invoked whenever the bootstrap median is committed (the
26
+ * anchor's GPS reference is (re)assigned). Receives the exact committed point
27
+ * — the same value assigned to `gpsPoint`. Fires once after the initial
28
+ * bootstrap and again after every re-bootstrap (`markMovedExternally` →
29
+ * re-accumulate → commit). Never fires when `skipBootstrap` is true (there is
30
+ * no bootstrap to complete). Lets a host persist the committed reference (e.g.
31
+ * AnchorStarter writing `?show=`) so the persisted link equals the committed
32
+ * reference by construction.
33
+ */
34
+ readonly onBootstrapComplete?: (gpsPoint: LatLong | LatLongAlt) => void;
35
+ readonly mode?: GpsAnchorMode;
36
+ readonly floorY?: () => number | null;
37
+ readonly distanceThreshold?: number;
38
+ readonly angleThresholdInDegrees?: number;
39
+ readonly targetPosRefreshRateInSec?: number;
40
+ /** Number of 1 Hz samples collected during bootstrap. Default 7. */
41
+ readonly secondsToAccumulateGpsPose?: number;
42
+ /** Wait window (seconds) at phase entry during which no samples are taken. Default 0. */
43
+ readonly settlingSeconds?: number;
44
+ readonly heightAboveGround?: number | null;
45
+ }
46
+ interface GpsAnchor {
47
+ readonly phase: GpsAnchorPhase;
48
+ readonly isFullyAnchored: boolean;
49
+ /** Current target GPS pose; during `bootstrap` this is the seed, post-bootstrap the median. */
50
+ readonly gpsPoint: LatLong | LatLongAlt;
51
+ markMovedExternally(): void;
52
+ setGpsPoint(point: LatLong | LatLongAlt): void;
53
+ dispose(): void;
54
+ /** @internal — testing seam; exposed in lieu of pumping `runFrameUpdates`. */
55
+ __tickForTests(dt: number, elapsed: number): void;
56
+ }
57
+ declare function createGpsAnchor(options: GpsAnchorOptions): GpsAnchor;
58
+ //#endregion
59
+ export { GpsAnchorSamplePoint as a, GpsAnchorPhase as i, GpsAnchorMode as n, createGpsAnchor as o, GpsAnchorOptions as r, GpsAnchor as t };
@@ -1,4 +1,4 @@
1
- import { t as ARPose } from "./ar-types-B-ORgk6Z.js";
1
+ import { t as ARPose } from "./ar-types-isPsQptb.js";
2
2
  import { Quaternion, Vector3 } from "gps-plus-slam-js";
3
3
 
4
4
  //#region ../src/state/gps-ar-pose-sampler.d.ts
@@ -1,6 +1,6 @@
1
- import { t as ARPose } from "./ar-types-B-ORgk6Z.js";
2
- import { n as RawDeviceOrientation, t as GpsPosition } from "./gps-GKc6_Cly.js";
3
- import { i as SlamAppStore } from "./create-slam-app-store-DBm7g2Zd.js";
1
+ import { t as ARPose } from "./ar-types-isPsQptb.js";
2
+ import { n as RawDeviceOrientation, t as GpsPosition } from "./gps-B7AlMPz5.js";
3
+ import { i as SlamAppStore } from "./create-slam-app-store-B76AGaI0.js";
4
4
  import { Quaternion, RawGpsPoint, RecordGpsEventPayload, Vector3, eulerToQuaternion } from "gps-plus-slam-js";
5
5
  import { ReducersMapObject } from "@reduxjs/toolkit";
6
6
 
@@ -0,0 +1,103 @@
1
+ import { LatLong, Vector3 } from "gps-plus-slam-js";
2
+
3
+ //#region ../src/visualization/gps-event-markers.d.ts
4
+ /**
5
+ * Optional GPS-accuracy hints used by {@link GpsEventVisualizer.addGpsEvent}
6
+ * to render the raw-GPS marker as a non-uniform-scaled ellipsoid.
7
+ *
8
+ * Both fields are optional — missing or non-positive values fall back to the
9
+ * legacy fixed 8 cm sphere (same defensive policy as `preview-map.ts`).
10
+ */
11
+ interface GpsEventAccuracy {
12
+ /** Horizontal 1σ accuracy in metres (applied to both X and Z axes). */
13
+ horizontal?: number;
14
+ /** Vertical 1σ accuracy in metres (applied to the Y axis). */
15
+ vertical?: number;
16
+ }
17
+ /**
18
+ * Manager for GPS event visualization
19
+ */
20
+ declare class GpsEventVisualizer {
21
+ private rawGpsMarkers;
22
+ private fusedMarkers;
23
+ private snapshotMarkers;
24
+ private zeroRef;
25
+ private eventCounter;
26
+ private snapshotCounter;
27
+ /**
28
+ * Set the GPS zero reference (origin for coordinate conversion).
29
+ * Must be called before adding GPS events.
30
+ *
31
+ * @param zero - GPS coordinates of the origin
32
+ */
33
+ setZeroRef(zero: LatLong): void;
34
+ /**
35
+ * Get the current zero reference
36
+ */
37
+ getZeroRef(): LatLong | null;
38
+ /**
39
+ * Add a GPS event to the visualization.
40
+ * Creates both a raw GPS marker and a fused alignment marker.
41
+ *
42
+ * @param gpsCoords - GPS position as [x, y, z] meters from zero reference
43
+ * @param odomPosition - AR odometry position at the time of GPS reading
44
+ * @param accuracy - Optional 1σ GPS accuracy. When both fields are positive,
45
+ * the raw-GPS marker is rendered as a non-uniform-scaled ellipsoid:
46
+ * `mesh.scale.set(horizontal, vertical, horizontal)` over a unit sphere.
47
+ * When missing, zero, or negative, the marker falls back to the legacy
48
+ * fixed 8 cm sphere (same defensive policy as `preview-map.ts`).
49
+ * Cyan fused and red snapshot markers are never affected by this argument.
50
+ */
51
+ addGpsEvent(gpsCoords: Vector3, odomPosition: Vector3, accuracy?: GpsEventAccuracy): void;
52
+ /**
53
+ * Add an alignment snapshot marker at the given NUE position.
54
+ * Snapshots represent the system's best GPS estimate at each alignment update.
55
+ * Added to scene root (GPS world space), not arWorldGroup.
56
+ */
57
+ addAlignmentSnapshot(nuePosition: Vector3): void;
58
+ /**
59
+ * Get the NUE positions of all alignment snapshot markers.
60
+ * Used at session end to convert to GPS coordinates for the summary map.
61
+ */
62
+ getAlignmentSnapshotPositions(): Vector3[];
63
+ /**
64
+ * Create a sphere marker mesh with the given color and name.
65
+ */
66
+ private createMarkerMesh;
67
+ /**
68
+ * Clear all markers from the scene and reset state.
69
+ */
70
+ clearAll(): void;
71
+ /**
72
+ * Get count of visible markers.
73
+ */
74
+ getCounts(): {
75
+ raw: number;
76
+ fused: number;
77
+ snapshots: number;
78
+ };
79
+ /**
80
+ * Diagnostic accessor: returns the world-space size (`THREE.Box3.setFromObject`)
81
+ * of each raw-GPS marker, in insertion order.
82
+ *
83
+ * Used by the rec31 accuracy-ellipsoid Playwright spec (§3c) to verify the
84
+ * relative scaling of two events with different `latLongAccuracy`. This is
85
+ * the size of the rendered ellipsoid in scene units (= metres in replay
86
+ * mode), not the underlying geometry radius — so it correctly reflects the
87
+ * `mesh.scale.set(h, v, h)` applied for accuracy-aware markers.
88
+ *
89
+ * @returns array of `{ x, y, z }` sizes — empty array if there are no markers.
90
+ */
91
+ getRawMarkerWorldSizes(): Array<{
92
+ x: number;
93
+ y: number;
94
+ z: number;
95
+ }>;
96
+ }
97
+ /**
98
+ * Singleton instance for global use.
99
+ * Import this to visualize GPS events.
100
+ */
101
+ declare const gpsEventVisualizer: GpsEventVisualizer;
102
+ //#endregion
103
+ export { GpsEventVisualizer as n, gpsEventVisualizer as r, GpsEventAccuracy as t };
@@ -0,0 +1,45 @@
1
+ import { Mesh, Object3D } from "three";
2
+
3
+ //#region ../src/visualization/hit-test-reticle.d.ts
4
+ /** A column-major 4x4 transform, as produced by `XRPose.transform.matrix`. */
5
+ type HitMatrix = Float32Array | number[];
6
+ /**
7
+ * Build the reticle mesh: a thin ring oriented flat (rotated to lie in the
8
+ * XZ plane) so it reads as a marker on the ground/wall.
9
+ *
10
+ * `matrixAutoUpdate` is disabled because the reticle's world transform is
11
+ * written wholesale from the hit-test pose every frame; letting Three.js
12
+ * recompose it from position/quaternion/scale would discard that pose.
13
+ *
14
+ * The mesh starts hidden (`visible = false`) — there is no surface yet.
15
+ */
16
+ declare function createReticleMesh(): Mesh;
17
+ /**
18
+ * Apply the latest hit-test pose to the reticle.
19
+ *
20
+ * - When `matrix` is a 16-element transform, the reticle adopts it (after the
21
+ * WebXR→NUE basis change, see below) and becomes visible.
22
+ * - When `matrix` is `null` (no surface under the screen centre, or the
23
+ * hit-test source is not ready yet), the reticle is hidden.
24
+ *
25
+ * Frame handling — the part a porting developer must not get wrong. The
26
+ * hit-test pose is expressed in the **WebXR reference space** (`X=East, Y=Up,
27
+ * Z=South`), the same frame as the live camera pose. The reticle, however, is
28
+ * parented under `getArWorldGroup()`, whose local space is **NUE** (`X=North,
29
+ * Y=Up, Z=East`) — the camera reaches that frame through the static
30
+ * `basisChangeNode` that holds `WEBXR_TO_NUE`. The reticle has no such
31
+ * intermediate node, so we apply the same basis change here:
32
+ * `reticle.matrix = WEBXR_TO_NUE · hitPose`. The reticle's resulting world pose
33
+ * is then `arWorldGroup.matrix · WEBXR_TO_NUE · hitPose` — identical to the
34
+ * transform chain the camera rides, so it stays pinned under the screen centre.
35
+ *
36
+ * Without the basis change the WebXR coordinates were interpreted as NUE: the
37
+ * Up axis matched (both are Y) but East/North were swapped, so the reticle
38
+ * drifted sideways instead of tracking the screen centre.
39
+ *
40
+ * Works on any `Object3D` (not just the mesh from `createReticleMesh`) so it can
41
+ * be unit tested without a WebGL context.
42
+ */
43
+ declare function updateReticle(reticle: Object3D, matrix: HitMatrix | null): void;
44
+ //#endregion
45
+ export { createReticleMesh as n, updateReticle as r, HitMatrix as t };
@@ -1,4 +1,4 @@
1
- import { a as WebXRQuaternion, o as WebXRVec3, t as ARPose } from "./ar-types-B-ORgk6Z.js";
1
+ import { a as WebXRQuaternion, o as WebXRVec3, t as ARPose } from "./ar-types-isPsQptb.js";
2
2
 
3
3
  //#region ../src/ar/image-capture.d.ts
4
4
  /**
@@ -0,0 +1,2 @@
1
+ import { ArImageCapture as ArImageCapture$1, GpsPoint as GpsPoint$1, LatLong as LatLong$1, LatLongAlt, Matrix4 as Matrix4$1, Quaternion as Quaternion$1, RootState as LibraryRootState, RootState as RootState$1, Vector3 as Vector3$1, calcGpsCoords as calcGpsCoords$1, calcRelativeCoordsInMeters, createGpsSlamStore, isIdentityMatrix4, odometryTrackingRestarted, validateLicenseKey as validateLicenseKey$1, webxrToNUE } from "gps-plus-slam-js";
2
+ export { LibraryRootState as a, RootState$1 as c, calcRelativeCoordsInMeters as d, createGpsSlamStore as f, webxrToNUE as g, validateLicenseKey$1 as h, LatLongAlt as i, Vector3$1 as l, odometryTrackingRestarted as m, GpsPoint$1 as n, Matrix4$1 as o, isIdentityMatrix4 as p, LatLong$1 as r, Quaternion$1 as s, ArImageCapture$1 as t, calcGpsCoords$1 as u };
@@ -0,0 +1,23 @@
1
+ import { Matrix4 } from "three";
2
+
3
+ //#region ../src/ar/webxr-nue-basis.d.ts
4
+ /**
5
+ * Constant matrix converting WebXR local-floor coordinates to the internal
6
+ * NUE (North-Up-East) convention.
7
+ *
8
+ * WebXR: X=East, Y=Up, Z=South (right-handed, toward viewer)
9
+ * NUE: X=North, Y=Up, Z=East (right-handed)
10
+ *
11
+ * Mapping: NUE_X = -WebXR_Z, NUE_Y = WebXR_Y, NUE_Z = WebXR_X
12
+ *
13
+ * Row-major:
14
+ * [ 0 0 -1 0 ]
15
+ * [ 0 1 0 0 ]
16
+ * [ 1 0 0 0 ]
17
+ * [ 0 0 0 1 ]
18
+ *
19
+ * Stored column-major (Three.js / gl-matrix convention).
20
+ */
21
+ declare const WEBXR_TO_NUE: Matrix4;
22
+ //#endregion
23
+ export { WEBXR_TO_NUE as t };
@@ -0,0 +1,37 @@
1
+ import { L as CombinedRootState, h as TrackingQualityReport } from "./create-slam-app-store-B76AGaI0.js";
2
+ import { Add2dImagePayload, GpsPoint as GpsPoint$1, LatLong as LatLong$1, RawDeviceOrientation, RawGpsPoint as RawGpsPoint$1, RecordGpsEventPayload as RecordGpsEventPayload$1, add2dImage, calcRelativeCoordsInMeters, recordGpsEvent as recordGpsEvent$1, setZeroPos as setZeroPos$1 } from "gps-plus-slam-js";
3
+
4
+ //#region ../src/state/onboarding-guidance.d.ts
5
+ /**
6
+ * Coaching phase derived from the tracking-quality `state`. Ordered from
7
+ * "no signal yet" to "ready to place an anchor". The order matters: it is
8
+ * the basis for the monotonic {@link OnboardingGuidance.percentReady}.
9
+ */
10
+ type OnboardingPhase = 'initializing' | 'ar-lost' | 'move-around' | 'almost-ready' | 'ready';
11
+ interface OnboardingGuidance {
12
+ /** Coaching phase — maps 1:1 onto the tracking-quality state (+ null). */
13
+ phase: OnboardingPhase;
14
+ /**
15
+ * 0..1 readiness for placing an anchor. Monotonic across phases
16
+ * (`initializing` = `ar-lost` ≤ `move-around` ≤ `almost-ready` ≤ `ready`)
17
+ * and, within `move-around`, monotonic in `subScores.coverage`; within
18
+ * `almost-ready`, monotonic in `confidence`.
19
+ */
20
+ percentReady: number;
21
+ /** Short, user-facing coaching line. */
22
+ hint: string;
23
+ }
24
+ /**
25
+ * Map a tracking-quality report (or `null` when none has been produced yet)
26
+ * to a single onboarding instruction. Never throws; a `null` or malformed
27
+ * report degrades to the `initializing` phase.
28
+ */
29
+ declare function computeOnboardingGuidance(report: TrackingQualityReport | null): OnboardingGuidance;
30
+ /**
31
+ * Store-bound convenience wrapper: read the current tracking-quality report
32
+ * and map it to onboarding guidance. Returns the `initializing` guidance
33
+ * when no report exists yet.
34
+ */
35
+ declare function selectOnboardingGuidance(state: CombinedRootState): OnboardingGuidance;
36
+ //#endregion
37
+ export { RawGpsPoint$1 as a, calcRelativeCoordsInMeters as c, OnboardingGuidance as d, OnboardingPhase as f, RawDeviceOrientation as i, recordGpsEvent$1 as l, selectOnboardingGuidance as m, GpsPoint$1 as n, RecordGpsEventPayload$1 as o, computeOnboardingGuidance as p, LatLong$1 as r, add2dImage as s, Add2dImagePayload as t, setZeroPos$1 as u };