gps-plus-slam-app-framework 1.1.0 → 1.3.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/dist/{app-selectors-CR9OWodf.d.ts → app-selectors-B8VQoMDY.d.ts} +1 -1
- package/dist/ar/bresenham3d.d.ts +2 -0
- package/dist/ar/bresenham3d.js +81 -0
- package/dist/ar/camera-blit-capture.d.ts +1 -1
- package/dist/ar/camera-blit-capture.js +43 -2
- package/dist/ar/capability-checker.d.ts +1 -1
- package/dist/ar/capture-failure-tracker.d.ts +1 -1
- package/dist/ar/chromium-camera-access-workaround.d.ts +1 -1
- package/dist/ar/depth-sampler.d.ts +3 -3
- package/dist/ar/depth-sampler.js +63 -8
- package/dist/ar/depth-unprojection.d.ts +2 -0
- package/dist/ar/depth-unprojection.js +94 -0
- package/dist/ar/enable-gps-ar.d.ts +1 -1
- package/dist/ar/enable-gps-ar.js +1 -1
- package/dist/ar/frame-loop.d.ts +1 -1
- package/dist/ar/image-capture.d.ts +2 -2
- package/dist/ar/image-capture.js +9 -6
- package/dist/ar/index.d.ts +19 -16
- package/dist/ar/index.js +7 -4
- package/dist/ar/occupancy-grid.d.ts +2 -0
- package/dist/ar/occupancy-grid.js +164 -0
- package/dist/ar/replay-scene.d.ts +1 -1
- package/dist/ar/replay-scene.js +1 -1
- package/dist/ar/scene-node-names.d.ts +1 -1
- package/dist/ar/webxr-nue-basis.d.ts +2 -0
- package/dist/{webxr-nue-basis-BbdqhqY6.js → ar/webxr-nue-basis.js} +1 -1
- package/dist/ar/webxr-session.d.ts +3 -3
- package/dist/ar/webxr-session.js +1 -969
- package/dist/ar/xr-camera-texture.d.ts +1 -1
- package/dist/ar/xr-error-handler.d.ts +1 -1
- package/dist/ar/xr-frame-loop.d.ts +1 -1
- package/dist/{ar-types-isPsQptb.d.ts → ar-types-Dan1MVTi.d.ts} +28 -5
- package/dist/{ar-world-group-alignment-Dn4rQk_c.d.ts → ar-world-group-alignment-C9lwwIyI.d.ts} +1 -1
- package/dist/bresenham3d-CFfd7n6B.d.ts +59 -0
- package/dist/{camera-blit-capture-75WWa9Xb.d.ts → camera-blit-capture-CnxUDbKx.d.ts} +29 -0
- package/dist/core/index.d.ts +1 -1
- package/dist/{create-slam-app-store-B76AGaI0.d.ts → create-slam-app-store-BljusOua.d.ts} +5 -5
- package/dist/depth-sampler-Bhanfwla.d.ts +169 -0
- package/dist/depth-unprojection-Y6i_mJuT.d.ts +52 -0
- package/dist/{enable-gps-ar-DNbO0zbg.d.ts → enable-gps-ar-BfUJOgpW.d.ts} +4 -4
- package/dist/{file-system-TIsDfamK.d.ts → file-system-CwXTNHmB.d.ts} +1 -1
- package/dist/file-system-utils-CXIoL-DM.d.ts +40 -0
- package/dist/{frame-conversions-D2EYjeNa.d.ts → frame-conversions-BfsafGWR.d.ts} +1 -1
- package/dist/{fused-path-BdVHmDW9.d.ts → fused-path-DJoVu98b.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-CISLPQIb.d.ts → gps-anchor-dYeCvvp5.d.ts} +1 -1
- package/dist/{gps-ar-pose-sampler-BypXZUqC.d.ts → gps-ar-pose-sampler-DVb96iOy.d.ts} +1 -1
- package/dist/{gps-event-coordinator-BKVZbS1M.d.ts → gps-event-coordinator-CWIDOk4U.d.ts} +3 -3
- package/dist/{image-capture-BXZUmj7j.d.ts → image-capture-qAZ5Fh5X.d.ts} +44 -5
- package/dist/{index-BB2KEWbN2.d.ts → index-BYYUdf9v.d.ts} +1 -1
- package/dist/index.d.ts +67 -64
- package/dist/index.js +7 -4
- package/dist/{leaflet-map-overlay-jNt-kcUr.d.ts → leaflet-map-overlay-6CJC-E1l.d.ts} +1 -1
- package/dist/{map-data-BGIBM5rv.d.ts → map-data-CkloBxIl.d.ts} +1 -1
- package/dist/{map-overlay-draw-DcGs9UV3.d.ts → map-overlay-draw-krOKwDAq.d.ts} +1 -1
- package/dist/{null-storage-backend-BPQJSaMw.d.ts → null-storage-backend-uKQE8tl7.d.ts} +2 -2
- package/dist/occupancy-grid-BRNRaPyT.d.ts +72 -0
- package/dist/{opfs-storage-LsLY6VZV.d.ts → opfs-storage-D5zAn_lx.d.ts} +2 -2
- package/dist/{opfs-storage-backend-u4QKvgvP.d.ts → opfs-storage-backend-6aYMUZlJ.d.ts} +2 -2
- package/dist/{persistence-middleware-xB5sTllJ.d.ts → persistence-middleware-B9ei4Nhx.d.ts} +1 -1
- package/dist/{recording-options-BSFpBSZH.d.ts → recording-options-DJBXuMxV.d.ts} +12 -2
- package/dist/{recording-replayer-CTL2cUE0.d.ts → recording-replayer-r0DZ9ALp.d.ts} +2 -2
- package/dist/{recording-slice-Cb888P6d.d.ts → recording-slice-89O07ebs.d.ts} +10 -2
- package/dist/{replay-engine-B-5GIZtc.d.ts → replay-engine-XpDa0dy1.d.ts} +1 -1
- package/dist/{replay-scene-DkNfldPh.d.ts → replay-scene-Bw58VL6p.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/permission-checker.d.ts +1 -1
- package/dist/state/app-selectors.d.ts +1 -1
- package/dist/state/app-selectors.js +3 -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 +16 -16
- package/dist/state/persistence-middleware.d.ts +1 -1
- package/dist/state/recording-options.d.ts +1 -1
- package/dist/state/recording-options.js +5 -3
- package/dist/state/recording-replayer.d.ts +2 -2
- package/dist/state/recording-slice.d.ts +1 -1
- package/dist/state/recording-slice.js +11 -2
- 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-quality.js +1 -1
- package/dist/state/tracking-slice.d.ts +1 -1
- package/dist/storage/file-system-utils.d.ts +2 -2
- package/dist/storage/file-system-utils.js +17 -1
- package/dist/storage/file-system.d.ts +1 -1
- package/dist/storage/file-system.js +2 -2
- 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/opfs-storage.js +4 -4
- package/dist/storage/storage-backend.d.ts +1 -1
- package/dist/storage/zip-export.d.ts +1 -1
- package/dist/storage/zip-export.js +1 -1
- package/dist/storage/zip-reader.d.ts +1 -1
- package/dist/storage/zip-reader.js +1 -1
- package/dist/{storage-backend-yDSKafAQ.d.ts → storage-backend-Do6YDpNo.d.ts} +1 -1
- package/dist/{store-subscribers-swlbtg_z.d.ts → store-subscribers-0YWyOLvV.d.ts} +2 -2
- package/dist/{subscribe-to-selector--KQpgLXG.d.ts → subscribe-to-selector-CZ6k1NFP.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/test-utils/zip-round-trip-helpers.js +3 -2
- package/dist/{tracking-slice-CDREeoZ_.d.ts → tracking-slice-CdK8c-8P.d.ts} +1 -1
- package/dist/types/ar-types.d.ts +2 -2
- package/dist/types/geo-types.d.ts +1 -1
- package/dist/types/index.d.ts +3 -3
- 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 +1 -1
- 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 +1 -1
- package/dist/visualization/frustum-visibility.d.ts +1 -1
- package/dist/visualization/gps-anchor.d.ts +1 -1
- package/dist/visualization/gps-compass-cubes.d.ts +1 -1
- package/dist/visualization/gps-event-markers.d.ts +1 -1
- package/dist/visualization/gps-event-markers.js +1 -1
- package/dist/visualization/hit-test-reticle.d.ts +1 -1
- package/dist/visualization/hit-test-reticle.js +1 -1
- package/dist/visualization/index.d.ts +18 -18
- 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-session-BnArFCew.d.ts → webxr-session-GjZ2BIpS.d.ts} +21 -10
- package/dist/webxr-session-TIaD883f.js +1054 -0
- package/dist/{zip-export-C0_ErAqT.d.ts → zip-export-G14hkSPG.d.ts} +1 -1
- package/package.json +2 -2
- package/dist/depth-sampler-CqrkRr2N.d.ts +0 -108
- package/dist/file-system-utils-BH6uIs2i.d.ts +0 -24
- /package/dist/{accuracy-circles-DEKr0Hoh.d.ts → accuracy-circles-BpwWAs8G.d.ts} +0 -0
- /package/dist/{alignment-lerper-CCZJf-Xb.d.ts → alignment-lerper-Dm9G7JJO.d.ts} +0 -0
- /package/dist/{camera-follower-B-nS1sr6.d.ts → camera-follower-C2mwEn7c.d.ts} +0 -0
- /package/dist/{capability-checker-BTCmZRL4.d.ts → capability-checker-CQXJHxXg.d.ts} +0 -0
- /package/dist/{capture-failure-tracker-D4HYJNOj.d.ts → capture-failure-tracker-CUeU3L_M.d.ts} +0 -0
- /package/dist/{chromium-camera-access-workaround-MifIwK9x.d.ts → chromium-camera-access-workaround-Jqbn0apH.d.ts} +0 -0
- /package/dist/{concurrency-Bsmv53qw.d.ts → concurrency-CO1FQvs3.d.ts} +0 -0
- /package/dist/{css3d-renderer-manager-EDED3nvg.d.ts → css3d-renderer-manager-ptu_t3B3.d.ts} +0 -0
- /package/dist/{failure-tracker-D7ELffm0.d.ts → failure-tracker-Cn8Fo9D4.d.ts} +0 -0
- /package/dist/{format-file-size-B7gJb3Md.d.ts → format-file-size-CLCZz3lC.d.ts} +0 -0
- /package/dist/{frame-loop-BTeRpDm4.d.ts → frame-loop-CMewS8cY.d.ts} +0 -0
- /package/dist/{frustum-visibility-DGnJqls0.d.ts → frustum-visibility-CmI96ESS.d.ts} +0 -0
- /package/dist/{geo-types-clgzl8b5.d.ts → geo-types-SaPnIEUM.d.ts} +0 -0
- /package/dist/{gps-B7AlMPz5.d.ts → gps-VuezJWK3.d.ts} +0 -0
- /package/dist/{gps-compass-cubes-Ys6Hf1nc.d.ts → gps-compass-cubes-BM1uGiYV.d.ts} +0 -0
- /package/dist/{gps-error-handler-BLDhUlw5.d.ts → gps-error-handler-CJl_2MVm.d.ts} +0 -0
- /package/dist/{gps-event-markers-BlHq3jYV.d.ts → gps-event-markers-Dc9FT-q1.d.ts} +0 -0
- /package/dist/{h3-proximity-DJnghtir.d.ts → h3-proximity-I1msGPgE.d.ts} +0 -0
- /package/dist/{hit-test-reticle-BGXOxrUh.d.ts → hit-test-reticle-BEzEybxZ.d.ts} +0 -0
- /package/dist/{index--ldLph4V.d.ts → index-CF05QV2m.d.ts} +0 -0
- /package/dist/{lerp-utils-DNcSmKVX.d.ts → lerp-utils-BpV-0Dtk.d.ts} +0 -0
- /package/dist/{list-formatter-CsqcU4v5.d.ts → list-formatter-RRcBe8Vg.d.ts} +0 -0
- /package/dist/{logger-BZ44Dhd3.d.ts → logger-BEHXsnnq.d.ts} +0 -0
- /package/dist/{map-overlay-yrFsUtGv.d.ts → map-overlay-bcogY5fK.d.ts} +0 -0
- /package/dist/{permission-checker-CfV7INCa.d.ts → permission-checker-GpAiSCwd.d.ts} +0 -0
- /package/dist/{scene-node-names-IHW7HR4S.d.ts → scene-node-names-Bu0S66H1.d.ts} +0 -0
- /package/dist/{three-dispose-WTBAfaWU.d.ts → three-dispose-D950t71B.d.ts} +0 -0
- /package/dist/{vis-colors-Djnyg_UH.d.ts → vis-colors-D6omC64K.d.ts} +0 -0
- /package/dist/{index-22v8MXJX.d.ts → webxr-nue-basis-CqKQmZzT.d.ts} +0 -0
- /package/dist/{xr-camera-texture-BU5YvKAM.d.ts → xr-camera-texture-DBwCaKTd.d.ts} +0 -0
- /package/dist/{xr-error-handler-DcUFshNF.d.ts → xr-error-handler-C0AQRmxs.d.ts} +0 -0
- /package/dist/{xr-frame-loop-BKckC7xC.d.ts → xr-frame-loop-BtYytZJg.d.ts} +0 -0
- /package/dist/{zip-reader-B2lzN8F5.d.ts → zip-reader-DSEXt7K6.d.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as CombinedRootState, r as SlamAppRootState } from "./create-slam-app-store-
|
|
1
|
+
import { L as CombinedRootState, r as SlamAppRootState } from "./create-slam-app-store-BljusOua.js";
|
|
2
2
|
import * as _$gps_plus_slam_js0 from "gps-plus-slam-js";
|
|
3
3
|
import { ArImageCapture, GpsPoint, LatLong, Matrix4, Quaternion, Vector3 } from "gps-plus-slam-js";
|
|
4
4
|
import * as _$_reduxjs_toolkit0 from "@reduxjs/toolkit";
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
//#region ../src/ar/bresenham3d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Main-thread safety cap: the maximum dominant-axis (Chebyshev) span a single
|
|
4
|
+
* trace may cover. The trace runs synchronously, one iteration per
|
|
5
|
+
* dominant-axis step, so an unbounded span freezes the UI. Finite-but-absurd
|
|
6
|
+
* coordinates (a tracking glitch, a corrupt projectionMatrix unprojecting to a
|
|
7
|
+
* huge world point) quantize to safe integers and pass the integer check, so
|
|
8
|
+
* this is the only thing standing between such input and a multi-second
|
|
9
|
+
* (potentially multi-billion-iteration) freeze.
|
|
10
|
+
*
|
|
11
|
+
* Chosen generously — at the grid's 0.15 m cells this is ~150 km, far beyond
|
|
12
|
+
* any real AR scene, so it never trips on legitimate carving or raycasting.
|
|
13
|
+
* It is a circuit breaker against programmer/data error, not a ray-length
|
|
14
|
+
* policy: exceeding it throws (loud — surfaces the upstream bug) rather than
|
|
15
|
+
* silently truncating the trace.
|
|
16
|
+
*/
|
|
17
|
+
const MAX_TRACE_STEPS = 1e6;
|
|
18
|
+
/**
|
|
19
|
+
* Trace the line from `start` to `end`, calling `visitCell` per cell.
|
|
20
|
+
*
|
|
21
|
+
* @param visitCell - return `false` to stop the trace early.
|
|
22
|
+
* @param stopDistance - dominant-axis steps before `end` at which to stop
|
|
23
|
+
* (default 0 = trace all the way to `end`).
|
|
24
|
+
* @throws TypeError when a coordinate is not a safe integer (cells must be
|
|
25
|
+
* quantized before tracing — programmer error, not a data error).
|
|
26
|
+
* @throws RangeError when `stopDistance` is not a non-negative safe integer.
|
|
27
|
+
* The loop terminates on a counter (`i--`) that decrements unconditionally,
|
|
28
|
+
* so a negative or fractional value still terminates (it merely traces past
|
|
29
|
+
* `end`); but `NaN`/`-Infinity` never satisfy `i <= stopDistance` and would
|
|
30
|
+
* spin forever. Rejecting up front both prevents that freeze and enforces
|
|
31
|
+
* the "dominant-axis steps before end" contract.
|
|
32
|
+
* @throws RangeError when the dominant-axis span exceeds {@link MAX_TRACE_STEPS}
|
|
33
|
+
* (circuit breaker against a synchronous main-thread freeze from
|
|
34
|
+
* finite-but-absurd coordinates).
|
|
35
|
+
*/
|
|
36
|
+
function bresenham3d(start, end, visitCell, stopDistance = 0) {
|
|
37
|
+
assertIntegerCell(start);
|
|
38
|
+
assertIntegerCell(end);
|
|
39
|
+
if (!Number.isSafeInteger(stopDistance) || stopDistance < 0) throw new RangeError(`bresenham3d stopDistance must be a non-negative safe integer, got ${stopDistance}`);
|
|
40
|
+
let [x, y, z] = start;
|
|
41
|
+
const dx = Math.abs(end[0] - x);
|
|
42
|
+
const sx = x < end[0] ? 1 : -1;
|
|
43
|
+
const dy = Math.abs(end[1] - y);
|
|
44
|
+
const sy = y < end[1] ? 1 : -1;
|
|
45
|
+
const dz = Math.abs(end[2] - z);
|
|
46
|
+
const sz = z < end[2] ? 1 : -1;
|
|
47
|
+
const dm = Math.max(dx, dy, dz);
|
|
48
|
+
if (dm > 1e6) throw new RangeError(`bresenham3d dominant-axis span ${dm} exceeds MAX_TRACE_STEPS ${MAX_TRACE_STEPS}; cells [${start.join(", ")}]→[${end.join(", ")}] are too far apart to trace synchronously`);
|
|
49
|
+
let i = dm;
|
|
50
|
+
let errX = Math.floor(dm / 2);
|
|
51
|
+
let errY = errX;
|
|
52
|
+
let errZ = errX;
|
|
53
|
+
for (;;) {
|
|
54
|
+
if (!visitCell([
|
|
55
|
+
x,
|
|
56
|
+
y,
|
|
57
|
+
z
|
|
58
|
+
])) return;
|
|
59
|
+
if (i-- <= stopDistance) return;
|
|
60
|
+
errX -= dx;
|
|
61
|
+
if (errX < 0) {
|
|
62
|
+
errX += dm;
|
|
63
|
+
x += sx;
|
|
64
|
+
}
|
|
65
|
+
errY -= dy;
|
|
66
|
+
if (errY < 0) {
|
|
67
|
+
errY += dm;
|
|
68
|
+
y += sy;
|
|
69
|
+
}
|
|
70
|
+
errZ -= dz;
|
|
71
|
+
if (errZ < 0) {
|
|
72
|
+
errZ += dm;
|
|
73
|
+
z += sz;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function assertIntegerCell(cell) {
|
|
78
|
+
if (!cell.every((v) => Number.isSafeInteger(v))) throw new TypeError(`bresenham3d requires integer cell coordinates, got [${cell.join(", ")}]`);
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { MAX_TRACE_STEPS, bresenham3d };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as computeCaptureSize, n as CameraBlitCaptureConfig, r as DEFAULT_BLIT_CONFIG, t as CameraBlitCapture } from "../camera-blit-capture-
|
|
1
|
+
import { i as computeCaptureSize, n as CameraBlitCaptureConfig, r as DEFAULT_BLIT_CONFIG, t as CameraBlitCapture } from "../camera-blit-capture-CnxUDbKx.js";
|
|
2
2
|
export { CameraBlitCapture, CameraBlitCaptureConfig, DEFAULT_BLIT_CONFIG, computeCaptureSize };
|
|
@@ -118,8 +118,32 @@ var CameraBlitCapture = class {
|
|
|
118
118
|
* @returns JPEG Blob, or null if capture fails
|
|
119
119
|
*/
|
|
120
120
|
async captureToBlob(renderer, cameraTexture, quality) {
|
|
121
|
+
if (!this.captureToPixels(renderer, cameraTexture)) return null;
|
|
122
|
+
try {
|
|
123
|
+
return await this.pixelsToJpegBlob(quality);
|
|
124
|
+
} catch (error) {
|
|
125
|
+
log.error("Blit capture failed:", error);
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Run the blit + readback (steps A+B of {@link captureToBlob}) and return
|
|
131
|
+
* the raw RGBA pixel buffer without JPEG encoding — the cheap path for
|
|
132
|
+
* per-point color sampling (occupancy-grid port plan Iter 8).
|
|
133
|
+
*
|
|
134
|
+
* IMPORTANT: Must be called within the XR animation frame callback, while
|
|
135
|
+
* the camera texture is valid. The returned `pixels` is the INTERNAL
|
|
136
|
+
* buffer — valid only until the next capture or `resizeIfNeeded`; consume
|
|
137
|
+
* it synchronously (e.g. via `createRgbLookup`) or copy it.
|
|
138
|
+
*
|
|
139
|
+
* Note: the buffer is in WebGL readback order (bottom-row-first / RGBA);
|
|
140
|
+
* `createRgbLookup` handles the y-flip.
|
|
141
|
+
*
|
|
142
|
+
* @returns the buffer with its dimensions, or null on failure/dispose.
|
|
143
|
+
*/
|
|
144
|
+
captureToPixels(renderer, cameraTexture) {
|
|
121
145
|
if (this.disposed) {
|
|
122
|
-
log.warn("
|
|
146
|
+
log.warn("captureToPixels called after dispose");
|
|
123
147
|
return null;
|
|
124
148
|
}
|
|
125
149
|
try {
|
|
@@ -133,7 +157,11 @@ var CameraBlitCapture = class {
|
|
|
133
157
|
renderer.setRenderTarget(currentRenderTarget);
|
|
134
158
|
renderer.xr.enabled = currentXrEnabled;
|
|
135
159
|
this.blitMaterial.uniforms.tDiffuse.value = null;
|
|
136
|
-
return
|
|
160
|
+
return {
|
|
161
|
+
pixels: this.pixelBuffer,
|
|
162
|
+
width: this.width,
|
|
163
|
+
height: this.height
|
|
164
|
+
};
|
|
137
165
|
} catch (error) {
|
|
138
166
|
log.error("Blit capture failed:", error);
|
|
139
167
|
return null;
|
|
@@ -239,6 +267,19 @@ var CameraBlitCapture = class {
|
|
|
239
267
|
return true;
|
|
240
268
|
}
|
|
241
269
|
/**
|
|
270
|
+
* Current render-target width in pixels. This is exactly the width of the
|
|
271
|
+
* JPEG produced by {@link captureToBlob} (the encode canvas is sized to the
|
|
272
|
+
* render target), so callers can persist it as the captured image's true
|
|
273
|
+
* pixel width without decoding the blob.
|
|
274
|
+
*/
|
|
275
|
+
getWidth() {
|
|
276
|
+
return this.width;
|
|
277
|
+
}
|
|
278
|
+
/** Current render-target height in pixels. See {@link getWidth}. */
|
|
279
|
+
getHeight() {
|
|
280
|
+
return this.height;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
242
283
|
* Dispose GPU resources. Call when AR session ends.
|
|
243
284
|
*/
|
|
244
285
|
dispose() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as isFullySupported, n as CapabilitySupport, r as capabilityMessage, t as CapabilityMessageOptions } from "../capability-checker-
|
|
1
|
+
import { i as isFullySupported, n as CapabilitySupport, r as capabilityMessage, t as CapabilityMessageOptions } from "../capability-checker-CQXJHxXg.js";
|
|
2
2
|
export { CapabilityMessageOptions, CapabilitySupport, capabilityMessage, isFullySupported };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-CUeU3L_M.js";
|
|
2
2
|
export { CAPTURE_FAILURE_WARNING, CaptureFailureTracker, CaptureFailureTrackerConfig, DEFAULT_CAPTURE_TRACKER_CONFIG, createCaptureFailureTracker };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-Jqbn0apH.js";
|
|
2
2
|
export { BASELAYER_WINDOW_MAX, BASELAYER_WINDOW_MIN, ChromeVersion, ChromiumProjectionLayerWorkaroundResult, applyChromiumProjectionLayerWorkaround, needsBaseLayerPersistence, parseChromeVersion };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as DepthSample } from "../ar-types-
|
|
2
|
-
import { i as DepthSamplerConfig, n as DepthSampler, r as DepthSamplerCallbacks, t as DepthInfo } from "../depth-sampler-
|
|
3
|
-
export { DepthInfo, DepthSample, DepthSampler, DepthSamplerCallbacks, DepthSamplerConfig };
|
|
1
|
+
import { i as DepthSample } from "../ar-types-Dan1MVTi.js";
|
|
2
|
+
import { a as wrapXRDepthInfo, i as DepthSamplerConfig, n as DepthSampler, r as DepthSamplerCallbacks, t as DepthInfo } from "../depth-sampler-Bhanfwla.js";
|
|
3
|
+
export { DepthInfo, DepthSample, DepthSampler, DepthSamplerCallbacks, DepthSamplerConfig, wrapXRDepthInfo };
|
package/dist/ar/depth-sampler.js
CHANGED
|
@@ -1,9 +1,32 @@
|
|
|
1
1
|
import { extractOdomPosition } from "../state/gps-event-coordinator.js";
|
|
2
2
|
//#region ../src/ar/depth-sampler.ts
|
|
3
|
+
/**
|
|
4
|
+
* Wrap a raw browser XRDepthInformation object into a {@link DepthInfo}.
|
|
5
|
+
*
|
|
6
|
+
* - `getDepthInMeters` is bound to the source object (browser
|
|
7
|
+
* implementations are this-sensitive).
|
|
8
|
+
* - `projectionMatrix` (typically `XRView.projectionMatrix`, a Float32Array
|
|
9
|
+
* the UA may reuse across frames) is defensively validated and copied into
|
|
10
|
+
* a plain serializable 16-tuple; invalid input (wrong length, non-finite
|
|
11
|
+
* entries) yields a DepthInfo without a matrix rather than an error.
|
|
12
|
+
*/
|
|
13
|
+
function wrapXRDepthInfo(raw, projectionMatrix) {
|
|
14
|
+
const wrapped = {
|
|
15
|
+
width: raw.width,
|
|
16
|
+
height: raw.height,
|
|
17
|
+
getDepthInMeters: raw.getDepthInMeters.bind(raw)
|
|
18
|
+
};
|
|
19
|
+
if (projectionMatrix && projectionMatrix.length === 16) {
|
|
20
|
+
const copy = Array.from(projectionMatrix);
|
|
21
|
+
if (copy.every((v) => Number.isFinite(v))) wrapped.projectionMatrix = copy;
|
|
22
|
+
}
|
|
23
|
+
return wrapped;
|
|
24
|
+
}
|
|
3
25
|
const DEFAULT_CONFIG = {
|
|
4
26
|
intervalMs: 1e3,
|
|
5
|
-
gridSize:
|
|
6
|
-
unavailabilityThresholdMs: 5e3
|
|
27
|
+
gridSize: 16,
|
|
28
|
+
unavailabilityThresholdMs: 5e3,
|
|
29
|
+
rgb: true
|
|
7
30
|
};
|
|
8
31
|
/**
|
|
9
32
|
* Samples sparse depth points from WebXR depth sensing.
|
|
@@ -74,6 +97,18 @@ var DepthSampler = class {
|
|
|
74
97
|
return { ...this.config };
|
|
75
98
|
}
|
|
76
99
|
/**
|
|
100
|
+
* Apply partial configuration overrides (e.g. the user's recording
|
|
101
|
+
* options, plumbed in by `startDepthCapture` just before sampling
|
|
102
|
+
* starts). Invalid values are ignored defensively: every key requires a
|
|
103
|
+
* finite positive number, and `gridSize` additionally an integer.
|
|
104
|
+
*/
|
|
105
|
+
updateConfig(config) {
|
|
106
|
+
if (isFinitePositive(config.intervalMs)) this.config.intervalMs = config.intervalMs;
|
|
107
|
+
if (isFinitePositive(config.gridSize) && Number.isInteger(config.gridSize)) this.config.gridSize = config.gridSize;
|
|
108
|
+
if (isFinitePositive(config.unavailabilityThresholdMs)) this.config.unavailabilityThresholdMs = config.unavailabilityThresholdMs;
|
|
109
|
+
if (typeof config.rgb === "boolean") this.config.rgb = config.rgb;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
77
112
|
* Called each frame with depth information.
|
|
78
113
|
*
|
|
79
114
|
* @param timestamp - Current frame timestamp in milliseconds
|
|
@@ -89,7 +124,7 @@ var DepthSampler = class {
|
|
|
89
124
|
if (timestamp - this.lastSampleTime < this.config.intervalMs) return;
|
|
90
125
|
const pose = this.callbacks.getCurrentPose();
|
|
91
126
|
if (!pose) return;
|
|
92
|
-
const points = this.sampleGrid(depthInfo);
|
|
127
|
+
const points = this.sampleGrid(depthInfo, this.acquireRgbLookupSafely());
|
|
93
128
|
const sample = {
|
|
94
129
|
timestamp: performance.timeOrigin + timestamp,
|
|
95
130
|
cameraPos: extractOdomPosition(pose),
|
|
@@ -99,26 +134,43 @@ var DepthSampler = class {
|
|
|
99
134
|
pose.orientation.z,
|
|
100
135
|
pose.orientation.w
|
|
101
136
|
],
|
|
102
|
-
points
|
|
137
|
+
points,
|
|
138
|
+
...depthInfo.projectionMatrix ? { projectionMatrix: depthInfo.projectionMatrix } : {}
|
|
103
139
|
};
|
|
104
140
|
this.lastSampleTime = timestamp;
|
|
105
141
|
this.sampleCount++;
|
|
106
142
|
this.callbacks.onSampleCaptured(sample);
|
|
107
143
|
}
|
|
108
144
|
/**
|
|
109
|
-
*
|
|
145
|
+
* Acquire the per-sample RGB lookup, gated by `config.rgb` and guarded so
|
|
146
|
+
* a failing acquisition (e.g. GL context loss during the blit) can never
|
|
147
|
+
* break the sample emission in the XR frame loop.
|
|
148
|
+
*/
|
|
149
|
+
acquireRgbLookupSafely() {
|
|
150
|
+
if (!this.config.rgb || !this.callbacks.acquireRgbLookup) return null;
|
|
151
|
+
try {
|
|
152
|
+
return this.callbacks.acquireRgbLookup();
|
|
153
|
+
} catch {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Sample a grid of depth points from the depth buffer, attaching the
|
|
159
|
+
* camera color per point when a lookup is available.
|
|
110
160
|
*/
|
|
111
|
-
sampleGrid(depthInfo) {
|
|
161
|
+
sampleGrid(depthInfo, rgbLookup) {
|
|
112
162
|
const points = [];
|
|
113
163
|
const gridSize = this.config.gridSize;
|
|
114
164
|
for (let row = 0; row < gridSize; row++) for (let col = 0; col < gridSize; col++) {
|
|
115
165
|
const screenX = (col + 1) / (gridSize + 1);
|
|
116
166
|
const screenY = (row + 1) / (gridSize + 1);
|
|
117
167
|
const depthM = depthInfo.getDepthInMeters(screenX, screenY);
|
|
168
|
+
const rgb = rgbLookup?.(screenX, screenY);
|
|
118
169
|
points.push({
|
|
119
170
|
screenX,
|
|
120
171
|
screenY,
|
|
121
|
-
depthM
|
|
172
|
+
depthM,
|
|
173
|
+
...rgb ? { rgb } : {}
|
|
122
174
|
});
|
|
123
175
|
}
|
|
124
176
|
return points;
|
|
@@ -143,5 +195,8 @@ var DepthSampler = class {
|
|
|
143
195
|
return this.depthReceived;
|
|
144
196
|
}
|
|
145
197
|
};
|
|
198
|
+
function isFinitePositive(value) {
|
|
199
|
+
return typeof value === "number" && Number.isFinite(value) && value > 0;
|
|
200
|
+
}
|
|
146
201
|
//#endregion
|
|
147
|
-
export { DepthSampler };
|
|
202
|
+
export { DepthSampler, wrapXRDepthInfo };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { mat4, quat, vec3, vec4 } from "gl-matrix";
|
|
2
|
+
//#region ../src/ar/depth-unprojection.ts
|
|
3
|
+
/**
|
|
4
|
+
* Depth Unprojection
|
|
5
|
+
*
|
|
6
|
+
* Pure math: turn a persisted depth read (normalized view coordinates +
|
|
7
|
+
* depth in meters) back into a 3D point in raw WebXR (local-floor) space
|
|
8
|
+
* using the capturing view's projection matrix.
|
|
9
|
+
*
|
|
10
|
+
* Convention (single source of truth for NDC flips, see the 2026-06-11
|
|
11
|
+
* occupancy-grid port plan §6):
|
|
12
|
+
* - screenX/screenY are normalized view coordinates with a TOP-LEFT origin
|
|
13
|
+
* (screenY grows downward), exactly as fed to `getDepthInMeters`.
|
|
14
|
+
* - NDC: x = 2·sx − 1, y = 1 − 2·sy (flip Y to bottom-up).
|
|
15
|
+
* - View space is the WebXR camera frame: +x right, +y up, −z forward;
|
|
16
|
+
* `depthM` is the z-depth (distance along −z), not euclidean distance.
|
|
17
|
+
*
|
|
18
|
+
* @see depth-unprojection.ts.md for detailed documentation
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Build a {@link DepthUnprojector} for one depth sample. The projection
|
|
22
|
+
* inverse and camera quaternion/position are sample-invariant, so they are
|
|
23
|
+
* computed once here instead of per point (the per-point hot path then only
|
|
24
|
+
* does the cheap NDC→view→world transform). Callers that fold many points
|
|
25
|
+
* from the same sample — e.g. `OccupancyGrid.addSample` — should build the
|
|
26
|
+
* unprojector once and reuse it for all points.
|
|
27
|
+
*
|
|
28
|
+
* @param cameraPos - camera position, raw WebXR (`DepthSample.cameraPos`)
|
|
29
|
+
* @param cameraRot - camera quaternion [x,y,z,w], raw WebXR (`DepthSample.cameraRot`)
|
|
30
|
+
* @param projectionMatrix - column-major projection matrix of the capturing
|
|
31
|
+
* view (`DepthSample.projectionMatrix`). `undefined` for recordings made
|
|
32
|
+
* before intrinsics capture — those points cannot be unprojected.
|
|
33
|
+
* @returns an unprojector, or `null` when the sample cannot be unprojected at
|
|
34
|
+
* all (missing or singular projection matrix).
|
|
35
|
+
*/
|
|
36
|
+
function createDepthUnprojector(cameraPos, cameraRot, projectionMatrix) {
|
|
37
|
+
if (!projectionMatrix || projectionMatrix.length !== 16) return null;
|
|
38
|
+
const invProj = mat4.invert(mat4.create(), projectionMatrix);
|
|
39
|
+
if (!invProj) return null;
|
|
40
|
+
const cameraQuat = quat.fromValues(cameraRot[0], cameraRot[1], cameraRot[2], cameraRot[3]);
|
|
41
|
+
const cameraPosVec = vec3.fromValues(cameraPos[0], cameraPos[1], cameraPos[2]);
|
|
42
|
+
const ndc = vec4.create();
|
|
43
|
+
const view = vec4.create();
|
|
44
|
+
const viewPoint = vec3.create();
|
|
45
|
+
const world = vec3.create();
|
|
46
|
+
return { unproject(point) {
|
|
47
|
+
if (!isUsablePoint(point)) return null;
|
|
48
|
+
const { screenX, screenY, depthM } = point;
|
|
49
|
+
vec4.set(ndc, 2 * screenX - 1, 1 - 2 * screenY, -1, 1);
|
|
50
|
+
vec4.transformMat4(view, ndc, invProj);
|
|
51
|
+
if (view[3] === 0) return null;
|
|
52
|
+
const rayX = view[0] / view[3];
|
|
53
|
+
const rayY = view[1] / view[3];
|
|
54
|
+
const rayZ = view[2] / view[3];
|
|
55
|
+
if (rayZ >= 0) return null;
|
|
56
|
+
const scale = -depthM / rayZ;
|
|
57
|
+
vec3.set(viewPoint, rayX * scale, rayY * scale, -depthM);
|
|
58
|
+
vec3.transformQuat(world, viewPoint, cameraQuat);
|
|
59
|
+
vec3.add(world, world, cameraPosVec);
|
|
60
|
+
const result = [
|
|
61
|
+
world[0],
|
|
62
|
+
world[1],
|
|
63
|
+
world[2]
|
|
64
|
+
];
|
|
65
|
+
return result.every((v) => Number.isFinite(v)) ? result : null;
|
|
66
|
+
} };
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Unproject a single depth point into raw WebXR space. Convenience wrapper
|
|
70
|
+
* over {@link createDepthUnprojector} for one-off callers; when unprojecting
|
|
71
|
+
* many points from the same sample, build the unprojector once instead.
|
|
72
|
+
*
|
|
73
|
+
* @param point - normalized view coordinates + depth in meters
|
|
74
|
+
* @param cameraPos - camera position, raw WebXR (`DepthSample.cameraPos`)
|
|
75
|
+
* @param cameraRot - camera quaternion [x,y,z,w], raw WebXR (`DepthSample.cameraRot`)
|
|
76
|
+
* @param projectionMatrix - column-major projection matrix of the capturing
|
|
77
|
+
* view (`DepthSample.projectionMatrix`). `undefined` for recordings made
|
|
78
|
+
* before intrinsics capture — those points cannot be unprojected.
|
|
79
|
+
* @returns the 3D point in raw WebXR space, or `null` when the input is not
|
|
80
|
+
* usable (missing/singular matrix, non-positive or non-finite depth,
|
|
81
|
+
* out-of-range screen coordinates).
|
|
82
|
+
*/
|
|
83
|
+
function unprojectDepthPoint(point, cameraPos, cameraRot, projectionMatrix) {
|
|
84
|
+
const unprojector = createDepthUnprojector(cameraPos, cameraRot, projectionMatrix);
|
|
85
|
+
return unprojector ? unprojector.unproject(point) : null;
|
|
86
|
+
}
|
|
87
|
+
function isUsablePoint(point) {
|
|
88
|
+
return Number.isFinite(point.depthM) && point.depthM > 0 && isInUnitRange(point.screenX) && isInUnitRange(point.screenY);
|
|
89
|
+
}
|
|
90
|
+
function isInUnitRange(v) {
|
|
91
|
+
return Number.isFinite(v) && v >= 0 && v <= 1;
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
export { createDepthUnprojector, unprojectDepthPoint };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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-
|
|
1
|
+
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-BfUJOgpW.js";
|
|
2
2
|
export { EnableGpsArConfig, EnableGpsArController, EnableGpsArDeps, EnableGpsArResult, EnableGpsArState, EnableGpsArStatus, createEnableGpsArController };
|
package/dist/ar/enable-gps-ar.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger.js";
|
|
2
2
|
import { requestGeolocationPermission, requestOrientationPermission, requestWebXRWithDepthPermission } from "../sensors/permission-checker.js";
|
|
3
3
|
import { startGpsWatch, startOrientationWatch, stopGpsWatch, stopOrientationWatch } from "../sensors/gps.js";
|
|
4
|
-
import {
|
|
4
|
+
import { _ as isWebXRSupported, g as initAR, i as endARSession } from "../webxr-session-TIaD883f.js";
|
|
5
5
|
//#region ../src/ar/enable-gps-ar.ts
|
|
6
6
|
const log = createLogger("EnableGpsAr");
|
|
7
7
|
const defaultDeps = {
|
package/dist/ar/frame-loop.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as runFrameUpdates, n as clearFrameUpdates, r as registerFrameUpdate, t as FrameUpdate } from "../frame-loop-
|
|
1
|
+
import { i as runFrameUpdates, n as clearFrameUpdates, r as registerFrameUpdate, t as FrameUpdate } from "../frame-loop-CMewS8cY.js";
|
|
2
2
|
export { FrameUpdate, clearFrameUpdates, registerFrameUpdate, runFrameUpdates };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { CapturedImage, DEFAULT_CAPTURE_CONFIG, ImageCaptureCallbacks, ImageCaptureConfig, ImageCaptureManager, MIN_VALID_IMAGE_BYTES };
|
|
1
|
+
import { a as ImageCaptureConfig, i as ImageCaptureCallbacks, n as CapturedImage, o as ImageCaptureManager, r as DEFAULT_CAPTURE_CONFIG, s as MIN_VALID_IMAGE_BYTES, t as CapturedFrame } from "../image-capture-qAZ5Fh5X.js";
|
|
2
|
+
export { CapturedFrame, CapturedImage, DEFAULT_CAPTURE_CONFIG, ImageCaptureCallbacks, ImageCaptureConfig, ImageCaptureManager, MIN_VALID_IMAGE_BYTES };
|
package/dist/ar/image-capture.js
CHANGED
|
@@ -23,7 +23,8 @@ const MIN_VALID_IMAGE_BYTES = 5e3;
|
|
|
23
23
|
const DEFAULT_CAPTURE_CONFIG = {
|
|
24
24
|
intervalMs: 2e3,
|
|
25
25
|
quality: .7,
|
|
26
|
-
captureTimeoutMs: 5e3
|
|
26
|
+
captureTimeoutMs: 5e3,
|
|
27
|
+
resolutionDivisor: 1
|
|
27
28
|
};
|
|
28
29
|
/**
|
|
29
30
|
* Manages periodic image capture from a canvas.
|
|
@@ -102,15 +103,15 @@ var ImageCaptureManager = class {
|
|
|
102
103
|
this.captureTimeoutId = null;
|
|
103
104
|
}
|
|
104
105
|
}, this.config.captureTimeoutMs);
|
|
105
|
-
if (this.callbacks.captureFrame) this.callbacks.captureFrame(this.config.quality).then((
|
|
106
|
-
this.handleCapturedBlob(blob, timestamp, frameIndex, pose, screenRotation);
|
|
106
|
+
if (this.callbacks.captureFrame) this.callbacks.captureFrame(this.config.quality).then((frame) => {
|
|
107
|
+
this.handleCapturedBlob(frame?.blob ?? null, frame?.width, frame?.height, timestamp, frameIndex, pose, screenRotation);
|
|
107
108
|
}).catch(() => {
|
|
108
109
|
this.clearCaptureTimeout();
|
|
109
110
|
this.captureInProgress = false;
|
|
110
111
|
this.callbacks.onCaptureFailed?.();
|
|
111
112
|
});
|
|
112
113
|
else this.canvas.toBlob((blob) => {
|
|
113
|
-
this.handleCapturedBlob(blob, timestamp, frameIndex, pose, screenRotation);
|
|
114
|
+
this.handleCapturedBlob(blob, this.canvas.width, this.canvas.height, timestamp, frameIndex, pose, screenRotation);
|
|
114
115
|
}, "image/jpeg", this.config.quality);
|
|
115
116
|
}
|
|
116
117
|
/**
|
|
@@ -127,7 +128,7 @@ var ImageCaptureManager = class {
|
|
|
127
128
|
* Common handler for captured blobs (from either canvas.toBlob or captureFrame).
|
|
128
129
|
* Handles null blobs, suspicious image detection, and dispatching onCaptured.
|
|
129
130
|
*/
|
|
130
|
-
handleCapturedBlob(blob, timestamp, frameIndex, pose, screenRotation) {
|
|
131
|
+
handleCapturedBlob(blob, width, height, timestamp, frameIndex, pose, screenRotation) {
|
|
131
132
|
this.clearCaptureTimeout();
|
|
132
133
|
this.captureInProgress = false;
|
|
133
134
|
if (!blob) {
|
|
@@ -144,7 +145,9 @@ var ImageCaptureManager = class {
|
|
|
144
145
|
frameIndex,
|
|
145
146
|
position: pose.position,
|
|
146
147
|
rotation: pose.orientation,
|
|
147
|
-
screenRotation
|
|
148
|
+
screenRotation,
|
|
149
|
+
...width && width > 0 ? { width } : {},
|
|
150
|
+
...height && height > 0 ? { height } : {}
|
|
148
151
|
});
|
|
149
152
|
}
|
|
150
153
|
};
|
package/dist/ar/index.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as
|
|
3
|
-
import {
|
|
4
|
-
import { a as
|
|
5
|
-
import { i as
|
|
6
|
-
import { a as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { i as
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { n as
|
|
16
|
-
|
|
1
|
+
import { r as bresenham3d, t as GridCell } from "../bresenham3d-CFfd7n6B.js";
|
|
2
|
+
import { i as computeCaptureSize, n as CameraBlitCaptureConfig, r as DEFAULT_BLIT_CONFIG, t as CameraBlitCapture } from "../camera-blit-capture-CnxUDbKx.js";
|
|
3
|
+
import { i as isFullySupported, n as CapabilitySupport, r as capabilityMessage, t as CapabilityMessageOptions } from "../capability-checker-CQXJHxXg.js";
|
|
4
|
+
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-CUeU3L_M.js";
|
|
5
|
+
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-Jqbn0apH.js";
|
|
6
|
+
import { a as wrapXRDepthInfo, i as DepthSamplerConfig, n as DepthSampler, r as DepthSamplerCallbacks, t as DepthInfo } from "../depth-sampler-Bhanfwla.js";
|
|
7
|
+
import { n as createDepthUnprojector, r as unprojectDepthPoint, t as DepthUnprojector } from "../depth-unprojection-Y6i_mJuT.js";
|
|
8
|
+
import { a as ImageCaptureConfig, i as ImageCaptureCallbacks, n as CapturedImage, o as ImageCaptureManager, r as DEFAULT_CAPTURE_CONFIG, s as MIN_VALID_IMAGE_BYTES } from "../image-capture-qAZ5Fh5X.js";
|
|
9
|
+
import { i as acquireCameraTexture, n as RendererLike, r as XRCameraLike, t as CameraTextureResult } from "../xr-camera-texture-DBwCaKTd.js";
|
|
10
|
+
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-GjZ2BIpS.js";
|
|
11
|
+
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-BfUJOgpW.js";
|
|
12
|
+
import { r as registerFrameUpdate, t as FrameUpdate } from "../frame-loop-CMewS8cY.js";
|
|
13
|
+
import { n as OccupancyGridOptions, t as OccupancyGrid } from "../occupancy-grid-BRNRaPyT.js";
|
|
14
|
+
import { i as registerXrFrameUpdate, n as XrFrameUpdate, t as XrFrameContext } from "../xr-frame-loop-BtYytZJg.js";
|
|
15
|
+
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-Bw58VL6p.js";
|
|
16
|
+
import { t as SCENE_NODE } from "../scene-node-names-Bu0S66H1.js";
|
|
17
|
+
import { t as WEBXR_TO_NUE } from "../webxr-nue-basis-CqKQmZzT.js";
|
|
18
|
+
import { n as XR_ERROR_MESSAGE_UNKNOWN, r as getXrErrorMessage, t as XR_ERROR_MESSAGES } from "../xr-error-handler-C0AQRmxs.js";
|
|
19
|
+
export { BASELAYER_WINDOW_MAX, BASELAYER_WINDOW_MIN, CAPTURE_FAILURE_WARNING, CameraBlitCapture, type CameraBlitCaptureConfig, type CameraMode, type CameraTextureResult, type CapabilityMessageOptions, type CapabilitySupport, type CaptureFailureTracker, type CaptureFailureTrackerConfig, type CapturedImage, type ChromeVersion, type ChromiumProjectionLayerWorkaroundResult, DEFAULT_BLIT_CONFIG, DEFAULT_CAPTURE_CONFIG, DEFAULT_CAPTURE_TRACKER_CONFIG, type DepthInfo, DepthSampler, type DepthSamplerCallbacks, type DepthSamplerConfig, type DepthUnprojector, type EnableGpsArConfig, type EnableGpsArController, type EnableGpsArDeps, type EnableGpsArResult, type EnableGpsArState, type EnableGpsArStatus, type FrameUpdate, type GridCell, type ImageCaptureCallbacks, type ImageCaptureConfig, ImageCaptureManager, MIN_VALID_IMAGE_BYTES, OccupancyGrid, type OccupancyGridOptions, type RendererLike, type ReplaySceneState, SCENE_NODE, type SessionFeatureOptions, WEBXR_TO_NUE, type XRCameraLike, XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, type XrFrameContext, type XrFrameUpdate, acquireCameraTexture, applyChromiumProjectionLayerWorkaround, bresenham3d, capabilityMessage, computeCaptureSize, createCaptureFailureTracker, createDepthUnprojector, 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, unprojectDepthPoint, updateOrbitTarget, wrapXRDepthInfo };
|
package/dist/ar/index.js
CHANGED
|
@@ -2,15 +2,18 @@ import { CameraBlitCapture, DEFAULT_BLIT_CONFIG, computeCaptureSize } from "./ca
|
|
|
2
2
|
import { capabilityMessage, isFullySupported } from "./capability-checker.js";
|
|
3
3
|
import { BASELAYER_WINDOW_MAX, BASELAYER_WINDOW_MIN, applyChromiumProjectionLayerWorkaround, needsBaseLayerPersistence, parseChromeVersion } from "./chromium-camera-access-workaround.js";
|
|
4
4
|
import { CAPTURE_FAILURE_WARNING, DEFAULT_CAPTURE_TRACKER_CONFIG, createCaptureFailureTracker } from "./capture-failure-tracker.js";
|
|
5
|
-
import { DepthSampler } from "./depth-sampler.js";
|
|
5
|
+
import { DepthSampler, wrapXRDepthInfo } from "./depth-sampler.js";
|
|
6
|
+
import { createDepthUnprojector, unprojectDepthPoint } from "./depth-unprojection.js";
|
|
7
|
+
import { bresenham3d } from "./bresenham3d.js";
|
|
8
|
+
import { OccupancyGrid } from "./occupancy-grid.js";
|
|
6
9
|
import { registerFrameUpdate } from "./frame-loop.js";
|
|
7
10
|
import { registerXrFrameUpdate } from "./xr-frame-loop.js";
|
|
8
|
-
import {
|
|
11
|
+
import { WEBXR_TO_NUE } from "./webxr-nue-basis.js";
|
|
9
12
|
import { DEFAULT_CAPTURE_CONFIG, ImageCaptureManager, MIN_VALID_IMAGE_BYTES } from "./image-capture.js";
|
|
13
|
+
import { A as setTrackingLostCallback, D as setImageCaptureCallback, E as setFrameCallback, F as startImageCapture, I as stopDepthCapture, L as stopImageCapture, M as setTrackingStore, P as startDepthCapture, T as setDepthCaptureCallback, c as getArWorldGroup, d as getDepthSampleCount, f as getImageCaptureFrameCount, g as initAR, i as endARSession, k as setTrackingCallbacks, l as getCamera, m as getScene, p as getLiveCss3dManager, u as getCurrentArPose } from "../webxr-session-TIaD883f.js";
|
|
10
14
|
import { acquireCameraTexture } from "./xr-camera-texture.js";
|
|
11
15
|
import { SCENE_NODE } from "./scene-node-names.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
16
|
import { createEnableGpsArController } from "./enable-gps-ar.js";
|
|
14
17
|
import { disposeReplayScene, getAlignmentLerper, getCameraFollower, getCameraMode, getReplayState, initReplayScene, toggleCameraMode, updateOrbitTarget } from "./replay-scene.js";
|
|
15
18
|
import { XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, getXrErrorMessage } from "./xr-error-handler.js";
|
|
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 };
|
|
19
|
+
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, OccupancyGrid, SCENE_NODE, WEBXR_TO_NUE, XR_ERROR_MESSAGES, XR_ERROR_MESSAGE_UNKNOWN, acquireCameraTexture, applyChromiumProjectionLayerWorkaround, bresenham3d, capabilityMessage, computeCaptureSize, createCaptureFailureTracker, createDepthUnprojector, 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, unprojectDepthPoint, updateOrbitTarget, wrapXRDepthInfo };
|