# 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 (opens new window). it has to be enabled in the OpenXR plugin settings located under Project Setting > Snapdragon Spaces plugin.

# 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 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 (opens new window) 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.

WARNING

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 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