interface IScanner (Niantic.ARDK.AR.Scanning.IScanner)

Overview

Performs 3D scanning and reconstruction. More…

interface IScanner {
    // enums

    enum State;

    // structs

    struct ScanProcessedArgs;
    struct StateChangedArgs;
    struct VisualizationUpdatedArgs;

    // events

    event ScanProcessed();
    event StateChanged();
    event VisualizationUpdated();

    // methods

    void CancelProcessing();
    float GetProcessingProgress();
    string GetScanId();
    IScanQualityClassifier GetScanQualityClassifier();
    IScanStore GetScanStore();
    State GetState();
    void PauseScanning();
    void Restart();
    void ResumeScanning();
    void SetScanTargetId(string scanTargetId);
    void StartProcessing(ReconstructionOptions reconstructionOptions);
    void StartScanning(ScanningOptions scanningOptions);
    void StopScanning();
};

Detailed Documentation

Performs 3D scanning and reconstruction.

Events

event ScanProcessed()

Invoked when the scan has successfully finished processing.

event StateChanged()

Invoked when the state of the scanner changes. See State for more information on the scanner states and transitions between them.

event VisualizationUpdated()

Invoked when the scanning visualization is updated.

Methods

void CancelProcessing()

Cancel processing that is currently in progress.

  • This can be called in the Processing state.

  • The scanner will transition to the Cancelling state.

  • When cancellation is complete (typically within a few seconds), the scanner will transition to the Cancelled state.

float GetProcessingProgress()

Returns the current progress of scan processing, as a value between 0 and 1.

string GetScanId()

Returns a unique ID for the current scan. The scan ID is valid after the scan has started (i.e. once the scanner has entered the Scanning state).

IScanQualityClassifier GetScanQualityClassifier()

Returns a scan quality classifier.

IScanStore GetScanStore()

Returns the scan store. This can be used to save and load scans.

State GetState()

Returns the current state of the scanner. See State for details on the scanner states and transitions between them.

void PauseScanning()

Temporarily pauses a scan that is in progress.

The scan can be resumed later by calling ResumeScanning.

  • This can be called in the Scanning state.

  • The scanner will transition to the Paused state.

void Restart()

Reset the scanner for another scan.

void ResumeScanning()

Resumes a scan that has been paused.

  • This can be called in the Paused state.

  • The scanner will transition to the Scanning state.

void SetScanTargetId(string scanTargetId)

Set the scan target ID for the current scan. You must call this method prior to saving the scan if you intend to upload it for VPS activation.

A scan target represents a location that can be scanned and activated for VPS. You can find scan targets near the user and obtain their IDs using IScanTargetClient.

Calling Restart will clear the scan target ID.

Parameters:

scanTargetId

the ID of the scan target for the current scan

void StartProcessing(ReconstructionOptions reconstructionOptions)

Starts processing a scan.

Processing generates a TexturedMesh from the raw scan data. Depending on the options and the, processing capabilities of the user’s device, this may take anywhere from a few seconds to several minutes.

The caller should listen for the ScanProcessed event to receive the TexturedMesh when processing is complete.

Parameters:

reconstructionOptions

options controlling the reconstruction of the scan

void StartScanning(ScanningOptions scanningOptions)

Start scanning with the given options.

  • This can be called in the Ready state.

  • The scanner will transition to the Scanning state.

void StopScanning()

Ends the current scan.