Plane Detection Overview
Magic Leap 2 tries to understand its environment using feature points and planes.
If a cluster of feature points appears to lie on common horizontal or vertical surfaces, Magic Leap labels this cluster as a geometric plane and classifies it as being a floor, wall, ceiling or platform.
Each detected plane contains information about its alignment, center position, size, and extents. This information can be useful for placing virtual objects that rest on flat surfaces.
This feature requires the SPATIAL_MAPPING
permission to be enabled in your project's Manifest Settings. (Edit > Project Settings > Magic Leap > Manifest Settings)
The Magic Leap 2 uses feature points to detect planes. As a result, flat surfaces without texture, such as a white wall, may not be detected accurately.
📄️ Planes Overview
Magic Leap 2 tries to understand its environment using feature points and planes.
📄️ Planes Query
Note: This example uses the OpenXR version of the Magic Leap 2 Unity SDK. For a previous version using the Unity MLSDK, see here.
📄️ Plane Classification
This example uses the OpenXR Unity API. For a previous version using the Unity MLSDK, see this page.
See also
- AR Foundation Manual
- A quick start guide for AR Foundations.
- AR Foundation Plane Detection
- Unity Guide about using the Plane Manager for plane detection in AR Foundations.
- Unity XR Plane Subsystem
- Unity's overview of the XR plane subsystem.
UnityEngine.XR.ARFoundation.ARPlane
- AR Plane API that shows what type of information can be obtained from each plane.