@zappar/zappar-cv 3.8.0-beta.2 → 3.8.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 +2 -2
- package/lib/permission.js +3 -1
- package/lib/src/version.d.ts +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/webxr-camera-source.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,8 +18,8 @@ npm i @zappar/zappar-cv
|
|
|
18
18
|
|
|
19
19
|
You can use our CDN from within your HTML:
|
|
20
20
|
```
|
|
21
|
-
<script src="https://libs.zappar.com/zappar-cv/3.8.0
|
|
21
|
+
<script src="https://libs.zappar.com/zappar-cv/3.8.0/zappar-cv.js"></script>
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
Or you can download and host our standalone JavaScript bundle:
|
|
25
|
-
[https://libs.zappar.com/zappar-cv/3.8.0
|
|
25
|
+
[https://libs.zappar.com/zappar-cv/3.8.0/zappar-cv.zip](https://libs.zappar.com/zappar-cv/3.8.0/zappar-cv.zip)
|
package/lib/permission.js
CHANGED
|
@@ -16,6 +16,7 @@ let _permissionGrantedCamera = false;
|
|
|
16
16
|
let _permissionGrantedMotion = false;
|
|
17
17
|
let _permissionDeniedCamera = false;
|
|
18
18
|
let _permissionDeniedMotion = false;
|
|
19
|
+
let _hadOneSuccessfulActivation = false;
|
|
19
20
|
if (!window.DeviceOrientationEvent || !window.DeviceOrientationEvent.requestPermission) {
|
|
20
21
|
_permissionGrantedMotion = true;
|
|
21
22
|
}
|
|
@@ -166,6 +167,7 @@ export function permissionRequestUI(options) {
|
|
|
166
167
|
return false;
|
|
167
168
|
}
|
|
168
169
|
if (permissionGrantedAll()) {
|
|
170
|
+
_hadOneSuccessfulActivation = true;
|
|
169
171
|
return true;
|
|
170
172
|
}
|
|
171
173
|
}
|
|
@@ -173,7 +175,7 @@ export function permissionRequestUI(options) {
|
|
|
173
175
|
});
|
|
174
176
|
}
|
|
175
177
|
try {
|
|
176
|
-
if (_isWebXRSupported && !((_d = navigator.userActivation) === null || _d === void 0 ? void 0 : _d.isActive))
|
|
178
|
+
if (_isWebXRSupported && (!((_d = navigator.userActivation) === null || _d === void 0 ? void 0 : _d.isActive) || _hadOneSuccessfulActivation))
|
|
177
179
|
throw new Error("WebXR - need user interaction");
|
|
178
180
|
return yield attempt();
|
|
179
181
|
}
|
package/lib/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "3.8.0
|
|
1
|
+
export declare const VERSION = "3.8.0";
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "3.8.0
|
|
1
|
+
export declare const VERSION = "3.8.0";
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "3.8.0
|
|
1
|
+
export const VERSION = "3.8.0";
|
|
@@ -445,8 +445,11 @@ export class WebXRCameraSource extends Source {
|
|
|
445
445
|
this._xrSession = session;
|
|
446
446
|
this._xrLocalSpace = refSpace;
|
|
447
447
|
this._xrGlBinding = new XRWebGLBinding(session, this._offscreenContext);
|
|
448
|
+
// Create a reference space that is a ray pointing down [0, -0.3] in normalized device coordinates
|
|
449
|
+
const offsetRay = new XRRay(new DOMPointReadOnly(0, 0, 0), { x: 0, y: -0.3, z: -1, w: 0 });
|
|
448
450
|
(_c = (_b = session.requestHitTestSource) === null || _b === void 0 ? void 0 : _b.call(session, {
|
|
449
451
|
space: this._xrViewerSpace,
|
|
452
|
+
offsetRay: offsetRay,
|
|
450
453
|
entityTypes: ['plane']
|
|
451
454
|
})) === null || _c === void 0 ? void 0 : _c.then((hitTestSource) => {
|
|
452
455
|
this._planeHitTestSource = hitTestSource;
|
package/package.json
CHANGED