Orbit camera and WASD is broken from 0.9.2, orbit camera broken from 1.4.0
Opened this issue · 1 comments
strowk commented
When wasd-controls used together with orbit camera in version 0.8.2 of A-Frame it works as expected (within reason at least).
Starting with A-Frame 0.9.2 WASD stopped doing what it is supposed to and instead rotates camera albeit slowly. Starting with A-Frame 1.4.0 the whole component breaks and logs following:
aframe-orbit-controls.min.js:1
Uncaught TypeError: quat.clone(...).inverse is not a function
at aframe-orbit-controls.min.js:1:2563
at new THREE.OrbitControls (aframe-orbit-controls.min.js:1:3920)
at n.play (aframe-orbit-controls.min.js:1:17154)
at n.play (aframe.min.js:2:417129)
at d.play (aframe.min.js:2:400955)
at v.play (aframe.min.js:2:401016)
at v.<anonymous> (aframe.min.js:2:431426)
at v.emit (aframe.min.js:2:408454)
at aframe.min.js:2:406943
The expected would be if wasd would move both camera and target respecting the direction camera is facing (with 0.8.2 it does not do that as well).
vsigno commented
The error is due to the different version of THREE used by AFrame@1.4. In aframe-orbit-controls.js:
THREE.Quaternion.inverse()
is nowTHREE.Quaternion.invert()
.
AlsoTHREE.Math.degToRad()
will throw an error as from THREE r113 isTHREE.MathUtils.degToRad()
AFrame@1.3 seems to behave better (with AFrame@1.4 something is going on with the vertical rotation) and you'll see the warning for THREE.Quaternion.inverse()