Additional Features
Overview
Overview
This guide explains the essential elements and attributes that you need to include in your Android Manifest file to deploy an OpenXR application to the Magic Leap 2 device. The Android Manifest file is an XML file that describes the basic characteristics of your application, such as its name, icon, permissions, features, and activities. It is located in the root directory of your project and has the name AndroidManifest.xml. For more information about the general syntax and structure of the Android Manifest file, you can refer to the Android Developer Guide.
For developers familiar with C++ but new to OpenXR, check out the OpenXR Tutorial by Khronos, the organization behind the OpenXR standard. This tutorial serves as a step-by-step guide, introducing you to essential OpenXR APIs and concepts. You will learn how to set up your development environment, initialize OpenXR, render graphics, handle input, and explore the OpenXR features and extensions. Learn More
This document describes how to build a Magic Leap 2 application using Unity.
Overview
This section outlines the steps required to build the Magic Leap OpenXR Samples using the build.py script from the command line. Before attempting to build the samples, please complete the environment setup steps in Environment Setup. The build script uses gradle to build each of the applications.
Prerequisites
This guide walks you through setting up your environment for native development on Magic Leap 2. By the end of the guide, you will have everything necessary to build and run the Magic Leap OpenXR samples, allowing you to explore the capabilities of OpenXR on Magic Leap 2 and develop your own AR applications.
Magic Leap Unity (OpenXR) Examples
An examples project is available to download from ML Hub that demonstrates how to use several of the Magic Leap plugins included in the Magic Leap Unreal sdk.
Hand joint pose tracking is provided by Epic's OpenXRHandTracking plugin, but this does not include functionality for detecting hand gestures.
Khronos' OpenXR SDK Source repo includes the helloxr sample app. This application can be used as a starting point to understand the basic functionality of OpenXR on a given device.
For the Magic Leap Native API (C-API) article about visual stability, see Improve Visual Stability (C-API).
The MagicLeap OpenXR plugin is required by all other plugins in the SDK that wrap OpenXR apis.
The Magic Leap Hub (ML 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.
You can use the "Magic Leap Marker Tracking" plugin to detect and locate fiducial markers in your project.
In order for an existing Magic Leap 2 Unity application to continue working under OpenXR, here are the minimum steps required:
This page includes a list of the MLSDK APIs and their equivalents available through OpenXR Extensions and standard Android APIs.
Use the following chart to see if your project is compatible with MRTK 2.8 or MRTK 3.0.
Object Alignment is a sample application that demonstrates how to attach large scale 3D content, such as digital twin meshes, to a spatial localization map such that the 3D content remains stuck to the world as the user moves around a large space.
We are proud to announce that Magic Leap 2 is now conformant with OpenXR. As an early contributor in the development of OpenXR, we're committed to building an open and accessible augmented reality (AR) ecosystem that benefits enterprises and developers across industries.
The transition to OpenXR involves the phasing out of MLSDK in favor of OpenXR extensions. To align with this change, Magic Leap’s Unity SDK is shifting from Unity's platform specific XR Plugin (ie: com.unity.xr.magicleap) to Unity's OpenXR Plugin (com.unity.xr.openxr). This shift is accompanied by the addition of new OpenXR Features and API for accessing the functions previously defined by MLSDK C-APIs. This document will outline the rationale behind the move to OpenXR, detail the steps involved in the migration process, and provide insights into the changes and enhancements introduced by this transition.
This example uses the OpenXR Unity API. For a previous version using the Unity MLSDK, see this page.
Magic Leap 2 tries to understand its environment using feature points and planes.
Note: This example uses the OpenXR version of the Magic Leap 2 Unity SDK. For a previous version using the Unity MLSDK, see here.
Remote Rendering with OpenXR
This section includes information about the Magic Leap 2 OpenXR Rendering Extensions Feature that will make your content appear more robust.
L - Without Secondary View R - With Secondary View
This section walks through the options you have for starting a session in Application Simulator that you can use to run your app. You can use ML C API or Unity apps.
These Magic Leap 2 features are supported for Unreal Engine 5.3 with Magic Leap 2 SDK for Unreal Engine 5 (Magic Leap Unreal SDK).
This section reviews different steps you can take to troubleshoot problems you may encounter when using Application Simulator. Topics covered include:
This section provides information on how to create a Player Rig that is compatible with Magic Leap 2 and is driven by the user's head and controller movement controller. This can be done by either: