Scene Setup
This guide assumes pre-existing knowledge of XR Development in Unreal engine. For a more detailed overview, please visit the introductory documentation page.
The Snapdragon Spaces Samples contain ready-to-use blueprints for common AR use cases.
Core Blueprints
These blueprints are prepared to work in an AR environment and are the basis for the sample project.
The GM_SpacesSamples
(located under SnapdragonSpacesSamples Content > SnapdragonSpaces > Common > Core) defines the rules of an experience. Currently, it only sets the default pawn class to custom BP_SpacesPawn
. To avoid customizing it for each map, go to Project Settings > Maps & Modes and overwrite the Default GameMode.
In Unreal Engine, a pawn is the physical representation of the user and defines how the user interacts with the world. The custom BP_SpacesPawn
(located under SnapdragonSpacesSamples Content > SnapdragonSpaces > Common > Core) can be used with a gaze or 3DoF controller for interaction. Furthermore, it also includes an implementation of these interaction controllers for testing them in the editor.
The D_SpacesSessionConfig
(located under SnapdragonSpacesSamples Content > SnapdragonSpaces > Common > Core) defines what features are used in the AR session. For basic information about this asset, please refer to the Unreal documentation. Currently, BP_SpacesPawn
defines the session config that is being used in the samples.
Passthrough (Only for MR devices)
Passthrough refers to the possibility to bring the physical environment as an image to VR devices. It can be enabled or disabled through a new widget with a Passthrough checkbox attached to Main Menu. This widget will only be active for the user if the device is Passthrough compatible. The check is done at BeginPlay
in the BP_SpacesWidget_MainMenu
blueprint with the new function IsPassthroughSupported()
, that will retrieve a bool if Passthrough is supported in the SpacesEngineSubsystem
.
The checkbox on WBP_SpacesPassthrough
calls the function SetPassthroughEnabled(bool)
from SpacesEngineSubsystem
, that will set the new value of bPassthroughEnabled
, which will enable the user to see or hide the physical environment image. Another way of calling SetPassthroughEnabled(bool)
is by using the input SwitchPassthrough
that is bound to XRController(L) X
and XRController(R) A
.
The value of bPassthroughEnabled
can be accessed anytime with GetPassthroughEnabled()
or by binding when it is changed with delegate OnChangePassthrough
.