supermedium / superframe

:package: A super collection of A-Frame components.
https://supermedium.com/superframe/
MIT License
1.37k stars 423 forks source link

Add support to "magicWindowTrackingEnabled: false" to "orbit-conrols" #306

Closed kobygold closed 2 years ago

kobygold commented 2 years ago

I'm trying to ignore mobile sensors (Gyro) rotating the scene when running on a mobile phone. i.e. I'm looking for a way for the camera to rotate only when the user drags his finger on screen, but not when the entire phone is rotated.

A-FRAME has the "magicWindowTrackingEnabled: false" that does that (https://aframe.io/docs/master/components/look-controls.html#sidebar) But when using your "orbit-control" package this setting is not working. And if I try to set is as part of the "orbit control" parameters I get an error that this parameter is unknown.

I tried to set this parameter like this on my HTML:

            <a-entity camera look-controls orbit-controls="target: 0 1 -0.5;
                                                           minDistance: 0.5;
                                                           maxDistance: 180;
                                                           initialPosition: 0 2 8"
                      magicWindowTrackingEnabled=false>
            </a-entity>

But it doesn't work.

Can you add support for this parameter, or is there any other way that can cause the "orbit control" code to ignore the mobile phone sensors?

Thanks, Koby

kobygold commented 2 years ago

I understood what is needed to avoid the rotation by the mobile sensors: I just had to remove the "look-controls" string.