Yinteger / Jiggy.io

GNU General Public License v3.0
1 stars 1 forks source link

Device Orientation #34

Open breautek opened 6 years ago

breautek commented 6 years ago

I think this would be useful as a part of the inputs package to supply the device orientation values.

For web, the DeviceMotion API can be used to achieve this, but the underlying API should be flexible to swap out the usage of the DeviceMotion API in favor of the cordova APIs if available.

Using raw X/Y/Z acceleration values, (DeviceMotion seems to call them Alpha/Beta/Gamma), we can detect which way the device is facing. The app can then do meaningful logic such as rotating the view appropriately, provide instructions to hold their phone in a specific way (such as from portrait to landscape), or it could be an actual control input to be used in the game (such as determining direction of gravity for a rolling ball.)

Yinteger commented 6 years ago

I'd give this a pretty low priority but still a good idea.