superframe icon indicating copy to clipboard operation
superframe copied to clipboard

Orbit camera and WASD is broken from 0.9.2, orbit camera broken from 1.4.0

Open strowk opened this issue 3 years ago • 1 comments

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).

strowk avatar Dec 31 '22 00:12 strowk

The error is due to the different version of THREE used by [email protected]. In aframe-orbit-controls.js:

  • THREE.Quaternion.inverse() is now THREE.Quaternion.invert(). Also
  • THREE.Math.degToRad() will throw an error as from THREE r113 is THREE.MathUtils.degToRad()

[email protected] seems to behave better (with [email protected] something is going on with the vertical rotation) and you'll see the warning for THREE.Quaternion.inverse()

vsigno avatar Jan 24 '23 11:01 vsigno