public LocalizationSession(MarkerVisualDetectorSpatialLocalizer localizer, MarkerVisualDetectorLocalizationSettings settings, IPeerConnection peerConnection, bool debugLogging = false)
            {
                DebugLog("Session created");
                this.localizer      = localizer;
                this.settings       = settings;
                this.peerConnection = peerConnection;
                this.debugLogging   = debugLogging;

                this.coordinateAssigned = new TaskCompletionSource <string>();
                this.coordinateService  = new MarkerDetectorCoordinateService(this.localizer.markerDetector, debugLogging);
                this.discoveryCTS       = new CancellationTokenSource();
            }
            public LocalizationSession(MarkerVisualSpatialLocalizer localizer, MarkerVisualLocalizationSettings settings, IPeerConnection peerConnection, bool debugLogging = false) : base()
            {
                DebugLog("Session created");
                this.localizer      = localizer;
                this.settings       = settings;
                this.peerConnection = peerConnection;
                this.debugLogging   = debugLogging;

                coordinateAssigned = new TaskCompletionSource <string>();
                coordinateFound    = new TaskCompletionSource <string>();
                discoveryCTS       = new CancellationTokenSource();

                var cameraToMarker = Matrix4x4.TRS(this.localizer.markerVisualPosition, Quaternion.Euler(this.localizer.markerVisualRotation), Vector3.one);

                this.coordinateService = new MarkerVisualCoordinateService(this.localizer.markerVisual, cameraToMarker, this.localizer.cameraTransform, this.localizer.debugLogging);
            }
コード例 #3
0
 /// <summary>
 /// Attempts to create a new coordinate with this service.
 /// </summary>
 /// <param name="localPosition">Position at which the coordinate should be created.</param>
 /// <param name="localRotation">Orientation the coordinate should be created with.</param>
 /// <returns>The coordinate if the coordinate was succesfully created, otherwise null.</returns>
 public static Task <ISpatialCoordinate> TryCreateCoordinateAsync(this ISpatialCoordinateService spatialCoordinateService, UVector3 vector, UQuaternion quaternion, CancellationToken cancellationToken)
 {
     return(spatialCoordinateService.TryCreateCoordinateAsync(vector.AsNumericsVector(), quaternion.AsNumericsQuaternion(), cancellationToken));
 }