Gyroscope Plugin gyro.js
Version 1.17
HTML5 only
This plugin uses the gyroscope in mobile / tablet devices to control the view in krpano.
- iOS - yes, works perfectly on all devices with gyro sensors (iPhone 4 and iPad 2 and up).
- BlackBerry - yes, works perfectly (tested on Playbook with OS 2.1).
- Android - partially... (the exact behavior might differ from device to device)
- Stock / Webview-based browsers - imprecise and jittering.
- Android Chrome - imprecise and jerky.
- Android Firefox - not supported.
- IE10 - no, the IE10 doesn't support the required DeviceOrientation Event yet.
-
available
- This read-only attribute is only set to true if the browser/device is generating deviceorientation events. It can be used to determine if a ui for the gyroscope is applicable.
- Values: true/false, read-only
-
enabled
- Enables or disables the gyroscope for navigation.
- Values: true/false, default: true
-
camroll
- Determines whether or not the camera rotates around the roll axis.
- Values: true/false, default: false
-
friction
- Dampens the gyroscope values, making the result less "twitchy".
- 0 means no dampening, 1 is infinite dampening (ie: no gyroscope movement)
- Values: 0-1, default: 0.5
-
velastic
- If set to a value greater than 0, the vlookat parameter returns to the device pitch after manually altering the view.
- The higher the value, the faster the view returns to the device pitch.
- Values: 0-1, default: 0
-
vrelative
- When set to true, the vertical looking direction will relative to the initial device direction instead of being relative to the real-world-horizon.
It makes sense to combine this setting with velastic="0".
- Values: true/false, default: false
- onavailable
- This event will be called when the gyroscope is available on this device.
The plugin can be used free of charge, in commercial or non-commercial applications. The source code is available under a Creative Commons Attribution license.
In a nutshell, this means you are free to use the software and its source code in your projects. If you use the source code in another software project, you are required to add attribution to the author(s). You are encouraged to share the your source code under a similar fashion, but it is not a requirement.
If you use the plugins regularly, you may consider making a donation so I can afford to continue making these plugins and making them available.