Class: VRButtonViewModel

VRButtonViewModel

new VRButtonViewModel(scene, vrElement)

View model of VRButton.

Name Type Default Description
scene Scene

Scene.

vrElement Element | String document.body optional

The element or ID to enter VR mode.

Members

commandCommand

Get the command to switch VR mode.

isVREnabledBoolean

Get or set whether VR functionality is enabled.

See:
  • Fullscreen.enabled

isVRModeBoolean

Determine whether the VR mode is activated.

tooltipString

Get tooltips. This attribute is observable.

vrElementElement

Get or set the HTML element to be placed in VR mode when the corresponding button is pressed.

Methods

destroy()

Destroy the view model. When the view model is no longer needed, it should be called to properly clean up the view model.

isDestroyed(){Boolean}

Returns:
Type Description
Boolean If the object has been destroyed, it is true; otherwise, it is false.