Skip to content

Commit

Permalink
upgrading packages
Browse files Browse the repository at this point in the history
  • Loading branch information
kalwalt committed Dec 19, 2024
1 parent 363c4e8 commit 51cb9b7
Show file tree
Hide file tree
Showing 32 changed files with 751 additions and 589 deletions.
2 changes: 1 addition & 1 deletion aframe/src/component-hit-testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ AFRAME.registerComponent("arjs-hit-testing", {
hitTesting.update(
camera,
arAnchor.object3d,
arAnchor.parameters.changeMatrixMode
arAnchor.parameters.changeMatrixMode,
);
},
});
14 changes: 7 additions & 7 deletions aframe/src/location-based/ArjsDeviceOrientationControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ const ArjsDeviceOrientationControls = function (object) {
window.addEventListener(
"orientationchange",
onScreenOrientationChangeEvent,
false
false,
);
window.addEventListener(
"deviceorientation",
onDeviceOrientationChangeEvent,
false
false,
);

scope.enabled = true;
Expand All @@ -82,12 +82,12 @@ const ArjsDeviceOrientationControls = function (object) {
window.removeEventListener(
"orientationchange",
onScreenOrientationChangeEvent,
false
false,
);
window.removeEventListener(
"deviceorientation",
onDeviceOrientationChangeEvent,
false
false,
);

scope.enabled = false;
Expand Down Expand Up @@ -119,13 +119,13 @@ const ArjsDeviceOrientationControls = function (object) {
beta = this._getSmoothedAngle(
beta + Math.PI,
this.lastOrientation.beta,
k
k,
);
gamma = this._getSmoothedAngle(
gamma + this.HALF_PI,
this.lastOrientation.gamma,
k,
Math.PI
Math.PI,
);
} else {
beta += Math.PI;
Expand All @@ -142,7 +142,7 @@ const ArjsDeviceOrientationControls = function (object) {
alpha,
beta - Math.PI,
gamma - this.HALF_PI,
orient
orient,
);
}
};
Expand Down
24 changes: 12 additions & 12 deletions aframe/src/location-based/arjs-look-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ AFRAME.registerComponent("arjs-look-controls", {
"deviceorientationpermissiongranted",
function () {
magicWindowControls.enabled = data.magicWindowTrackingEnabled;
}
},
);
}
}
Expand Down Expand Up @@ -157,7 +157,7 @@ AFRAME.registerComponent("arjs-look-controls", {
this.onExitVR = AFRAME.utils.bind(this.onExitVR, this);
this.onPointerLockChange = AFRAME.utils.bind(
this.onPointerLockChange,
this
this,
);
this.onPointerLockError = AFRAME.utils.bind(this.onPointerLockError, this);
},
Expand All @@ -184,7 +184,7 @@ AFRAME.registerComponent("arjs-look-controls", {
if (!canvasEl) {
sceneEl.addEventListener(
"render-target-loaded",
AFRAME.utils.bind(this.addEventListeners, this)
AFRAME.utils.bind(this.addEventListeners, this),
);
return;
}
Expand All @@ -208,17 +208,17 @@ AFRAME.registerComponent("arjs-look-controls", {
document.addEventListener(
"pointerlockchange",
this.onPointerLockChange,
false
false,
);
document.addEventListener(
"mozpointerlockchange",
this.onPointerLockChange,
false
false,
);
document.addEventListener(
"pointerlockerror",
this.onPointerLockError,
false
false,
);
}
},
Expand Down Expand Up @@ -252,17 +252,17 @@ AFRAME.registerComponent("arjs-look-controls", {
document.removeEventListener(
"pointerlockchange",
this.onPointerLockChange,
false
false,
);
document.removeEventListener(
"mozpointerlockchange",
this.onPointerLockChange,
false
false,
);
document.removeEventListener(
"pointerlockerror",
this.onPointerLockError,
false
false,
);
},

Expand Down Expand Up @@ -291,7 +291,7 @@ AFRAME.registerComponent("arjs-look-controls", {
poseMatrix.decompose(
object3D.position,
object3D.rotation,
object3D.scale
object3D.scale,
);
}
}
Expand All @@ -316,7 +316,7 @@ AFRAME.registerComponent("arjs-look-controls", {
this.magicWindowControls.update();
magicWindowAbsoluteEuler.setFromQuaternion(
this.magicWindowObject.quaternion,
"YXZ"
"YXZ",
);
if (!this.previousMagicWindowYaw && magicWindowAbsoluteEuler.y !== 0) {
this.previousMagicWindowYaw = magicWindowAbsoluteEuler.y;
Expand Down Expand Up @@ -367,7 +367,7 @@ AFRAME.registerComponent("arjs-look-controls", {
pitchObject.rotation.x += movementY * 0.002 * direction;
pitchObject.rotation.x = Math.max(
-PI_2,
Math.min(PI_2, pitchObject.rotation.x)
Math.min(PI_2, pitchObject.rotation.x),
);
},

Expand Down
4 changes: 2 additions & 2 deletions aframe/src/location-based/arjs-webcam-texture.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ AFRAME.registerComponent("arjs-webcam-texture", {
})
.catch((e) => {
this.el.sceneEl.systems["arjs"]._displayErrorPopup(
`Webcam error: ${e}`
`Webcam error: ${e}`,
);
});
} else {
this.el.sceneEl.systems["arjs"]._displayErrorPopup(
"sorry - media devices API not supported"
"sorry - media devices API not supported",
);
}
},
Expand Down
24 changes: 12 additions & 12 deletions aframe/src/location-based/gps-camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ AFRAME.registerComponent("gps-camera", {
this.onGpsEntityPlaceAdded = this._onGpsEntityPlaceAdded.bind(this);
window.addEventListener(
"gps-entity-place-added",
this.onGpsEntityPlaceAdded
this.onGpsEntityPlaceAdded,
);

this.lookControls =
Expand All @@ -113,16 +113,16 @@ AFRAME.registerComponent("gps-camera", {
function () {
handler();
},
false
false,
);

this.el.sceneEl.systems["arjs"]._displayErrorPopup(
"After camera permission prompt, please tap the screen to activate geolocation."
"After camera permission prompt, please tap the screen to activate geolocation.",
);
} else {
var timeout = setTimeout(function () {
this.el.sceneEl.systems["arjs"]._displayErrorPopup(
"Please enable device orientation in Settings > Safari > Motion & Orientation Access."
"Please enable device orientation in Settings > Safari > Motion & Orientation Access.",
);
}, 750);
window.addEventListener(eventName, function () {
Expand Down Expand Up @@ -162,7 +162,7 @@ AFRAME.registerComponent("gps-camera", {
this.currentCoords = localPosition;
var distMoved = this._haversineDist(
this.lastPosition,
this.currentCoords
this.currentCoords,
);

if (distMoved >= this.data.gpsMinDistance || !this.originCoords) {
Expand All @@ -172,7 +172,7 @@ AFRAME.registerComponent("gps-camera", {
latitude: this.currentCoords.latitude,
};
}
}.bind(this)
}.bind(this),
);
}
},
Expand All @@ -197,7 +197,7 @@ AFRAME.registerComponent("gps-camera", {

window.removeEventListener(
"gps-entity-place-added",
this.onGpsEntityPlaceAdded
this.onGpsEntityPlaceAdded,
);
},

Expand Down Expand Up @@ -233,14 +233,14 @@ AFRAME.registerComponent("gps-camera", {
if (err.code === 1) {
// User denied GeoLocation, let their know that
this.el.sceneEl.systems["arjs"]._displayErrorPopup(
"Please activate Geolocation and refresh the page. If it is already active, please check permissions for this website."
"Please activate Geolocation and refresh the page. If it is already active, please check permissions for this website.",
);
return;
}

if (err.code === 3) {
this.el.sceneEl.systems["arjs"]._displayErrorPopup(
"Cannot retrieve GPS position. Signal is absent."
"Cannot retrieve GPS position. Signal is absent.",
);
return;
}
Expand Down Expand Up @@ -332,7 +332,7 @@ AFRAME.registerComponent("gps-camera", {
window.dispatchEvent(
new CustomEvent("gps-camera-update-position", {
detail: { position: this.currentCoords, origin: this.originCoords },
})
}),
);
},
/**
Expand Down Expand Up @@ -448,7 +448,7 @@ AFRAME.registerComponent("gps-camera", {
this.heading = this._computeCompassHeading(
event.alpha,
event.beta,
event.gamma
event.gamma,
);
} else {
console.warn("event.absolute === false");
Expand All @@ -467,7 +467,7 @@ AFRAME.registerComponent("gps-camera", {
var heading = 360 - this.heading;
var cameraRotation = this.el.getAttribute("rotation").y;
var yawRotation = THREE.MathUtils.radToDeg(
this.lookControls.yawObject.rotation.y
this.lookControls.yawObject.rotation.y,
);
var offset = (heading - (cameraRotation - yawRotation)) % 360;
this.lookControls.yawObject.rotation.y = THREE.MathUtils.degToRad(offset);
Expand Down
20 changes: 10 additions & 10 deletions aframe/src/location-based/gps-entity-place.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ AFRAME.registerComponent("gps-entity-place", {
// cleaning listeners when the entity is removed from the DOM
window.removeEventListener(
"gps-camera-origin-coord-set",
this.coordSetListener
this.coordSetListener,
);
window.removeEventListener(
"gps-camera-update-position",
this.updatePositionListener
this.updatePositionListener,
);
},
init: function () {
Expand Down Expand Up @@ -49,21 +49,21 @@ AFRAME.registerComponent("gps-entity-place", {
// it's actually a 'distance place', but we don't call it with last param, because we want to retrieve distance even if it's < minDistance property
var distanceForMsg = this._cameraGps.computeDistanceMeters(
ev.detail.position,
dstCoords
dstCoords,
);

this.el.setAttribute("distance", distanceForMsg);
this.el.setAttribute("distanceMsg", this._formatDistance(distanceForMsg));
this.el.dispatchEvent(
new CustomEvent("gps-entity-place-update-position", {
detail: { distance: distanceForMsg },
})
}),
);

var actualDistance = this._cameraGps.computeDistanceMeters(
ev.detail.position,
dstCoords,
true
true,
);

if (actualDistance === Number.MAX_SAFE_INTEGER) {
Expand All @@ -75,19 +75,19 @@ AFRAME.registerComponent("gps-entity-place", {

window.addEventListener(
"gps-camera-origin-coord-set",
this.coordSetListener
this.coordSetListener,
);
window.addEventListener(
"gps-camera-update-position",
this.updatePositionListener
this.updatePositionListener,
);

this._positionXDebug = 0;

window.dispatchEvent(
new CustomEvent("gps-entity-place-added", {
detail: { component: this.el },
})
}),
);
},
/**
Expand Down Expand Up @@ -116,7 +116,7 @@ AFRAME.registerComponent("gps-entity-place", {

position.x = this._cameraGps.computeDistanceMeters(
this._cameraGps.originCoords,
dstCoords
dstCoords,
);

this._positionXDebug = position.x;
Expand All @@ -132,7 +132,7 @@ AFRAME.registerComponent("gps-entity-place", {

position.z = this._cameraGps.computeDistanceMeters(
this._cameraGps.originCoords,
dstCoords
dstCoords,
);

position.z *=
Expand Down
Loading

0 comments on commit 51cb9b7

Please sign in to comment.