Class: DeviceOrientationControls

DeviceOrientationControls(object, options)

new DeviceOrientationControls(object, options)

Create an instance of DeviceOrientationControls.
Parameters:
Name Type Description
object Object the object to attach the controls to (usually your Three.js camera)
options Object options for DeviceOrientationControls: currently accepts smoothingFactor, enablePermissionDialog
Source:

Methods

connect()

Update the device orientation controls. Should be called from your three.js rendering/animation function. Permission handling now factored out into requestOrientationPermissions() Therefore, connect() should now only be called once permission has been granted, ie after the "deviceorientationgranted" event has been emitted. This is a breaking change and now means that you need to call connect() yourself - previously it was done automatically.
Source:

init()

Initialise device orientation controls. Should be called after you have created the DeviceOrientationControls object and set up the deviceorientationgranted and deviceorientationerror event handlers.
Source:

Events

deviceorientationerror

Device orientation error event.
Parameters:
Name Type Description
error Object object with 'code' and 'message' fields.
Source:

deviceorientationgranted

Device orientation granted event.
Parameters:
Name Type Description
event Object object with 'target' field, referencing the DeviceOrientationControls object.
Source: