设备朝向控制器([name])

通过使用设备朝向来确定摄像机的朝向。

例子

[example:misc_controls_deviceorientation misc / controls / deviceorientation ]

构造函数

[name]( [param:Camera object] )

[page:Camera object]: 被控制的摄像机。

创建一个新的 [name] 实例。

Events

change

Fires when the camera has been transformed by the controls.

属性

[property:Number alphaOffset]

alpha角偏移量,以弧度表示,默认为*0*。

[property:Object deviceOrientation]

当前 *deviceorientation* 事件的对象。

[property:Boolean enabled]

是否启用控制器。

[property:Camera object]

被控制的摄像机。

[property:Number screenOrientation]

相对于设备自然朝向的视口朝向,以角度表示(增量为90)。默认为*0*。

方法

[method:null connect] ()

增加控制器的事件监听,并启用控制器。

[method:null disconnect] ()

移除控制器的事件监听,并禁用控制器。

[method:null dispose] ()

若不再需要该控制器,则应当调用此函数。

[method:null update] ()

更新控制器,常被用在动画循环中。

源代码

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