Private
thePrivate
_gyroPrivate
boundStatic
initInitialize Gyro functionality in your WebChucK instance.
This adds a Gyro
and GyroMsg
class to the ChucK Virtual Machine (VM).
Gyrscope event (DeviceOrientationEvent) listeners are added if enableGyro
is true (default).
theChuck = await Chuck.init([]);
gyro = await Gyro.init(theChuck); // Initialize Gyro
Introducing Gyro (gyroscope, on mobile) support for WebChucK. Gyro wraps JavaScript
DeviceOrientationEvent
listeners easing access to mobile device gyroscope in WebChucK code.To get started with Gyro:
The
deviceorientation
event gives motion of the device around the three axes (x, y, and z) represented in degrees from 0 to 360. More on thedeviceorientation
event can be found online here.iOS devices require that the web developer ask permission from the user to access sensors after a button push. This looks like: