locar 0.0.6 → 0.0.8
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 +1 -1
- package/dist/locar.es.js +268 -120
- package/dist/locar.umd.js +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/locar.es.js
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
var
|
|
2
|
-
throw TypeError(
|
|
1
|
+
var j = (r) => {
|
|
2
|
+
throw TypeError(r);
|
|
3
3
|
};
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
set _(
|
|
8
|
-
r
|
|
4
|
+
var F = (r, t, e) => t.has(r) || j("Cannot " + e);
|
|
5
|
+
var n = (r, t, e) => (F(r, t, "read from private field"), e ? e.call(r) : t.get(r)), m = (r, t, e) => t.has(r) ? j("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r) : t.set(r, e), d = (r, t, e, i) => (F(r, t, "write to private field"), i ? i.call(r, e) : t.set(r, e), e), v = (r, t, e) => (F(r, t, "access private method"), e);
|
|
6
|
+
var q = (r, t, e, i) => ({
|
|
7
|
+
set _(o) {
|
|
8
|
+
d(r, t, o, e);
|
|
9
9
|
},
|
|
10
10
|
get _() {
|
|
11
|
-
return
|
|
11
|
+
return n(r, t, i);
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
import * as
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
import * as f from "three";
|
|
15
|
+
import { Vector3 as Z, Euler as N, Quaternion as _, EventDispatcher as B, MathUtils as D } from "three";
|
|
16
|
+
var P, U, G, X, Q;
|
|
17
|
+
class K {
|
|
17
18
|
/**
|
|
18
19
|
* Create a SphMercProjection.
|
|
19
20
|
*/
|
|
20
21
|
constructor() {
|
|
21
|
-
|
|
22
|
+
m(this, P);
|
|
22
23
|
this.EARTH = 4007501668e-2, this.HALF_EARTH = 2003750834e-2;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
@@ -28,7 +29,7 @@ class N {
|
|
|
28
29
|
* @return {Array} Two-member array containing easting and northing.
|
|
29
30
|
*/
|
|
30
31
|
project(t, e) {
|
|
31
|
-
return [
|
|
32
|
+
return [v(this, P, U).call(this, t), v(this, P, G).call(this, e)];
|
|
32
33
|
}
|
|
33
34
|
/**
|
|
34
35
|
* Unproject a Spherical Mercator easting and northing.
|
|
@@ -36,7 +37,7 @@ class N {
|
|
|
36
37
|
* @return {Array} Two-member array containing longitude and latitude
|
|
37
38
|
*/
|
|
38
39
|
unproject(t) {
|
|
39
|
-
return [
|
|
40
|
+
return [v(this, P, X).call(this, t[0]), v(this, P, Q).call(this, t[1])];
|
|
40
41
|
}
|
|
41
42
|
/**
|
|
42
43
|
* Return the projection's ID.
|
|
@@ -46,19 +47,19 @@ class N {
|
|
|
46
47
|
return "epsg:3857";
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
|
|
50
|
+
P = new WeakSet(), U = function(t) {
|
|
50
51
|
return t / 180 * this.HALF_EARTH;
|
|
51
|
-
},
|
|
52
|
+
}, G = function(t) {
|
|
52
53
|
var e = Math.log(Math.tan((90 + t) * Math.PI / 360)) / (Math.PI / 180);
|
|
53
54
|
return e * this.HALF_EARTH / 180;
|
|
54
|
-
},
|
|
55
|
+
}, X = function(t) {
|
|
55
56
|
return t / this.HALF_EARTH * 180;
|
|
56
|
-
},
|
|
57
|
+
}, Q = function(t) {
|
|
57
58
|
var e = t / this.HALF_EARTH * 180;
|
|
58
59
|
return e = 180 / Math.PI * (2 * Math.atan(Math.exp(e * Math.PI / 180)) - Math.PI / 2), e;
|
|
59
60
|
};
|
|
60
|
-
var
|
|
61
|
-
class
|
|
61
|
+
var R, A, T, x, L, C, E, I, b, O, p, S, V, W, Y;
|
|
62
|
+
class st {
|
|
62
63
|
/**
|
|
63
64
|
* @param {THREE.Scene} scene - The Three.js scene to use.
|
|
64
65
|
* @param {THREE.Camera} camera - The Three.js camera to use. Should usually
|
|
@@ -67,19 +68,19 @@ class Y {
|
|
|
67
68
|
* setGpsOptions() below.
|
|
68
69
|
* @param {Object} serverLogger - an object which can optionally log GPS position to a server for debugging. null by default, so no logging will be done. This object should implement a sendData() method to send data (2nd arg) to a given endpoint (1st arg). Please see source code for details. Ensure you comply with privacy laws (GDPR or equivalent) if implementing this.
|
|
69
70
|
*/
|
|
70
|
-
constructor(t, e,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
this.scene = t, this.camera = e,
|
|
71
|
+
constructor(t, e, i = {}, o = null) {
|
|
72
|
+
m(this, p);
|
|
73
|
+
m(this, R);
|
|
74
|
+
m(this, A);
|
|
75
|
+
m(this, T);
|
|
76
|
+
m(this, x);
|
|
77
|
+
m(this, L);
|
|
78
|
+
m(this, C);
|
|
79
|
+
m(this, E);
|
|
80
|
+
m(this, I);
|
|
81
|
+
m(this, b);
|
|
82
|
+
m(this, O);
|
|
83
|
+
this.scene = t, this.camera = e, d(this, R, new K()), d(this, A, {}), d(this, T, null), d(this, x, 0), d(this, L, 100), d(this, C, null), this.setGpsOptions(i), d(this, E, null), d(this, I, 0), d(this, b, 0), d(this, O, o);
|
|
83
84
|
}
|
|
84
85
|
/**
|
|
85
86
|
* Set the projection to use.
|
|
@@ -88,7 +89,7 @@ class Y {
|
|
|
88
89
|
* containing easting and northing.
|
|
89
90
|
*/
|
|
90
91
|
setProjection(t) {
|
|
91
|
-
|
|
92
|
+
d(this, R, t);
|
|
92
93
|
}
|
|
93
94
|
/**
|
|
94
95
|
* Set the GPS options.
|
|
@@ -98,7 +99,7 @@ class Y {
|
|
|
98
99
|
* minimum accuracy, in metres, for a GPS reading to be counted.
|
|
99
100
|
*/
|
|
100
101
|
setGpsOptions(t = {}) {
|
|
101
|
-
t.gpsMinDistance !== void 0 &&
|
|
102
|
+
t.gpsMinDistance !== void 0 && d(this, x, t.gpsMinDistance), t.gpsMinAccuracy !== void 0 && d(this, L, t.gpsMinAccuracy);
|
|
102
103
|
}
|
|
103
104
|
/**
|
|
104
105
|
* Start the GPS on a real device
|
|
@@ -106,19 +107,19 @@ class Y {
|
|
|
106
107
|
* GPS errors can be handled by handling the gpserror event.
|
|
107
108
|
*/
|
|
108
109
|
async startGps() {
|
|
109
|
-
if (
|
|
110
|
-
const e = await (await
|
|
111
|
-
gpsMinDistance:
|
|
112
|
-
gpsMinAccuracy:
|
|
110
|
+
if (n(this, O)) {
|
|
111
|
+
const e = await (await n(this, O).sendData("/gps/start", {
|
|
112
|
+
gpsMinDistance: n(this, x),
|
|
113
|
+
gpsMinAccuracy: n(this, L)
|
|
113
114
|
})).json();
|
|
114
|
-
|
|
115
|
+
d(this, b, e.session);
|
|
115
116
|
}
|
|
116
|
-
return
|
|
117
|
+
return n(this, C) === null ? (d(this, C, navigator.geolocation.watchPosition(
|
|
117
118
|
(t) => {
|
|
118
|
-
|
|
119
|
+
v(this, p, W).call(this, t);
|
|
119
120
|
},
|
|
120
121
|
(t) => {
|
|
121
|
-
|
|
122
|
+
n(this, A).gpserror ? n(this, A).gpserror(t.code) : alert(`GPS error: code ${t.code}`);
|
|
122
123
|
},
|
|
123
124
|
{
|
|
124
125
|
enableHighAccuracy: !0
|
|
@@ -131,7 +132,7 @@ class Y {
|
|
|
131
132
|
* stopped (i.e. it was never started).
|
|
132
133
|
*/
|
|
133
134
|
stopGps() {
|
|
134
|
-
return
|
|
135
|
+
return n(this, C) !== null ? (navigator.geolocation.clearWatch(n(this, C)), d(this, C, null), !0) : !1;
|
|
135
136
|
}
|
|
136
137
|
/**
|
|
137
138
|
* Send a fake GPS signal. Useful for testing on a desktop or laptop.
|
|
@@ -142,12 +143,12 @@ class Y {
|
|
|
142
143
|
* @param {number} acc - The accuracy of the GPS reading in metres. May be
|
|
143
144
|
* ignored if lower than the specified minimum accuracy.
|
|
144
145
|
*/
|
|
145
|
-
fakeGps(t, e,
|
|
146
|
-
|
|
146
|
+
fakeGps(t, e, i = null, o = 0) {
|
|
147
|
+
i !== null && this.setElevation(i), v(this, p, W).call(this, {
|
|
147
148
|
coords: {
|
|
148
149
|
longitude: t,
|
|
149
150
|
latitude: e,
|
|
150
|
-
accuracy:
|
|
151
|
+
accuracy: o
|
|
151
152
|
}
|
|
152
153
|
});
|
|
153
154
|
}
|
|
@@ -162,12 +163,12 @@ class Y {
|
|
|
162
163
|
* @return {Array} a two member array containing the WebGL x and z coordinates
|
|
163
164
|
*/
|
|
164
165
|
lonLatToWorldCoords(t, e) {
|
|
165
|
-
const
|
|
166
|
-
if (
|
|
167
|
-
|
|
166
|
+
const i = n(this, R).project(t, e);
|
|
167
|
+
if (n(this, E))
|
|
168
|
+
i[0] -= n(this, E)[0], i[1] -= n(this, E)[1];
|
|
168
169
|
else
|
|
169
170
|
throw "No initial position determined";
|
|
170
|
-
return [
|
|
171
|
+
return [i[0], -i[1]];
|
|
171
172
|
}
|
|
172
173
|
/**
|
|
173
174
|
* Add a new AR object at a given latitude, longitude and elevation.
|
|
@@ -179,14 +180,14 @@ class Y {
|
|
|
179
180
|
* @param {Object} properties - properties describing the object (for example,
|
|
180
181
|
* the contents of the GeoJSON properties field).
|
|
181
182
|
*/
|
|
182
|
-
add(t, e,
|
|
183
|
+
add(t, e, i, o, u = {}) {
|
|
183
184
|
var g;
|
|
184
|
-
t.properties =
|
|
185
|
+
t.properties = u, v(this, p, S).call(this, t, e, i, o), this.scene.add(t), (g = n(this, O)) == null || g.sendData("/object/new", {
|
|
185
186
|
position: t.position,
|
|
186
187
|
x: t.position.x,
|
|
187
188
|
z: t.position.z,
|
|
188
|
-
session:
|
|
189
|
-
properties:
|
|
189
|
+
session: n(this, b),
|
|
190
|
+
properties: u
|
|
190
191
|
});
|
|
191
192
|
}
|
|
192
193
|
/**
|
|
@@ -210,49 +211,49 @@ class Y {
|
|
|
210
211
|
* @listens LocationBased#gpserror
|
|
211
212
|
*/
|
|
212
213
|
on(t, e) {
|
|
213
|
-
|
|
214
|
+
n(this, A)[t] = e;
|
|
214
215
|
}
|
|
215
216
|
}
|
|
216
|
-
|
|
217
|
-
const
|
|
218
|
-
|
|
219
|
-
},
|
|
220
|
-
|
|
221
|
-
},
|
|
222
|
-
var
|
|
217
|
+
R = new WeakMap(), A = new WeakMap(), T = new WeakMap(), x = new WeakMap(), L = new WeakMap(), C = new WeakMap(), E = new WeakMap(), I = new WeakMap(), b = new WeakMap(), O = new WeakMap(), p = new WeakSet(), S = function(t, e, i, o) {
|
|
218
|
+
const u = this.lonLatToWorldCoords(e, i);
|
|
219
|
+
o !== void 0 && (t.position.y = o), [t.position.x, t.position.z] = u;
|
|
220
|
+
}, V = function(t, e) {
|
|
221
|
+
d(this, E, n(this, R).project(t, e));
|
|
222
|
+
}, W = function(t) {
|
|
223
|
+
var i, o, u;
|
|
223
224
|
let e = Number.MAX_VALUE;
|
|
224
|
-
|
|
225
|
-
gpsCount:
|
|
225
|
+
q(this, I)._++, (i = n(this, O)) == null || i.sendData("/gps/new", {
|
|
226
|
+
gpsCount: n(this, I),
|
|
226
227
|
lat: t.coords.latitude,
|
|
227
228
|
lon: t.coords.longitude,
|
|
228
229
|
acc: t.coords.accuracy,
|
|
229
|
-
session:
|
|
230
|
-
}), t.coords.accuracy <=
|
|
230
|
+
session: n(this, b)
|
|
231
|
+
}), t.coords.accuracy <= n(this, L) && (n(this, T) === null ? d(this, T, {
|
|
231
232
|
latitude: t.coords.latitude,
|
|
232
233
|
longitude: t.coords.longitude
|
|
233
|
-
}) : e =
|
|
234
|
-
gpsCount:
|
|
234
|
+
}) : e = v(this, p, Y).call(this, n(this, T), t.coords), e >= n(this, x) && (n(this, T).longitude = t.coords.longitude, n(this, T).latitude = t.coords.latitude, n(this, E) || (v(this, p, V).call(this, t.coords.longitude, t.coords.latitude), (o = n(this, O)) == null || o.sendData("/worldorigin/new", {
|
|
235
|
+
gpsCount: n(this, I),
|
|
235
236
|
lat: t.coords.latitude,
|
|
236
237
|
lon: t.coords.longitude,
|
|
237
|
-
session:
|
|
238
|
-
initialPosition:
|
|
239
|
-
})),
|
|
240
|
-
gpsCount:
|
|
238
|
+
session: n(this, b),
|
|
239
|
+
initialPosition: n(this, E)
|
|
240
|
+
})), v(this, p, S).call(this, this.camera, t.coords.longitude, t.coords.latitude), (u = n(this, O)) == null || u.sendData("/gps/accepted", {
|
|
241
|
+
gpsCount: n(this, I),
|
|
241
242
|
cameraX: this.camera.position.x,
|
|
242
243
|
cameraZ: this.camera.position.z,
|
|
243
|
-
session:
|
|
244
|
+
session: n(this, b),
|
|
244
245
|
distMoved: e
|
|
245
|
-
}),
|
|
246
|
+
}), n(this, A).gpsupdate && n(this, A).gpsupdate(t, e)));
|
|
246
247
|
}, /**
|
|
247
248
|
* Calculate haversine distance between two lat/lon pairs.
|
|
248
249
|
*
|
|
249
250
|
* Taken from original A-Frame AR.js location-based components
|
|
250
251
|
*/
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
return 2 * Math.atan2(Math.sqrt(
|
|
252
|
+
Y = function(t, e) {
|
|
253
|
+
const i = f.MathUtils.degToRad(e.longitude - t.longitude), o = f.MathUtils.degToRad(e.latitude - t.latitude), u = Math.sin(o / 2) * Math.sin(o / 2) + Math.cos(f.MathUtils.degToRad(t.latitude)) * Math.cos(f.MathUtils.degToRad(e.latitude)) * (Math.sin(i / 2) * Math.sin(i / 2));
|
|
254
|
+
return 2 * Math.atan2(Math.sqrt(u), Math.sqrt(1 - u)) * 6371e3;
|
|
254
255
|
};
|
|
255
|
-
class
|
|
256
|
+
class ot {
|
|
256
257
|
/**
|
|
257
258
|
* Create a WebcamRenderer.
|
|
258
259
|
* @param {THREE.WebGLRenderer} renderer - the Three.js renderer.
|
|
@@ -262,12 +263,12 @@ class Z {
|
|
|
262
263
|
* @options {Object} - options to use for initialising the camera. Currently
|
|
263
264
|
* width and height properties are understood.
|
|
264
265
|
*/
|
|
265
|
-
constructor(t, e,
|
|
266
|
-
this.renderer = t, this.renderer.autoClear = !1, this.sceneWebcam = new
|
|
267
|
-
let
|
|
268
|
-
e ?
|
|
269
|
-
const
|
|
270
|
-
if (this.sceneWebcam.add(
|
|
266
|
+
constructor(t, e, i) {
|
|
267
|
+
this.renderer = t, this.renderer.autoClear = !1, this.sceneWebcam = new f.Scene();
|
|
268
|
+
let o;
|
|
269
|
+
e ? o = document.querySelector(e) : (o = document.createElement("video"), o.setAttribute("autoplay", !0), o.setAttribute("playsinline", !0), o.style.display = "none", document.body.appendChild(o)), this.geom = new f.PlaneGeometry(), this.texture = new f.VideoTexture(o), this.material = new f.MeshBasicMaterial({ map: this.texture });
|
|
270
|
+
const u = new f.Mesh(this.geom, this.material);
|
|
271
|
+
if (this.sceneWebcam.add(u), this.cameraWebcam = new f.OrthographicCamera(
|
|
271
272
|
-0.5,
|
|
272
273
|
0.5,
|
|
273
274
|
0.5,
|
|
@@ -277,19 +278,19 @@ class Z {
|
|
|
277
278
|
), navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
|
|
278
279
|
const g = {
|
|
279
280
|
video: {
|
|
280
|
-
width: (
|
|
281
|
-
height: (
|
|
281
|
+
width: (i == null ? void 0 : i.width) || 1280,
|
|
282
|
+
height: (i == null ? void 0 : i.height) || 720,
|
|
282
283
|
facingMode: "environment"
|
|
283
284
|
}
|
|
284
285
|
};
|
|
285
|
-
navigator.mediaDevices.getUserMedia(g).then((
|
|
286
|
-
console.log("using the webcam successfully..."),
|
|
287
|
-
}).catch((
|
|
286
|
+
navigator.mediaDevices.getUserMedia(g).then((w) => {
|
|
287
|
+
console.log("using the webcam successfully..."), o.srcObject = w, o.play();
|
|
288
|
+
}).catch((w) => {
|
|
288
289
|
setTimeout(() => {
|
|
289
290
|
alert(
|
|
290
291
|
`Webcam Error
|
|
291
|
-
Name: ` +
|
|
292
|
-
Message: ` +
|
|
292
|
+
Name: ` + w.name + `
|
|
293
|
+
Message: ` + w.message
|
|
293
294
|
);
|
|
294
295
|
}, 1e3);
|
|
295
296
|
});
|
|
@@ -313,52 +314,199 @@ Message: ` + T.message
|
|
|
313
314
|
this.material.dispose(), this.texture.dispose(), this.geom.dispose();
|
|
314
315
|
}
|
|
315
316
|
}
|
|
316
|
-
const
|
|
317
|
-
class
|
|
317
|
+
const k = navigator.userAgent.match(/iPhone|iPad|iPod/i) || /Macintosh/i.test(navigator.userAgent) && navigator.maxTouchPoints != null && navigator.maxTouchPoints > 1, $ = new Z(0, 0, 1), z = new N(), J = new _(), tt = new _(-Math.sqrt(0.5), 0, 0, Math.sqrt(0.5)), et = { type: "change" };
|
|
318
|
+
class at extends B {
|
|
318
319
|
/**
|
|
319
320
|
* Create an instance of DeviceOrientationControls.
|
|
320
321
|
* @param {Object} object - the object to attach the controls to
|
|
321
322
|
* (usually your Three.js camera)
|
|
322
323
|
*/
|
|
323
324
|
constructor(t) {
|
|
324
|
-
super(), window.isSecureContext === !1 && console.error(
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
const
|
|
328
|
-
|
|
325
|
+
super(), window.isSecureContext === !1 && console.error(
|
|
326
|
+
"THREE.DeviceOrientationControls: DeviceOrientationEvent is only available in secure contexts (https)"
|
|
327
|
+
);
|
|
328
|
+
const e = this, i = 1e-6, o = new _();
|
|
329
|
+
this.object = t, this.object.rotation.reorder("YXZ"), this.enabled = !0, this.deviceOrientation = null, this.screenOrientation = 0, this.alphaOffset = 0, this.initialOffset = null, this.TWO_PI = 2 * Math.PI, this.HALF_PI = 0.5 * Math.PI, this.orientationChangeEventName = "ondeviceorientationabsolute" in window ? "deviceorientationabsolute" : "deviceorientation", this.smoothingFactor = 1;
|
|
330
|
+
const u = function({
|
|
331
|
+
alpha: s,
|
|
332
|
+
beta: c,
|
|
333
|
+
gamma: h,
|
|
334
|
+
webkitCompassHeading: a
|
|
335
|
+
}) {
|
|
336
|
+
if (k) {
|
|
337
|
+
const l = 360 - a;
|
|
338
|
+
e.alphaOffset = D.degToRad(l - s), e.deviceOrientation = { alpha: s, beta: c, gamma: h, webkitCompassHeading: a };
|
|
339
|
+
} else
|
|
340
|
+
s < 0 && (s += 360), e.deviceOrientation = { alpha: s, beta: c, gamma: h };
|
|
341
|
+
window.dispatchEvent(
|
|
342
|
+
new CustomEvent("camera-rotation-change", {
|
|
343
|
+
detail: { cameraRotation: t.rotation }
|
|
344
|
+
})
|
|
345
|
+
);
|
|
329
346
|
}, g = function() {
|
|
330
347
|
e.screenOrientation = window.orientation || 0;
|
|
331
|
-
},
|
|
332
|
-
|
|
348
|
+
}, w = function(s, c, h, a, l) {
|
|
349
|
+
z.set(h, c, -a, "YXZ"), s.setFromEuler(z), s.multiply(tt), s.multiply(J.setFromAxisAngle($, -l));
|
|
333
350
|
};
|
|
334
351
|
this.connect = function() {
|
|
335
|
-
g(), window.DeviceOrientationEvent !== void 0 && typeof window.DeviceOrientationEvent.requestPermission == "function" ? window.DeviceOrientationEvent.requestPermission().then(
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
352
|
+
g(), window.DeviceOrientationEvent !== void 0 && typeof window.DeviceOrientationEvent.requestPermission == "function" ? window.DeviceOrientationEvent.requestPermission().then((s) => {
|
|
353
|
+
s === "granted" && (window.addEventListener(
|
|
354
|
+
"orientationchange",
|
|
355
|
+
g
|
|
356
|
+
), window.addEventListener(
|
|
357
|
+
e.orientationChangeEventName,
|
|
358
|
+
u
|
|
359
|
+
));
|
|
360
|
+
}).catch(function(s) {
|
|
361
|
+
console.error(
|
|
362
|
+
"THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:",
|
|
363
|
+
s
|
|
364
|
+
);
|
|
365
|
+
}) : (window.addEventListener(
|
|
366
|
+
"orientationchange",
|
|
367
|
+
g
|
|
368
|
+
), window.addEventListener(
|
|
369
|
+
e.orientationChangeEventName,
|
|
370
|
+
u
|
|
371
|
+
)), e.enabled = !0;
|
|
340
372
|
}, this.disconnect = function() {
|
|
341
|
-
window.removeEventListener(
|
|
342
|
-
|
|
373
|
+
window.removeEventListener(
|
|
374
|
+
"orientationchange",
|
|
375
|
+
g
|
|
376
|
+
), window.removeEventListener(
|
|
377
|
+
e.orientationChangeEventName,
|
|
378
|
+
u
|
|
379
|
+
), e.enabled = !1, e.initialOffset = !1, e.deviceOrientation = null;
|
|
380
|
+
}, this.update = function({ theta: s = 0 } = { theta: 0 }) {
|
|
343
381
|
if (e.enabled === !1) return;
|
|
344
382
|
const c = e.deviceOrientation;
|
|
345
383
|
if (c) {
|
|
346
|
-
|
|
347
|
-
|
|
384
|
+
let h = c.alpha ? D.degToRad(c.alpha) + e.alphaOffset : 0, a = c.beta ? D.degToRad(c.beta) : 0, l = c.gamma ? D.degToRad(c.gamma) : 0;
|
|
385
|
+
const H = e.screenOrientation ? D.degToRad(e.screenOrientation) : 0;
|
|
386
|
+
if (k) {
|
|
387
|
+
const y = new _();
|
|
388
|
+
w(y, h, a, l, H);
|
|
389
|
+
const M = new N().setFromQuaternion(
|
|
390
|
+
y,
|
|
391
|
+
"YXZ"
|
|
392
|
+
);
|
|
393
|
+
console.log(M.x, M.y, M.z), M.y = D.degToRad(
|
|
394
|
+
360 - c.webkitCompassHeading
|
|
395
|
+
), y.setFromEuler(M), e.object.quaternion.copy(y);
|
|
396
|
+
} else {
|
|
397
|
+
if (this.smoothingFactor < 1) {
|
|
398
|
+
if (this.lastOrientation) {
|
|
399
|
+
const y = this.smoothingFactor;
|
|
400
|
+
h = this._getSmoothedAngle(
|
|
401
|
+
h,
|
|
402
|
+
this.lastOrientation.alpha,
|
|
403
|
+
y
|
|
404
|
+
), a = this._getSmoothedAngle(
|
|
405
|
+
a + Math.PI,
|
|
406
|
+
this.lastOrientation.beta,
|
|
407
|
+
y
|
|
408
|
+
), l = this._getSmoothedAngle(
|
|
409
|
+
l + this.HALF_PI,
|
|
410
|
+
this.lastOrientation.gamma,
|
|
411
|
+
y,
|
|
412
|
+
Math.PI
|
|
413
|
+
);
|
|
414
|
+
} else
|
|
415
|
+
a += Math.PI, l += this.HALF_PI;
|
|
416
|
+
this.lastOrientation = {
|
|
417
|
+
alpha: h,
|
|
418
|
+
beta: a,
|
|
419
|
+
gamma: l
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
w(
|
|
423
|
+
e.object.quaternion,
|
|
424
|
+
h + s,
|
|
425
|
+
this.smoothingFactor < 1 ? a - Math.PI : a,
|
|
426
|
+
this.smoothingFactor < 1 ? l - this.HALF_PI : l,
|
|
427
|
+
H
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
8 * (1 - o.dot(e.object.quaternion)) > i && (o.copy(e.object.quaternion), e.dispatchEvent(et));
|
|
348
431
|
}
|
|
432
|
+
}, this._orderAngle = function(s, c, h = this.TWO_PI) {
|
|
433
|
+
return c > s && Math.abs(c - s) < h / 2 || s > c && Math.abs(c - s) > h / 2 ? { left: s, right: c } : { left: c, right: s };
|
|
434
|
+
}, this._getSmoothedAngle = function(s, c, h, a = this.TWO_PI) {
|
|
435
|
+
const l = this._orderAngle(s, c, a), H = l.left, y = l.right;
|
|
436
|
+
l.left = 0, l.right -= H, l.right < 0 && (l.right += a);
|
|
437
|
+
let M = y == c ? (1 - h) * l.right + h * l.left : h * l.right + (1 - h) * l.left;
|
|
438
|
+
return M += H, M >= a && (M -= a), M;
|
|
439
|
+
}, this.updateAlphaOffset = function() {
|
|
440
|
+
e.initialOffset = !1;
|
|
349
441
|
}, this.dispose = function() {
|
|
350
442
|
e.disconnect();
|
|
351
|
-
}, this.
|
|
443
|
+
}, this.getAlpha = function() {
|
|
444
|
+
const { deviceOrientation: s } = e;
|
|
445
|
+
return s && s.alpha ? D.degToRad(s.alpha) + e.alphaOffset : 0;
|
|
446
|
+
}, this.getBeta = function() {
|
|
447
|
+
const { deviceOrientation: s } = e;
|
|
448
|
+
return s && s.beta ? D.degToRad(s.beta) : 0;
|
|
449
|
+
}, window.DeviceOrientationEvent !== void 0 && typeof window.DeviceOrientationEvent.requestPermission == "function" ? this.initPermissionDialog() : this.connect();
|
|
450
|
+
}
|
|
451
|
+
// Provide gesture before initialising device orientation controls
|
|
452
|
+
// From PR #659 on the main AR.js repo
|
|
453
|
+
// Thanks to @ma2yama
|
|
454
|
+
initPermissionDialog() {
|
|
455
|
+
const t = document.createElement("div"), e = document.createElement("div"), i = document.createElement("div"), o = document.createElement("div");
|
|
456
|
+
document.body.appendChild(t);
|
|
457
|
+
const u = {
|
|
458
|
+
display: "flex",
|
|
459
|
+
position: "fixed",
|
|
460
|
+
top: 0,
|
|
461
|
+
left: 0,
|
|
462
|
+
width: "100%",
|
|
463
|
+
height: "100%",
|
|
464
|
+
zIndex: 1,
|
|
465
|
+
backgroundColor: "rgba(0,0,0,0.6)",
|
|
466
|
+
justifyContent: "center",
|
|
467
|
+
alignItems: "center"
|
|
468
|
+
}, g = {
|
|
469
|
+
backgroundColor: "white",
|
|
470
|
+
padding: "6px",
|
|
471
|
+
borderRadius: "3px",
|
|
472
|
+
width: "36rem",
|
|
473
|
+
height: "24rem"
|
|
474
|
+
}, w = {
|
|
475
|
+
width: "100%",
|
|
476
|
+
height: "70%",
|
|
477
|
+
display: "flex",
|
|
478
|
+
justifyContent: "center",
|
|
479
|
+
alignItems: "center"
|
|
480
|
+
}, s = {
|
|
481
|
+
display: "inline-flex",
|
|
482
|
+
width: "100%",
|
|
483
|
+
height: "30%",
|
|
484
|
+
justifyContent: "center",
|
|
485
|
+
alignItems: "center"
|
|
486
|
+
};
|
|
487
|
+
for (let a in u)
|
|
488
|
+
t.style[a] = u[a];
|
|
489
|
+
for (let a in g)
|
|
490
|
+
e.style[a] = g[a];
|
|
491
|
+
for (let a in w)
|
|
492
|
+
i.style[a] = w[a];
|
|
493
|
+
for (let a in s)
|
|
494
|
+
o.style[a] = s[a];
|
|
495
|
+
t.appendChild(e), e.appendChild(i), e.appendChild(o), i.innerHTML = '<div style="font-size: 24pt; margin: 1rem;">This immersive website requires access to your device motion sensors.</div>';
|
|
496
|
+
const c = () => {
|
|
497
|
+
this.connect(), t.style.display = "none";
|
|
498
|
+
}, h = document.createElement("button");
|
|
499
|
+
h.addEventListener("click", c), h.style.width = "50%", h.style.height = "80%", h.style.fontSize = "20pt", h.appendChild(document.createTextNode("OK")), o.appendChild(h), document.body.appendChild(t);
|
|
352
500
|
}
|
|
353
501
|
}
|
|
354
|
-
class
|
|
502
|
+
class rt {
|
|
355
503
|
/**
|
|
356
504
|
* Create a ClickHandler.
|
|
357
505
|
* @param {THREE.WebGLRenderer} - The Three.js renderer on which the click
|
|
358
506
|
* events will be handled.
|
|
359
507
|
*/
|
|
360
508
|
constructor(t) {
|
|
361
|
-
this.raycaster = new
|
|
509
|
+
this.raycaster = new f.Raycaster(), this.normalisedMousePosition = new f.Vector2(null, null), t.domElement.addEventListener("click", (e) => {
|
|
362
510
|
this.normalisedMousePosition.set(
|
|
363
511
|
e.clientX / t.domElement.clientWidth * 2 - 1,
|
|
364
512
|
-(e.clientY / t.domElement.clientHeight * 2) + 1
|
|
@@ -376,16 +524,16 @@ class $ {
|
|
|
376
524
|
raycast(t, e) {
|
|
377
525
|
if (this.normalisedMousePosition.x !== null && this.normalisedMousePosition.y !== null) {
|
|
378
526
|
this.raycaster.setFromCamera(this.normalisedMousePosition, t);
|
|
379
|
-
const
|
|
380
|
-
return this.normalisedMousePosition.set(null, null),
|
|
527
|
+
const i = this.raycaster.intersectObjects(e.children, !1);
|
|
528
|
+
return this.normalisedMousePosition.set(null, null), i;
|
|
381
529
|
}
|
|
382
530
|
return [];
|
|
383
531
|
}
|
|
384
532
|
}
|
|
385
533
|
export {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
534
|
+
rt as ClickHandler,
|
|
535
|
+
at as DeviceOrientationControls,
|
|
536
|
+
st as LocationBased,
|
|
537
|
+
K as SphMercProjection,
|
|
538
|
+
ot as WebcamRenderer
|
|
391
539
|
};
|
package/dist/locar.umd.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
Name: `+
|
|
3
|
-
Message: `+
|
|
1
|
+
(function(a,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],i):(a=typeof globalThis<"u"?globalThis:a||self,i(a.locar={},a.THREE))})(this,function(a,i){"use strict";var H=a=>{throw TypeError(a)};var U=(a,i,f)=>i.has(a)||H("Cannot "+f);var n=(a,i,f)=>(U(a,i,"read from private field"),f?f.call(a):i.get(a)),v=(a,i,f)=>i.has(a)?H("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(a):i.set(a,f),u=(a,i,f,m)=>(U(a,i,"write to private field"),m?m.call(a,f):i.set(a,f),f),y=(a,i,f)=>(U(a,i,"access private method"),f);var N=(a,i,f,m)=>({set _(W){u(a,i,W,f)},get _(){return n(a,i,m)}});var w,Q,G,X,B,S,I,T,x,j,_,O,E,L,P,M,q,V,R,Y;function f(b){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(b){for(const e in b)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(b,e);Object.defineProperty(t,e,s.get?s:{enumerable:!0,get:()=>b[e]})}}return t.default=b,Object.freeze(t)}const m=f(i);class W{constructor(){v(this,w);this.EARTH=4007501668e-2,this.HALF_EARTH=2003750834e-2}project(t,e){return[y(this,w,Q).call(this,t),y(this,w,G).call(this,e)]}unproject(t){return[y(this,w,X).call(this,t[0]),y(this,w,B).call(this,t[1])]}getID(){return"epsg:3857"}}w=new WeakSet,Q=function(t){return t/180*this.HALF_EARTH},G=function(t){var e=Math.log(Math.tan((90+t)*Math.PI/360))/(Math.PI/180);return e*this.HALF_EARTH/180},X=function(t){return t/this.HALF_EARTH*180},B=function(t){var e=t/this.HALF_EARTH*180;return e=180/Math.PI*(2*Math.atan(Math.exp(e*Math.PI/180))-Math.PI/2),e};class Z{constructor(t,e,s={},r=null){v(this,M);v(this,S);v(this,I);v(this,T);v(this,x);v(this,j);v(this,_);v(this,O);v(this,E);v(this,L);v(this,P);this.scene=t,this.camera=e,u(this,S,new W),u(this,I,{}),u(this,T,null),u(this,x,0),u(this,j,100),u(this,_,null),this.setGpsOptions(s),u(this,O,null),u(this,E,0),u(this,L,0),u(this,P,r)}setProjection(t){u(this,S,t)}setGpsOptions(t={}){t.gpsMinDistance!==void 0&&u(this,x,t.gpsMinDistance),t.gpsMinAccuracy!==void 0&&u(this,j,t.gpsMinAccuracy)}async startGps(){if(n(this,P)){const e=await(await n(this,P).sendData("/gps/start",{gpsMinDistance:n(this,x),gpsMinAccuracy:n(this,j)})).json();u(this,L,e.session)}return n(this,_)===null?(u(this,_,navigator.geolocation.watchPosition(t=>{y(this,M,R).call(this,t)},t=>{n(this,I).gpserror?n(this,I).gpserror(t.code):alert(`GPS error: code ${t.code}`)},{enableHighAccuracy:!0})),!0):!1}stopGps(){return n(this,_)!==null?(navigator.geolocation.clearWatch(n(this,_)),u(this,_,null),!0):!1}fakeGps(t,e,s=null,r=0){s!==null&&this.setElevation(s),y(this,M,R).call(this,{coords:{longitude:t,latitude:e,accuracy:r}})}lonLatToWorldCoords(t,e){const s=n(this,S).project(t,e);if(n(this,O))s[0]-=n(this,O)[0],s[1]-=n(this,O)[1];else throw"No initial position determined";return[s[0],-s[1]]}add(t,e,s,r,g={}){var p;t.properties=g,y(this,M,q).call(this,t,e,s,r),this.scene.add(t),(p=n(this,P))==null||p.sendData("/object/new",{position:t.position,x:t.position.x,z:t.position.z,session:n(this,L),properties:g})}setElevation(t){this.camera.position.y=t}on(t,e){n(this,I)[t]=e}}S=new WeakMap,I=new WeakMap,T=new WeakMap,x=new WeakMap,j=new WeakMap,_=new WeakMap,O=new WeakMap,E=new WeakMap,L=new WeakMap,P=new WeakMap,M=new WeakSet,q=function(t,e,s,r){const g=this.lonLatToWorldCoords(e,s);r!==void 0&&(t.position.y=r),[t.position.x,t.position.z]=g},V=function(t,e){u(this,O,n(this,S).project(t,e))},R=function(t){var s,r,g;let e=Number.MAX_VALUE;N(this,E)._++,(s=n(this,P))==null||s.sendData("/gps/new",{gpsCount:n(this,E),lat:t.coords.latitude,lon:t.coords.longitude,acc:t.coords.accuracy,session:n(this,L)}),t.coords.accuracy<=n(this,j)&&(n(this,T)===null?u(this,T,{latitude:t.coords.latitude,longitude:t.coords.longitude}):e=y(this,M,Y).call(this,n(this,T),t.coords),e>=n(this,x)&&(n(this,T).longitude=t.coords.longitude,n(this,T).latitude=t.coords.latitude,n(this,O)||(y(this,M,V).call(this,t.coords.longitude,t.coords.latitude),(r=n(this,P))==null||r.sendData("/worldorigin/new",{gpsCount:n(this,E),lat:t.coords.latitude,lon:t.coords.longitude,session:n(this,L),initialPosition:n(this,O)})),y(this,M,q).call(this,this.camera,t.coords.longitude,t.coords.latitude),(g=n(this,P))==null||g.sendData("/gps/accepted",{gpsCount:n(this,E),cameraX:this.camera.position.x,cameraZ:this.camera.position.z,session:n(this,L),distMoved:e}),n(this,I).gpsupdate&&n(this,I).gpsupdate(t,e)))},Y=function(t,e){const s=m.MathUtils.degToRad(e.longitude-t.longitude),r=m.MathUtils.degToRad(e.latitude-t.latitude),g=Math.sin(r/2)*Math.sin(r/2)+Math.cos(m.MathUtils.degToRad(t.latitude))*Math.cos(m.MathUtils.degToRad(e.latitude))*(Math.sin(s/2)*Math.sin(s/2));return 2*Math.atan2(Math.sqrt(g),Math.sqrt(1-g))*6371e3};class K{constructor(t,e,s){this.renderer=t,this.renderer.autoClear=!1,this.sceneWebcam=new m.Scene;let r;e?r=document.querySelector(e):(r=document.createElement("video"),r.setAttribute("autoplay",!0),r.setAttribute("playsinline",!0),r.style.display="none",document.body.appendChild(r)),this.geom=new m.PlaneGeometry,this.texture=new m.VideoTexture(r),this.material=new m.MeshBasicMaterial({map:this.texture});const g=new m.Mesh(this.geom,this.material);if(this.sceneWebcam.add(g),this.cameraWebcam=new m.OrthographicCamera(-.5,.5,.5,-.5,0,10),navigator.mediaDevices&&navigator.mediaDevices.getUserMedia){const p={video:{width:(s==null?void 0:s.width)||1280,height:(s==null?void 0:s.height)||720,facingMode:"environment"}};navigator.mediaDevices.getUserMedia(p).then(A=>{console.log("using the webcam successfully..."),r.srcObject=A,r.play()}).catch(A=>{setTimeout(()=>{alert(`Webcam Error
|
|
2
|
+
Name: `+A.name+`
|
|
3
|
+
Message: `+A.message)},1e3)})}else setTimeout(()=>{alert("sorry - media devices API not supported")},1e3)}update(){this.renderer.clear(),this.renderer.render(this.sceneWebcam,this.cameraWebcam),this.renderer.clearDepth()}dispose(){this.material.dispose(),this.texture.dispose(),this.geom.dispose()}}const k=navigator.userAgent.match(/iPhone|iPad|iPod/i)||/Macintosh/i.test(navigator.userAgent)&&navigator.maxTouchPoints!=null&&navigator.maxTouchPoints>1,$=new i.Vector3(0,0,1),z=new i.Euler,J=new i.Quaternion,tt=new i.Quaternion(-Math.sqrt(.5),0,0,Math.sqrt(.5)),et={type:"change"};class it extends i.EventDispatcher{constructor(t){super(),window.isSecureContext===!1&&console.error("THREE.DeviceOrientationControls: DeviceOrientationEvent is only available in secure contexts (https)");const e=this,s=1e-6,r=new i.Quaternion;this.object=t,this.object.rotation.reorder("YXZ"),this.enabled=!0,this.deviceOrientation=null,this.screenOrientation=0,this.alphaOffset=0,this.initialOffset=null,this.TWO_PI=2*Math.PI,this.HALF_PI=.5*Math.PI,this.orientationChangeEventName="ondeviceorientationabsolute"in window?"deviceorientationabsolute":"deviceorientation",this.smoothingFactor=1;const g=function({alpha:o,beta:h,gamma:l,webkitCompassHeading:c}){if(k){const d=360-c;e.alphaOffset=i.MathUtils.degToRad(d-o),e.deviceOrientation={alpha:o,beta:h,gamma:l,webkitCompassHeading:c}}else o<0&&(o+=360),e.deviceOrientation={alpha:o,beta:h,gamma:l};window.dispatchEvent(new CustomEvent("camera-rotation-change",{detail:{cameraRotation:t.rotation}}))},p=function(){e.screenOrientation=window.orientation||0},A=function(o,h,l,c,d){z.set(l,h,-c,"YXZ"),o.setFromEuler(z),o.multiply(tt),o.multiply(J.setFromAxisAngle($,-d))};this.connect=function(){p(),window.DeviceOrientationEvent!==void 0&&typeof window.DeviceOrientationEvent.requestPermission=="function"?window.DeviceOrientationEvent.requestPermission().then(o=>{o==="granted"&&(window.addEventListener("orientationchange",p),window.addEventListener(e.orientationChangeEventName,g))}).catch(function(o){console.error("THREE.DeviceOrientationControls: Unable to use DeviceOrientation API:",o)}):(window.addEventListener("orientationchange",p),window.addEventListener(e.orientationChangeEventName,g)),e.enabled=!0},this.disconnect=function(){window.removeEventListener("orientationchange",p),window.removeEventListener(e.orientationChangeEventName,g),e.enabled=!1,e.initialOffset=!1,e.deviceOrientation=null},this.update=function({theta:o=0}={theta:0}){if(e.enabled===!1)return;const h=e.deviceOrientation;if(h){let l=h.alpha?i.MathUtils.degToRad(h.alpha)+e.alphaOffset:0,c=h.beta?i.MathUtils.degToRad(h.beta):0,d=h.gamma?i.MathUtils.degToRad(h.gamma):0;const F=e.screenOrientation?i.MathUtils.degToRad(e.screenOrientation):0;if(k){const C=new i.Quaternion;A(C,l,c,d,F);const D=new i.Euler().setFromQuaternion(C,"YXZ");console.log(D.x,D.y,D.z),D.y=i.MathUtils.degToRad(360-h.webkitCompassHeading),C.setFromEuler(D),e.object.quaternion.copy(C)}else{if(this.smoothingFactor<1){if(this.lastOrientation){const C=this.smoothingFactor;l=this._getSmoothedAngle(l,this.lastOrientation.alpha,C),c=this._getSmoothedAngle(c+Math.PI,this.lastOrientation.beta,C),d=this._getSmoothedAngle(d+this.HALF_PI,this.lastOrientation.gamma,C,Math.PI)}else c+=Math.PI,d+=this.HALF_PI;this.lastOrientation={alpha:l,beta:c,gamma:d}}A(e.object.quaternion,l+o,this.smoothingFactor<1?c-Math.PI:c,this.smoothingFactor<1?d-this.HALF_PI:d,F)}8*(1-r.dot(e.object.quaternion))>s&&(r.copy(e.object.quaternion),e.dispatchEvent(et))}},this._orderAngle=function(o,h,l=this.TWO_PI){return h>o&&Math.abs(h-o)<l/2||o>h&&Math.abs(h-o)>l/2?{left:o,right:h}:{left:h,right:o}},this._getSmoothedAngle=function(o,h,l,c=this.TWO_PI){const d=this._orderAngle(o,h,c),F=d.left,C=d.right;d.left=0,d.right-=F,d.right<0&&(d.right+=c);let D=C==h?(1-l)*d.right+l*d.left:l*d.right+(1-l)*d.left;return D+=F,D>=c&&(D-=c),D},this.updateAlphaOffset=function(){e.initialOffset=!1},this.dispose=function(){e.disconnect()},this.getAlpha=function(){const{deviceOrientation:o}=e;return o&&o.alpha?i.MathUtils.degToRad(o.alpha)+e.alphaOffset:0},this.getBeta=function(){const{deviceOrientation:o}=e;return o&&o.beta?i.MathUtils.degToRad(o.beta):0},window.DeviceOrientationEvent!==void 0&&typeof window.DeviceOrientationEvent.requestPermission=="function"?this.initPermissionDialog():this.connect()}initPermissionDialog(){const t=document.createElement("div"),e=document.createElement("div"),s=document.createElement("div"),r=document.createElement("div");document.body.appendChild(t);const g={display:"flex",position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1,backgroundColor:"rgba(0,0,0,0.6)",justifyContent:"center",alignItems:"center"},p={backgroundColor:"white",padding:"6px",borderRadius:"3px",width:"36rem",height:"24rem"},A={width:"100%",height:"70%",display:"flex",justifyContent:"center",alignItems:"center"},o={display:"inline-flex",width:"100%",height:"30%",justifyContent:"center",alignItems:"center"};for(let c in g)t.style[c]=g[c];for(let c in p)e.style[c]=p[c];for(let c in A)s.style[c]=A[c];for(let c in o)r.style[c]=o[c];t.appendChild(e),e.appendChild(s),e.appendChild(r),s.innerHTML='<div style="font-size: 24pt; margin: 1rem;">This immersive website requires access to your device motion sensors.</div>';const h=()=>{this.connect(),t.style.display="none"},l=document.createElement("button");l.addEventListener("click",h),l.style.width="50%",l.style.height="80%",l.style.fontSize="20pt",l.appendChild(document.createTextNode("OK")),r.appendChild(l),document.body.appendChild(t)}}class nt{constructor(t){this.raycaster=new m.Raycaster,this.normalisedMousePosition=new m.Vector2(null,null),t.domElement.addEventListener("click",e=>{this.normalisedMousePosition.set(e.clientX/t.domElement.clientWidth*2-1,-(e.clientY/t.domElement.clientHeight*2)+1)})}raycast(t,e){if(this.normalisedMousePosition.x!==null&&this.normalisedMousePosition.y!==null){this.raycaster.setFromCamera(this.normalisedMousePosition,t);const s=this.raycaster.intersectObjects(e.children,!1);return this.normalisedMousePosition.set(null,null),s}return[]}}a.ClickHandler=nt,a.DeviceOrientationControls=it,a.LocationBased=Z,a.SphMercProjection=W,a.WebcamRenderer=K,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|