fix overlay moving camera rig to a different scene

This commit is contained in:
Kevin Ngo
2018-11-17 04:36:34 -08:00
parent d94a723807
commit e1065f7ec7
2 changed files with 18 additions and 7 deletions

View File

@@ -14,6 +14,8 @@ AFRAME.registerComponent('recenter', {
controlEl.addEventListener('menudown', this.recenter);
controlEl.addEventListener('thumbstickdown', this.recenter);
});
this.el.addEventListener('recenter', this.recenter);
},
recenter: (function () {
@@ -43,6 +45,7 @@ AFRAME.registerComponent('recenter', {
matrix.multiply(rotationMatrix).multiply(translationMatrix);
matrix.decompose(el.object3D.position, el.object3D.quaternion, el.object3D.scale);
el.object3D.updateMatrixWorld(true);
el.emit('recentered', null, false);
};
})()
});