Skip to main content
API Reference NianticSpatial.NSDK.AR.Scanning

ARScanningManager

↳ extends UnityEngine.XR.ARFoundation.SubsystemLifecycleManager

Declaration

public class ARScanningManager : SubsystemLifecycleManager<XRScanningSubsystem, XRScanningSubsystemDescriptor, Provider>

Summary

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.


Properties

NameTypeSummary
EnableRaycastVisualizationbool
Enable raycast visualization for scanning. Required to access the raycast textures.
The data will be available from the GetRaycastColorTexture,
GetRaycastNormalTexture and GetRaycastPositionTexture methods.
Must be set before scanning starts to take effect.
EnableVoxelVisualizationbool
Enable voxel visualization for scanning. Required to compute voxels.
RequestVoxelUpdate must be called to asynchronously compute the voxel buffers.
Then, TryGetVoxelBuffer can be called to get the voxel buffers.
After TryGetVoxelBuffer returns true, the voxel data will be available in the
VoxelPositions, VoxelColors and LatestVoxelSize fields.
Must be set before scanning starts to take effect.
FarDepthfloat
The far depth plane for depth range, in meters.
This parameter controls the farthest distance at which depth data
will be integrated. Objects farther than this distance will not be
visible in visualization or reconstruction.
Must be set before scanning starts to take effect.
FullResolutionEnabledbool
Record full resolution images for scan reconstruction.
Must be set before scanning starts to take effect.
FullResolutionFramerateint
The framerate for full resolution frame recording.
A framerate of zero means the system will use the default framerate of 2 FPS.
Must be set before scanning starts to take effect.
readonly LatestVoxelSizefloat
The size of the voxels in VoxelPositions, in meters.
The voxel visualizer attempts to use the voxel size requested by the MinimumVoxelSize parameter.
As the number of voxels grows, the voxel visualizer periodically doubles the voxel size to keep memory use
in check. This value should be used for rendering the voxels with the correct dimensions.
MinimumVoxelSizefloat
The minimum size of voxels for voxel visualization, in meters.
This parameter sets the initial resolution of the voxel grid used for voxel visualization (see
EnableVoxelVisualization. Smaller values result in higher resolution but require more memory
and computation. The actual voxel size may be larger due to memory constraints, so this is only a minimum
value. Refer to LatestVoxelSize for the correct dimensions when rendering voxels.
Must be set before scanning starts to take effect.
NearDepthfloat
The near depth plane for depth range, in meters.
This parameter controls the closest distance at which depth data
will be integrated. Objects closer than this distance will not be
visible in visualization or reconstruction.
Must be set before scanning starts to take effect.
ScanPathstring
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.
ScanRecordingFramerateint
The scan recording framerate.
A framerate of zero means the system will use the default framerate of 15 FPS.
Must be set before scanning starts to take effect.
ScanTargetIdstring
The scan target ID.
Must be set before scanning starts to take effect.
UseEstimatedDepthbool
Record Niantic depth data if the device does not support platform depth such as lidar.
If platform depth is present, it will be used instead of Niantic depth.
readonly VoxelColorsNativeArray<Color32>
The color of each voxel.
Each entry in the array corresponds to an entry in VoxelPositions at the same index.
These values can only be updated when EnableVoxelVisualization is true and scanning is
in the Started state. Call RequestVoxelUpdate to update the
underlying map, and then call TryGetVoxelBuffer to populate with the latest values.
readonly VoxelNormalsNativeArray<Vector3>
The normal vector of each voxel.
Each entry in the array corresponds to an entry in VoxelPositions at the same index.
These values can only be updated when EnableVoxelVisualization is true and scanning is
in the Started state. Call RequestVoxelUpdate to update the
underlying map, and then call TryGetVoxelBuffer to populate with the latest values.
readonly VoxelPositionsNativeArray<Vector3>
The positions of voxels scanned with the camera.
Each entry in the array corresponds to an entry in VoxelColors at the same index.
These values can only be updated when EnableVoxelVisualization is true and scanning is
in the Started state. Call RequestVoxelUpdate to update the
underlying map, and then call TryGetVoxelBuffer to populate with the latest values.

Methods

NameTypeSummary
GetCurrentScanIdstring
Returns the current scanID. The result is only present when scan is in progress.
GetFrameCountint
Get the number of frames in the current scan. Should be called before calling SaveScan as
frames must be greater than zero to save a scan
GetRaycastColorTextureTexture2D
Read the current raycast color texture.
GetRaycastNormalTextureTexture2D
Read the current raycast normal texture.
GetRaycastPositionTextureTexture2D
Read the current raycast position texture.
GetScanStoreScanStore
-
RequestVoxelUpdatevoid
-
async SaveScanTask
Save the current scan. This stops any further recording immediately, and the coroutine finishes when
the saving is fully complete.
Please call GetFrameCount() to guarantee the scan has frames, as if it doesnt have any, the save will fail
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.
TryGetVoxelBufferbool
-