Skip to main content
Version: 20 Mar 2024

Magic Leap OpenXR Samples

The Magic Leap Hub includes a set of samples that demonstrate some of Magic Leap's device specific features. These samples can be downloaded via ML Hub's Package Manager and then built using Android Studio or a command line interface using the build.py script.

Prerequisites

Sample Applications

  • eye_gaze : Demonstrates how to use the OpenXR XR_EXT_eye_gaze_interaction extension. When looking around you should see where you're looking (a cube will float in air to match the direction of your gaze!). Bubbles will be float up around you, which you can pop using your gaze!
  • hand_tracking : Demonstrates how to use the OpenXR XR_EXT_hand_tracking extension. When looking at your hands you should see cubes at your finger joints. Bubbles will float up around you which you can pop using your hands.
  • marker_tracking : Demonstrates how to use the OpenXR XR_ML_marker_understanding extension. An imgui dialog with a series of marker tracking settings that can be adjusted and re-applied to a marker detector client. These settings determine what type of marker to track and how we want to profile our marker detector. Detected markers will be displayed at the bottom with the respective data associated with the marker. Currently, only Aruco, QR, and April Tag will have a corresponding rendered cube associated with the marker upon detection.
  • palm_pose : Demonstrates how to use the OpenXR XR_EXT_palm_pose extension. The app draws a simplified hand model to better visualize the palm pose values. Because of the simplicity of the hand meshes a few details have been added to discern if models for both hands have correct poses.
  • plane_detection : Demonstrates how to use the OpenXR XR_EXT_plane_detection extension. An spatial dialog will be visible showing the capabilities of the plane detection system. It will also show a few checkboxes controlling the operating mode of the detection.

Download OpenXR Samples

You can download the OpenXR samples from the Package Manager in ML Hub.

  1. Open the ML Hub and select the Package Manager tile.
The ML Hub with the Package Manger option selected.
  1. In the Bundles section, select Native. Then, in the additional packages section, select OpenXR Samples.
The Package Manager with the OpenXR Samples option selected.
You can also download the OpenXR Samples separately.
  1. Inside the Package Manager, select All.
The the Package Manger with the **All** tab selected.
  1. Find the OpenXR Samples under the Common Packages section and select the download icon.
The Package Manager with the OpenXR Samples option selected.

Building the Samples

Before attempting to build the samples, please complete the environment setup steps in Environment Setup. Once your environment is configured, you can build the samples using Android Studio or Command line.