Class: GyroscopePlugin

PSV.plugins~GyroscopePlugin

new GyroscopePlugin (psv, options)

Adds gyroscope controls on mobile devices

Name Type Description
psv PSV.Viewer
options PSV.plugins.GyroscopePlugin.Options

Extends

Members

PSV.plugins.GyroscopePlugin.EVENTS string staticconstant

Available events

id string readonly inherited overrides

Unique identifier of the plugin

Reference to main controller

Methods

destroy () package overrides

isEnabled ()boolean

Checks if the gyroscope is enabled

Returns:
Type Description
boolean

start ()Promise

Enables the gyroscope navigation if available

Fires:
Throws:

if the gyroscope API is not available/granted

Type
PSV.PSVError
Returns:
Type Description
Promise

stop ()

Disables the gyroscope navigation

Fires:

toggle ()

Enables or disables the gyroscope navigation

Type Definitions

PSV.plugins.GyroscopePlugin.Options Object

Properties:
Name Type Argument Default Description
absolutePosition boolean <optional>
false

when true the view will ignore the current direction when enabling gyroscope control

Events

PSV.plugins.GyroscopePlugin.event:gyroscope-updated

Triggered when the gyroscope mode is enabled/disabled

Name Type Description
enabled boolean