[name]

Can be used to orient the camera based on the mobile device's orientation.

Example

[example:misc_controls_deviceorientation misc / controls / deviceorientation ]

Constructor

[name]( [param:Camera object] )

[page:Camera object]: The camera to be controlled.

Creates a new instance of [name].

Properties

[property:Number alphaOffset]

The alpha offset in radians. Default is *0*.

[property:Object deviceOrientation]

The current *deviceorientation* event object.

[property:Boolean enabled]

Whether or not the controls are enabled.

[property:Camera object]

The camera to be controlled.

[property:Number screenOrientation]

The orientation in degrees (in 90-degree increments) of the viewport relative to the device's natural orientation. Default is *0*.

Methods

[method:null connect] ()

Adds the event listeners of the controls and enables it.

[method:null disconnect] ()

Removes the event listeners of the controls and disables it.

[method:null dispose] ()

Should be called if the controls is no longer required.

[method:null update] ()

Updates the controls. Usually called in the animation loop.

Source

[link:https://github.com/mrdoob/three.js/blob/master/examples/js/controls/DeviceOrientationControls.js examples/js/controls/DeviceOrientationControls.js]