Skip to main content
Version: 3.3

class ARScanningManager

(Niantic.Lightship.AR.Scanning.ARScanningManager)

Overview

A manager for recording scans of the AR scene for Playback. The recording will start when the manager is enabled. Use SaveScan() to stop and save the recording into the ScanPath.

	class ARScanningManager: SubsystemLifecycleManager< XRScanningSubsystem, XRScanningSubsystemDescriptor, XRScanningSubsystem.Provider > {
public:
// fields

string ScanPath;
bool FullResolutionEnabled;
string ScanTargetId;
bool EnableRaycastVisualization;
bool EnableVoxelVisualization;
bool UseEstimatedDepth;

// properties

int ScanRecordingFramerate;

// methods

Texture2D GetRaycastColorTexture();
Texture2D GetRaycastNormalTexture();
Texture2D GetRaycastPositionTexture();
ScanStore GetScanStore();
async Task SaveScan();
async Task DiscardScan();
string GetCurrentScanId();

protected:
// methods

override void OnBeforeStart();
override void OnDisable();
};

Detailed Documentation

A manager for recording scans of the AR scene for Playback. The recording will start when the manager is enabled. Use SaveScan() to stop and save the recording into the ScanPath.

Fields

ScanPath

string ScanPath

The scan path to store the scan data. If an absolute path is provided (starting with '/', '', or a drive name), the directory must be writable, and the application must have permissions to write to the folder. Otherwise, the path will be interpreted as relative to Application.persistentDataPath.

FullResolutionEnabled

bool FullResolutionEnabled

Record full resolution images for scan reconstruction.

ScanTargetId

string ScanTargetId

The scan target ID. Must be set before scanning starts to take effect.

EnableRaycastVisualization

bool EnableRaycastVisualization

Enable raycast visualization for scanning. Required to access the raycast textures.

EnableVoxelVisualization

bool EnableVoxelVisualization

Enable voxel visualization for scanning. Required to compute voxels.

UseEstimatedDepth

bool UseEstimatedDepth

Use predicted depth data if the device does not have native depth implementation. Required if any visualization is enabled.

Properties

ScanRecordingFramerate

int ScanRecordingFramerate

The scan recording framerate. Must be set before scanning starts to take effect.

Methods

GetRaycastColorTexture

Texture2D GetRaycastColorTexture()

Read the current raycast color texture.

The color texture for raycast visualization, if configured and ready. Otherwise, null.

GetRaycastNormalTexture

Texture2D GetRaycastNormalTexture()

Read the current raycast normal texture.

The normal texture for raycast visualization, if configured and ready. Otherwise, null.

GetRaycastPositionTexture

Texture2D GetRaycastPositionTexture()

Read the current raycast position texture.

The position texture for raycast visualization, if configured and ready. Otherwise, null.

SaveScan

async Task SaveScan()

Save the current scan. This stops any further recording immediately, and the coroutine finishes when the saving is fully complete.

Do not disable the component or exit the app when this is in progress. The scan will not be saved correctly if this process is interrupted.

    Returns:

    

DiscardScan

async Task DiscardScan()

Discard the current scan. This stops further recording immediately, and the coroutine finishes when all existing data is deleted.

    Returns:

    

GetCurrentScanId

string GetCurrentScanId()

Returns the current scanID. The result is only present when scan is in progress.

    Returns: