Bitbybit Docs
    Preparing search index...

    Class BabylonWebXRSimple

    One-call entry points into virtual and augmented reality on a WebXR-capable browser and headset: an immersive AR session, or a VR session with teleportation over the ground meshes you name. For finer control, webXr.base creates the experience from full options.

    Index

    Constructors

    scene

    • Starts a default WebXR experience in immersive AR mode, showing the scene over the camera view of the room on a device that supports it.

      Returns Promise<WebXRDefaultExperience>

      The default XR experience

      const xr = await bitbybit.babylon.webXr.simple.createImmersiveARExperience();
      
    • Starts a default WebXR experience in VR with teleportation over the given ground meshes, enough for simple walkthroughs; nothing is given back.

      Parameters

      Returns Promise<void>

      await bitbybit.babylon.webXr.simple.createDefaultXRExperienceWithTeleportation({ groundMeshes: [ground] });
      
    • Starts a default WebXR experience in VR with teleportation over the given ground meshes, as createDefaultXRExperienceWithTeleportation does, and gives back the experience with the near menu, button and text it created plus a dispose function to end it.

      Parameters

      Returns Promise<
          {
              xr: WebXRDefaultExperience;
              torusMat: PBRMetallicRoughnessMaterial;
              manager: GUI3DManager;
              near: NearMenu;
              button: TouchHolographicButton;
              text: TextBlock;
              dispose: () => void;
          },
      >

      The experience, its menu parts and a dispose function

      const session = await bitbybit.babylon.webXr.simple.createDefaultXRExperienceWithTeleportationReturn({ groundMeshes: [ground] });
      session.dispose();