Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
strowk opened this issue Dec 31, 2022 · 1 comment
Open

Comments

@strowk
Copy link

strowk commented Dec 31, 2022

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
Copy link

vsigno commented Jan 24, 2023

The error is due to the different version of THREE used by AFrame@1.4. 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()

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants