Open a0m0rajab opened 2 years ago
Thanks. this is a design decision https://github.com/aframevr/aframe/issues/4190
That's totally understandable,
What about putting a flag to activate the rotation? so that we can let the user decide if they would activate it or not! if you like that, I would edit the PR for this.
there is good example for this issue btw, which is used at 3Dvista https://www.kadirgasanat.com/sanaltur/ethem/
it's less sensitive to the gyroscope movements and always centralize the camera for the view.
Stolen from stack overflow:
AFRAME.components["look-controls"].Component.prototype.onTouchMove = function (t) {
console.log('on touch move event!')
if (this.touchStarted && this.data.touchEnabled) {
this.pitchObject.rotation.x += .6 * Math.PI * (t.touches[0].pageY - this.touchStart.y) / this.el.sceneEl.canvas.clientHeight;
this.yawObject.rotation.y += /* */ Math.PI * (t.touches[0].pageX - this.touchStart.x) / this.el.sceneEl.canvas.clientWidth;
this.pitchObject.rotation.x = Math.max(Math.PI / -2, Math.min(Math.PI / 2, this.pitchObject.rotation.x));
this.touchStart = {
x: t.touches[0].pageX,
y: t.touches[0].pageY
}
}
}
Description:
The look controls only working horizontally on touch screen, is this a feature or a bug?