Capítulo 628 de 859

Chapter 628: XRButton

Core Idea

A utility class for creating a button that allows to initiate immersive XR sessions based on WebXR. The button can be created with a factory method and then appended ot the website's DOM.

Compared to ARButton and VRButton, this class will try to offer an immersive AR session first. If the device does not support this type of session, it uses an immersive VR session.

Code Examples

document.body.appendChild( XRButton.createButton( renderer ) );
  • What it demonstrates: Typical usage of XRButton.

Key Takeaways

  1. XRButton has no documented properties/methods beyond what's shown above — check the source link for implementation details.

Connects To