@@ -65819,7 +65819,7 @@ function extend() {
6581965819},{}],54:[function(_dereq_,module,exports){
6582065820module.exports={
6582165821 "name": "aframe",
65822- "version": "1.0.1 ",
65822+ "version": "1.0.2 ",
6582365823 "description": "A web framework for building virtual reality experiences.",
6582465824 "homepage": "https://aframe.io/",
6582565825 "main": "dist/aframe-master.js",
@@ -65838,7 +65838,7 @@ module.exports={
6583865838 "lint:fix": "semistandard --fix",
6583965839 "precommit": "npm run lint",
6584065840 "prepush": "node scripts/testOnlyCheck.js",
65841- "prerelease": "cross-env FOR_RELEASE=true node scripts/release.js 1.0.0 1.0.1 ",
65841+ "prerelease": "cross-env node scripts/release.js 1.0.1 1.0.2 ",
6584265842 "start": "npm run dev",
6584365843 "start:https": "cross-env SSL=true npm run dev",
6584465844 "test": "karma start ./tests/karma.conf.js",
@@ -68872,9 +68872,11 @@ module.exports.Component = registerComponent('look-controls', {
6887268872 },
6887368873
6887468874 init: function () {
68875+ this.deltaYaw = 0;
6887568876 this.previousHMDPosition = new THREE.Vector3();
6887668877 this.hmdQuaternion = new THREE.Quaternion();
68877- this.hmdEuler = new THREE.Euler();
68878+ this.magicWindowAbsoluteEuler = new THREE.Euler();
68879+ this.magicWindowDeltaEuler = new THREE.Euler();
6887868880 this.position = new THREE.Vector3();
6887968881 // To save / restore camera pose
6888068882 this.savedRotation = new THREE.Vector3();
@@ -68902,6 +68904,7 @@ module.exports.Component = registerComponent('look-controls', {
6890268904
6890368905 setupMagicWindowControls: function () {
6890468906 var magicWindowControls;
68907+
6890568908 // Only on mobile devices and only enabled if DeviceOrientation permission has been granted.
6890668909 if (utils.device.isMobile()) {
6890768910 magicWindowControls = this.magicWindowControls = new THREE.DeviceOrientationControls(this.magicWindowObject);
@@ -69055,39 +69058,56 @@ module.exports.Component = registerComponent('look-controls', {
6905569058 var poseMatrix = new THREE.Matrix4();
6905669059
6905769060 return function () {
69058- var hmdEuler = this.hmdEuler;
6905969061 var object3D = this.el.object3D;
6906069062 var pitchObject = this.pitchObject;
6906169063 var yawObject = this.yawObject;
6906269064 var pose;
6906369065 var sceneEl = this.el.sceneEl;
6906469066
69065- // WebXR API updates applies headset pose to the object3D matrixWorld internally.
69066- // Reflect values back on position, rotation, scale so setAttribute returns expected values.
69067- if (sceneEl.is('vr-mode') && sceneEl.hasWebXR) {
69068- pose = sceneEl.renderer.xr.getCameraPose();
69069- if (pose) {
69070- poseMatrix.elements = pose.transform.matrix;
69071- poseMatrix.decompose(object3D.position, object3D.rotation, object3D.scale);
69067+ // In VR mode, THREE is in charge of updating the camera pose.
69068+ if (sceneEl.is('vr-mode') && sceneEl.checkHeadsetConnected()) {
69069+ // With WebXR THREE applies headset pose to the object3D matrixWorld internally.
69070+ // Reflect values back on position, rotation, scale for getAttribute to return the expected values.
69071+ if (sceneEl.hasWebXR) {
69072+ pose = sceneEl.renderer.xr.getCameraPose();
69073+ if (pose) {
69074+ poseMatrix.elements = pose.transform.matrix;
69075+ poseMatrix.decompose(object3D.position, object3D.rotation, object3D.scale);
69076+ }
6907269077 }
69078+ return;
6907369079 } else {
6907469080 object3D.updateMatrix();
6907569081 }
6907669082
69077- // In VR mode, THREE is in charge of updating the camera rotation.
69078- if (sceneEl.is('vr-mode') && sceneEl.checkHeadsetConnected()) { return; }
69079- // Calculate magic window HMD quaternion.
69080- if (this.magicWindowControls && this.magicWindowControls.enabled) {
69081- this.magicWindowControls.update();
69082- hmdEuler.setFromQuaternion(this.magicWindowObject.quaternion, 'YXZ');
69083- }
69083+ this.updateMagicWindowOrientation();
6908469084
6908569085 // On mobile, do camera rotation with touch events and sensors.
69086- object3D.rotation.x = hmdEuler.x + pitchObject.rotation.x;
69087- object3D.rotation.y = hmdEuler.y + yawObject.rotation.y;
69086+ object3D.rotation.x = this.magicWindowDeltaEuler.x + pitchObject.rotation.x;
69087+ object3D.rotation.y = this.magicWindowDeltaEuler.y + yawObject.rotation.y;
69088+ object3D.rotation.z = this.magicWindowDeltaEuler.z;
6908869089 };
6908969090 })(),
6909069091
69092+ updateMagicWindowOrientation: function () {
69093+ var magicWindowAbsoluteEuler = this.magicWindowAbsoluteEuler;
69094+ var magicWindowDeltaEuler = this.magicWindowDeltaEuler;
69095+ // Calculate magic window HMD quaternion.
69096+ if (this.magicWindowControls && this.magicWindowControls.enabled) {
69097+ this.magicWindowControls.update();
69098+ magicWindowAbsoluteEuler.setFromQuaternion(this.magicWindowObject.quaternion, 'YXZ');
69099+ if (!this.previousMagicWindowYaw && magicWindowAbsoluteEuler.y !== 0) {
69100+ this.previousMagicWindowYaw = magicWindowAbsoluteEuler.y;
69101+ }
69102+ if (this.previousMagicWindowYaw) {
69103+ magicWindowDeltaEuler.x = magicWindowAbsoluteEuler.x;
69104+ magicWindowDeltaEuler.y += magicWindowAbsoluteEuler.y - this.previousMagicWindowYaw;
69105+ magicWindowDeltaEuler.z = magicWindowAbsoluteEuler.z;
69106+ this.previousMagicWindowYaw = magicWindowAbsoluteEuler.y;
69107+ }
69108+ }
69109+ },
69110+
6909169111 /**
6909269112 * Translate mouse drag into rotation.
6909369113 *
@@ -69126,11 +69146,11 @@ module.exports.Component = registerComponent('look-controls', {
6912669146 * Register mouse down to detect mouse drag.
6912769147 */
6912869148 onMouseDown: function (evt) {
69129- if (!this.data.enabled) { return; }
69149+ var sceneEl = this.el.sceneEl;
69150+ if (!this.data.enabled || sceneEl.is('vr-mode')) { return; }
6913069151 // Handle only primary button.
6913169152 if (evt.button !== 0) { return; }
6913269153
69133- var sceneEl = this.el.sceneEl;
6913469154 var canvasEl = sceneEl && sceneEl.canvas;
6913569155
6913669156 this.mouseDown = true;
@@ -69172,7 +69192,9 @@ module.exports.Component = registerComponent('look-controls', {
6917269192 * Register touch down to detect touch drag.
6917369193 */
6917469194 onTouchStart: function (evt) {
69175- if (evt.touches.length !== 1 || !this.data.touchEnabled) { return; }
69195+ if (evt.touches.length !== 1 ||
69196+ !this.data.touchEnabled ||
69197+ this.el.sceneEl.is('vr-mode')) { return; }
6917669198 this.touchStart = {
6917769199 x: evt.touches[0].pageX,
6917869200 y: evt.touches[0].pageY
@@ -69216,6 +69238,7 @@ module.exports.Component = registerComponent('look-controls', {
6921669238 if (!this.el.sceneEl.checkHeadsetConnected()) { return; }
6921769239 this.saveCameraPose();
6921869240 this.el.object3D.position.set(0, 0, 0);
69241+ this.el.object3D.rotation.set(0, 0, 0);
6921969242 this.el.object3D.updateMatrix();
6922069243 },
6922169244
@@ -70739,7 +70762,10 @@ module.exports.Component = registerComponent('device-orientation-permission-ui',
7073970762 }
7074070763
7074170764 // Show alert on iPad if Safari is on desktop mode.
70742- if (utils.device.isMobileDeviceRequestingDesktopSite()) { this.showMobileDesktopModeAlert(); }
70765+ if (utils.device.isMobileDeviceRequestingDesktopSite()) {
70766+ this.showMobileDesktopModeAlert();
70767+ return;
70768+ }
7074370769
7074470770 // Browser doesn't support or doesn't require permission to DeviceOrientationEvent API.
7074570771 if (typeof DeviceOrientationEvent === 'undefined' || !DeviceOrientationEvent.requestPermission) {
@@ -80131,7 +80157,7 @@ _dereq_('./core/a-mixin');
8013180157_dereq_('./extras/components/');
8013280158_dereq_('./extras/primitives/');
8013380159
80134- console.log('A-Frame Version: 1.0.1 (Date 2019-12-20 , Commit #7b1a50f7 )');
80160+ console.log('A-Frame Version: 1.0.2 (Date 2019-12-23 , Commit #52b781c6 )');
8013580161console.log('three Version (https://github.com/supermedium/three.js):',
8013680162 pkg.dependencies['super-three']);
8013780163console.log('WebVR Polyfill Version:', pkg.dependencies['webvr-polyfill']);
@@ -84576,4 +84602,4 @@ module.exports = getWakeLock();
8457684602
8457784603},{"./util.js":193}]},{},[153])(153)
8457884604});
84579- //# sourceMappingURL=aframe-v1.0.1 .js.map
84605+ //# sourceMappingURL=aframe-v1.0.2 .js.map
0 commit comments