interface IScanVisualizer (Niantic.ARDK.Extensions.Scanning.IScanVisualizer)

Overview

Interface implemented by scanning visualizations attached to the ARScanManager. More…

interface IScanVisualizer {
    // methods

    void ClearCurrentVisualizationState();
    void OnScanProgress(IVoxelBuffer voxels, IRaycastBuffer raycast);
    bool RequiresRaycastData();
    bool RequiresVoxelData();
    void SetVisualizationActive(bool active);
};

// direct descendants

class PointCloudVisualizer;
class RaycastScanVisualizer;
class WorldSpaceScanVisualizer;

Detailed Documentation

Interface implemented by scanning visualizations attached to the ARScanManager.

Visualizers can be used to provide visual feedback to the user while they are scanning. They are attached to the current ARScanManager by calling ARScanManager.SetVisualizer.

Several implementations of this interface are provided as part of the ARDK:

Methods

void ClearCurrentVisualizationState()

Called to reset the visualizer’s state. The previous voxel / raycast buffers are no longer valid.

void OnScanProgress(IVoxelBuffer voxels, IRaycastBuffer raycast)

Called when new scan visualization data is available. The visualizer should update its visualization to reflect the latest data.

Parameters:

voxels

Voxel data for the current scene. This will be null if RequiresVoxelData return false.

raycast

Buffer generated from a raycast of the scene from the current camera viewpoint. This will be null if RequiresRaycastData return false.

bool RequiresRaycastData()

Return true if the visualization requires an IRaycastBuffer to be provided to OnScanProgress and false otherwise.

bool RequiresVoxelData()

Return true if the visualization requires an IVoxelBuffer to be provided to OnScanProgress and false otherwise.

void SetVisualizationActive(bool active)

Called when the visualizer should be enabled or disabled.

Parameters:

active

true if the visualization should be enabled