Skip to content

Commit baa3d2a

Browse files
solve eslint errors
1 parent be87467 commit baa3d2a

File tree

2 files changed

+20
-17
lines changed

2 files changed

+20
-17
lines changed

lib/three/device-orientation-controls.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class DeviceOrientationControls extends EventDispatcher {
9999
window.dispatchEvent(
100100
new CustomEvent("camera-rotation-change", {
101101
detail: { cameraRotation: object.rotation },
102-
}),
102+
})
103103
);
104104
};
105105

@@ -121,7 +121,7 @@ class DeviceOrientationControls extends EventDispatcher {
121121
alpha,
122122
beta,
123123
gamma,
124-
orient,
124+
orient
125125
) {
126126
_euler.set(beta, alpha, -gamma, "YXZ"); // 'ZXY' for the device, but 'YXZ' for us
127127

@@ -146,11 +146,11 @@ class DeviceOrientationControls extends EventDispatcher {
146146

147147
window.addEventListener(
148148
"orientationchange",
149-
onScreenOrientationChangeEvent,
149+
onScreenOrientationChangeEvent
150150
);
151151
window.addEventListener(
152152
scope.orientationChangeEventName,
153-
onDeviceOrientationChangeEvent,
153+
onDeviceOrientationChangeEvent
154154
);
155155

156156
scope.enabled = true;
@@ -159,11 +159,11 @@ class DeviceOrientationControls extends EventDispatcher {
159159
this.disconnect = function () {
160160
window.removeEventListener(
161161
"orientationchange",
162-
onScreenOrientationChangeEvent,
162+
onScreenOrientationChangeEvent
163163
);
164164
window.removeEventListener(
165165
scope.orientationChangeEventName,
166-
onDeviceOrientationChangeEvent,
166+
onDeviceOrientationChangeEvent
167167
);
168168

169169
scope.enabled = false;
@@ -212,6 +212,7 @@ class DeviceOrientationControls extends EventDispatcher {
212212
code: "LOCAR_DEVICE_ORIENTATION_PERMISSION_FAILED",
213213
message:
214214
"Permission request for device orientation failed - AR will not work correctly",
215+
error: JSON.stringify(error, null, 2),
215216
});
216217
});
217218
} else {
@@ -224,6 +225,7 @@ class DeviceOrientationControls extends EventDispatcher {
224225
}
225226
};
226227

228+
// eslint-disable-next-line no-unused-vars
227229
this.update = function ({ theta: s = 0 } = { theta: 0 }) {
228230
if (scope.enabled === false) return;
229231
const device = scope.deviceOrientation;
@@ -247,18 +249,18 @@ class DeviceOrientationControls extends EventDispatcher {
247249
alpha = scope._getSmoothedAngle(
248250
alpha,
249251
scope.lastOrientation.alpha,
250-
k,
252+
k
251253
);
252254
beta = scope._getSmoothedAngle(
253255
beta + Math.PI,
254256
scope.lastOrientation.beta,
255-
k,
257+
k
256258
);
257259
gamma = scope._getSmoothedAngle(
258260
gamma + scope.HALF_PI,
259261
scope.lastOrientation.gamma,
260262
k,
261-
Math.PI,
263+
Math.PI
262264
);
263265
} else {
264266
beta += Math.PI;
@@ -279,12 +281,12 @@ class DeviceOrientationControls extends EventDispatcher {
279281
alpha,
280282
scope.smoothingFactor < 1 ? beta - Math.PI : beta,
281283
scope.smoothingFactor < 1 ? gamma - Math.PI / 2 : gamma,
282-
orient,
284+
orient
283285
);
284286

285287
const currentEuler = new Euler().setFromQuaternion(
286288
currentQuaternion,
287-
"YXZ",
289+
"YXZ"
288290
);
289291

290292
let compassY = MathUtils.degToRad(360 - device.webkitCompassHeading);
@@ -293,7 +295,7 @@ class DeviceOrientationControls extends EventDispatcher {
293295
compassY = scope._getSmoothedAngle(
294296
compassY,
295297
scope.lastCompassY,
296-
scope.smoothingFactor,
298+
scope.smoothingFactor
297299
);
298300
}
299301

@@ -310,7 +312,7 @@ class DeviceOrientationControls extends EventDispatcher {
310312
isIOS ? alpha + scope.alphaOffset : alpha,
311313
scope.smoothingFactor < 1 ? beta - Math.PI : beta,
312314
scope.smoothingFactor < 1 ? gamma - Math.PI / 2 : gamma,
313-
orient,
315+
orient
314316
);
315317
}
316318
}
@@ -505,7 +507,7 @@ class DeviceOrientationControls extends EventDispatcher {
505507
innerDiv.appendChild(msgDiv);
506508
innerDiv.appendChild(btnDiv);
507509
msgDiv.appendChild(
508-
document.createTextNode(LOCAR_DEVICE_ORIENTATION_MESSAGE),
510+
document.createTextNode(LOCAR_DEVICE_ORIENTATION_MESSAGE)
509511
);
510512

511513
const onStartClick = () => {

lib/three/location-based.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as THREE from "three";
55
/** The main class for the LocAR.js system. */
66
class LocationBased extends EventEmitter {
77
#proj;
8+
// eslint-disable-next-line no-unused-private-class-members
89
#eventHandlers;
910
#lastCoords;
1011
#gpsMinDistance;
@@ -94,7 +95,7 @@ class LocationBased extends EventEmitter {
9495
},
9596
{
9697
enableHighAccuracy: true,
97-
},
98+
}
9899
);
99100
return true;
100101
}
@@ -229,7 +230,7 @@ class LocationBased extends EventEmitter {
229230
if (!this.#initialPosition) {
230231
this.#setWorldOrigin(
231232
position.coords.longitude,
232-
position.coords.latitude,
233+
position.coords.latitude
233234
);
234235
this.#serverLogger?.sendData("/worldorigin/new", {
235236
gpsCount: this.#gpsCount,
@@ -243,7 +244,7 @@ class LocationBased extends EventEmitter {
243244
this.#setWorldPosition(
244245
this.camera,
245246
position.coords.longitude,
246-
position.coords.latitude,
247+
position.coords.latitude
247248
);
248249

249250
this.#serverLogger?.sendData("/gps/accepted", {

0 commit comments

Comments
 (0)