interface IMarkerSyncer (Niantic.ARDK.AR.SLAM.IMarkerSyncer)

Overview

System to sync Unity-space coordinates of multiple peers using a marker (ex. QRCode, image). More...

interface IMarkerSyncer: IDisposable {
    // properties

    Guid StageIdentifier;

    // methods

    void ScanMarkerOnDevice(
        IARCamera arCamera,
        Vector2[] scannedPointLocations,
        double timestamp
    );

    void ScanStationaryMarker(
        IARCamera arCamera,
        Matrix4x4 markerWorldTransform,
        Vector3[] markerPointPositions,
        Vector2[] scannedPointPositions,
        double timestamp
    );

    void SendMarkerInformation(Vector3[] pointLocations);
};

Detailed Documentation

System to sync Unity-space coordinates of multiple peers using a marker (ex. QRCode, image).

Properties

Guid StageIdentifier

An identifier used internally to relate different systems. This is the identifier for the LocationService system.

Methods

void ScanMarkerOnDevice(
    IARCamera arCamera,
    Vector2[] scannedPointLocations,
    double timestamp
)

Use to sync using a scan of a marker displayed on the host peer's device screen

Parameters:

arCamera

ARCamera instance from the ARFrame that the marker was scanned on.

scannedPointLocations

Screen-space locations of scanned marker points (unit: pixels). Points must be in the same order as in the corners argument in the SendMarkerInformation method.

timestamp

void ScanStationaryMarker(
    IARCamera arCamera,
    Matrix4x4 markerWorldTransform,
    Vector3[] markerPointPositions,
    Vector2[] scannedPointPositions,
    double timestamp
)

Use to sync using a scan of a marker that is placed in the real world. In this use case, make sure the real world coordinate space has gravity aligned on the y-axis (ie y-axis is up/down).

Parameters:

arCamera

ARCamera instance from the ARFrame that the marker was scanned on.

markerWorldTransform

Real world-space position (unit: meters) and orientation of the marker relative to the origin of the shared AR space.

markerPointPositions

Real world-space positions (unit: meters) of the marker points relative to the markerWorldTransform . Points must be in the same order as in the scannedPointLocations argument.

scannedPointPositions

Screen-space locations (unit: pixels) of the scanned marker points. Points must be in the same order as in markerPointLocations.

timestamp

void SendMarkerInformation(Vector3[] pointLocations)

Use to publish information about the marker displayed on a host peer's device.

Parameters:

pointLocations

Real-world space locations of the marker points (unit: meters). Points must be in the same order as in the scannedPointLocations argument of the ScanMarkerOnDevice method.