C-API Samples Overview
The list below contains descriptions of each of the C-API samples available in the ML Hub. The README.md files of each example contain instructions on how to build, install and uninstall the example, as well as its expected behavior and GUI.
Content Placement Strategies
The Magic Leap 2 has a variety of sensors and tracking capabilities that enable the creation of experiences where virtual content appears to stick and behave as though it were part of the user’s physical environment. As a developer of XR applications, you have the challenging task of leveraging all of the myriad features and technologies exposed by the platform to build experiences that work as well as possible on the hardware given your particular use case. Incorporating the user’s physical environment into your application is both a technical and a design challenge that is unique to developing for XR platforms where the user is able to see their physical surroundings. You’ll need to understand what technologies are available, and the tradeoffs between them, to effectively design experiences that blend virtual objects with physical spaces as seamlessly as possible.
Occlusion
Magic Leap 2's Occlusion API offers developers a way to enhance immersion in mixed reality applications by generating a mesh representation of nearby physical objects. This allows virtual objects to interact with the real world in a more believable way by appearing to be occluded (or "masked") by real-world objects.
Plane Classification
This example uses the OpenXR Unity API. For a previous version using the Unity MLSDK, see this page.
Plane Classification
Learn how the Magic Leap classifies surfaces.
Plane Detection
Plane Extraction enables users to extract rectangular planar regions from the world reconstruction model. Plane candidates are returned as simple geometric rectangles.
Plane Detection
Learn how to detect surfaces using the Magic Leap SDK.
Plane Detection
An overview of the planes demo scene included in the Magic Leap 2 Examples Project, which uses Unity's XR Interaction Toolkit.
Planes Overview
Magic Leap 2 tries to understand its environment using feature points and planes.
Query Planes
Learn how to query planes Magic Leap that were detected by the Magic Leap.
Real-time World Sensing
Magic Leap 2's Meshing and Plane Finding APIs provide facilities for applications to understand the real-world surfaces around the user in real-time using the time of flight depth sensor on the device. Apps can use this representation to occlude rendering, place digital objects, and for physics-based interactions or ray-casting. The depth sensor has the resolution of 544 x 480 and a field of view of 75° (h) x 70°.