Skip to main content
API Reference com.nianticspatial.nsdk.scanning

ScanningSession

↳ extends SessionBase
A session for 3D scanning and visualization functionality. The scanning feature capabilities for capturing, processing, and exporting 3D scan data from AR sessions. Scans of a location can be processed by the Visual Positioning System's (VPS's) cloud services to enable VPS localization.

Declaration

class ScanningSession

Properties

NameTypeSummary
ardkHandleLong
-

Functions

NameTypeSummary
computeVoxelsvoid
Compute the voxelization of the scanned scene. Processing is asynchronous. Call this function and then call [voxelBuffer] to retrieve voxel data. > Note: Voxel visualization must have been enabled in the configuration.
configurevoid
Configure the session with the specified settings. > Note: It is only valid to call this when the session is stopped. > Note: Configuration is asynchronous and can fail later, even if this call does not throw an error. Use [getFeatureStatus()] to check there are no issues.
createvoid
-
exportScanString?
Exports the scan data as an archive file. This method processes the saved scan data and exports it to a standard archive format that can be used with external 3D processing tools or Niantic's VPS map. > Note: This function is blocking and may take a while to execute. See [RecordingExporter] for a non-blocking option.
featureStatusFeatureStatus
Reports errors that have occurred with processes running inside this feature. Check this periodically to see if any errors have occurred with processes running inside this feature. Once an error has been flagged, it will remain flagged until the culprit process has been run again and completed successfully.
getRecordingInfoRecordingInfo
-
onDestroyvoid
-
onInitvoid
-
raycastBufferRaycastBuffer?
Get the most recently computed raycast buffers. Once the session has been started and all the requested data has been sent through the ARDK session, a buffer should become available after a brief computation period. > Note: Raycast visualization must have been enabled in the configuration.
saveAsyncResult<ScanSaveInfo, ScanSaveError>
Asynchronously saves the current scan and polls until the operation is complete. This function initiates the save operation and then suspends until the save process finishes, either with a success, a failure, or a timeout.
startvoid
Start scanning. "Scanning" here refers to up to three processes: recording the input AR data, raycasting, and voxelization, depending on how the feature is configured.
stopvoid
Stop all scanning processes. This halts active scanning while keeping the scanner instance alive. You can restart scanning later with [start]. > Note: If recording is in progress, this will stop recording (and all other processes) and discard any unsaved scan data.
voxelBufferVoxelBuffer?
Get the most recently computed voxel data. Once the session has been started and all the requested data has been sent through the ARDK session, a new buffer should become available after a brief computation period after [computeVoxels] has been called. > Note: Voxel visualization must have been enabled in the configuration.