Example #1
0
 /// <summary>
 /// Instantiates origin when scape measurements are returned
 /// </summary>
 /// <param name="scapeMeasurements">
 /// The scapeMesurements struct returned from the API
 /// </param>
 private void OnScapeMeasurementsEvent(ScapeMeasurements scapeMeasurements)
 {
     if (scapeMeasurements.MeasurementsStatus == ScapeMeasurementStatus.ResultsFound)
     {
         InstantiateOrigin(scapeMeasurements.LatLng);
     }
 }
 void OnScapeMeasurementsEvent(ScapeMeasurements scapeMeasurements)
 {
     if (scapeMeasurements.measurementsStatus == ScapeMeasurementStatus.ResultsFound)
     {
         SynchronizeARCamera(scapeMeasurements);
     }
     isFetching = false;
 }
Example #3
0
 /// <summary>
 /// Synchronize camera from scape measurements
 /// </summary>
 /// <param name="scapeMeasurements">
 /// The scapeMesurements struct returned from the API
 /// </param>
 private void OnScapeMeasurementsEvent(ScapeMeasurements scapeMeasurements)
 {
     if (scapeMeasurements.MeasurementsStatus == ScapeMeasurementStatus.ResultsFound)
     {
         SynchronizeARCamera(
             scapeMeasurements.LatLng,
             (float)scapeMeasurements.Heading,
             (float)scapeMeasurements.RawHeightEstimate);
     }
 }
        /// <summary>
        /// An internal function to trigger the ScapeMeasurementsEvent from the underlying implementation
        /// </summary>
        /// <param name="sm">
        /// The ScapeMeasurements returned from the ScapeSession
        /// </param>
        internal virtual void OnScapeMeasurementsEvent(ScapeMeasurements sm)
        {
            this.scapeMeasurementInProgress = false;

            if (this.ScapeMeasurementsEvent != null)
            {
                this.doScapeMeasurementsEvent = true;
                this.lastScapeMeasurements    = sm;
            }
        }
Example #5
0
        /// <summary>
        /// on scape measurements result, print the result to the Text box.
        /// </summary>
        /// <param name="scapeMeasurements">
        /// scapeMeasurements from scape system
        /// </param>
        private void OnScapeMeasurementsEvent(ScapeMeasurements scapeMeasurements)
        {
            if (scapeMeasurements.MeasurementsStatus == ScapeMeasurementStatus.ResultsFound)
            {
                // Use the scape scape position
                newText = "OnScapeMeasurementsEvent:\n" +
                          "timestamp: " + scapeMeasurements.Timestamp + "\n" +
                          "coordinates: " + scapeMeasurements.LatLng.Longitude + " " + scapeMeasurements.LatLng.Latitude + "\n" +
                          "heading: " + scapeMeasurements.Heading + "\n" +
                          "rawHeightEstimate: " + scapeMeasurements.RawHeightEstimate + "\n" +
                          "confidenceScore: " + scapeMeasurements.ConfidenceScore + "\n" +
                          "measurementsStatus: " + scapeMeasurements.MeasurementsStatus + "\n\n";

                updateText        = true;
                setButtonEnabled  = true;
                showLoadingCicles = false;
            }

            ScapeLogging.LogDebug("ScapeSimpleUI::OnScapeMeasurementsEvent()");
        }
        void SynchronizeARCamera(ScapeMeasurements scapeMeasurements)
        {
            Coordinates LocalCoordinates  = GeoConversions.CoordinatesFromVector(new Vector2(PositionAtScapeMeasurements.x, PositionAtScapeMeasurements.z));
            Coordinates OriginCoordinates = new Coordinates()
            {
                longitude = scapeMeasurements.coordinates.longitude - LocalCoordinates.longitude,
                latitude  = scapeMeasurements.coordinates.latitude - LocalCoordinates.latitude
            };

            ScapeLogging.Log(message: "SynchronizeARCamera() scapecoords = " + GeoConversions.CoordinatesToString(scapeMeasurements.coordinates));
            ScapeLogging.Log(message: "SynchronizeARCamera() localcoords = " + GeoConversions.CoordinatesToString(LocalCoordinates));
            ScapeLogging.Log(message: "SynchronizeARCamera() origincoords = " + GeoConversions.CoordinatesToString(OriginCoordinates));

            GeoWorldRoot.GetInstance().SetWorldOrigin(OriginCoordinates);

            Quaternion worldEulerRotation = new Quaternion((float)scapeMeasurements.orientation.x,
                                                           (float)scapeMeasurements.orientation.y,
                                                           (float)scapeMeasurements.orientation.z,
                                                           (float)scapeMeasurements.orientation.w);

            ScapeDirectionFix = worldEulerRotation * Quaternion.Inverse(RotationAtScapeMeasurements);
            ScapeLogging.Log(message: "SynchronizeARCamera() ScapeDirectionFix = " + ScapeDirectionFix);
        }
Example #7
0
 /// <summary>
 /// Callback for ScapeMeasurements update
 /// </summary>
 /// <param name="scapeMeasurements">
 /// the information passed from ScapeKit
 /// </param>
 private void OnScapeMeasurementsEvent(ScapeMeasurements scapeMeasurements)
 {
     ResetUpdateVars();
 }