Skip to main content

Plane Detection Sample

This sample demonstrates how to visualize tracked planes found in the real world. For basic information about custom trackable object updates and what Unreal Engine's AR Trackable Notify component does, please refer to the Unreal Engine documentation.

How the sample works

By default, when the sample is opened, it generates simple shapes for the detected planes. When the Use Convex Hull detection option is enabled, the sample generates complex shapes using the convex hull of the detected planes.

It's also possible to display the wireframe of these geometries.

Planes Detection UI

Plane AR Manager

The BP_PlaneARManager blueprint file (located under SnapdragonSpacesSamples Content > SnapdragonSpaces > Samples > PlaneDetection > Placeable) centralizes the actions of creating and destroying planes as augmented geometries through an event system. This blueprint binds events from the AR Trackable Notify component to react to AR trackable planes changes. The following events are related to plane detection:

  • On Add/Update/Remove Tracked Plane: These events are called when the system is using simple plane geometry.
  • On Add/Update/Remove Tracked Geometry: These events are called when the system is using complex plane geometry.
    • In contrast to the other cases, different types of objects can be registered as UARTrackedGeometry. To verify that it is a convex plane, its object classification should be EARObjectClassification::NotApplicable. Please, use the GetObjectClassification function to make sure.Object classification for convex planes

Remember to change the state of ToggleARCapture to restart the detection, selecting ON when the actor behavior begins, and stop the detection, selecting OFF when finished, to destroy all generated AR geometries.

Complex AR Session Config

When the user enables the convex option, the system starts using the D_ConvexHullSessionConfig asset (located under SnapdragonSpacesSamples Content > SnapdragonSpaces > Samples > PlaneDetection > Core) to detect the complex planes.

The options related to plane detection are:

  • Use Convex Hull Detection
  • Horizontal Plane Detection
  • Vertical Plane Detection

Feature Settings

Feature settings can be found by clicking the gear icon next to Plane Detection feature in the OpenXR project settings.

  • Use Scene Understanding:
    • Enabling or disabling this setting will have different results in terms of the shape and number of planes detected.
    • Enabling this setting will enable the use of Scene Understanding to detect planes. This makes use of the same technology used by the Spatial Meshing (Experimental) feature.

Differences Between Default and Scene Understanding-based Plane Detection

MetricDefaultScene Understanding
Detection Speed and First DetectionNormalFast
False PositivesFew false positivesProne to false positives
Plane AccuracyHighHigh
Number of PlanesFewMany
Plane Updates and MovementStable with unlikely updatesDynamic with more plane updates
Plane Orientation FilterFilter options for horizontal and verticalNo filter options
Hit TestingAs expected against planeHit test against mesh