Esempio n. 1
0
    // Start is called before the first frame update
    void Start()
    {
        wifiMarkers = new List <WifiMarker>();

        if (dataStore.markerData == null)
        {
            dataStore.markerData = new List <WifiMarkerData>();
        }
        // todo add manually here to set up scenario.

        if (spawnMode == WFSpawnMode.Auto)
        {
            foreach (var loadedMarker in dataStore.markerData)
            {
                //var latLongAlt = Api.Instance.SpacesApi.WorldToGeographicPoint(player.transform.position);

                LatLongAltitude latLongAlt = new LatLongAltitude(loadedMarker.Latitude, loadedMarker.Longitude, loadedMarker.Altitude);

                var wifi = Instantiate(spawnWifiObj) as GameObject;
                wifi.GetComponent <GeographicTransform>().SetPosition(latLongAlt.GetLatLong());
                wifi.GetComponent <GeographicTransform>().SetElevation(latLongAlt.GetAltitude());

                var marker = wifi.GetComponent <WifiMarker>();
                marker.markerData.Latitude      = (float)latLongAlt.GetLatitude();
                marker.markerData.Longitude     = (float)latLongAlt.GetLongitude();
                marker.markerData.Altitude      = (float)latLongAlt.GetAltitude();
                marker.markerData.name          = loadedMarker.name;
                marker.markerData.strengthLevel = loadedMarker.strengthLevel;
                marker.EnabledWifiSignaler();
                marker.SetTextName();

                wifiMarkers.Add(marker);
            }
        }
    }
Esempio n. 2
0
 public void SetOriginPoint(LatLongAltitude lla)
 {
     if (m_coordinateSystem == CoordinateSystem.ECEF)
     {
         m_cameraController.MoveTo(lla.GetLatLong());
     }
     else
     {
         m_frame.SetCentralPoint(lla);
     }
 }
Esempio n. 3
0
        public void SetOriginPoint(LatLongAltitude lla)
        {
            m_originECEF = lla.ToECEF();

            if (m_coordinateSystem == CoordinateSystem.ECEF)
            {
                if (m_cameraController.HasControlledCamera)
                {
                    m_cameraController.MoveTo(lla.GetLatLong());
                }
                else
                {
                    UpdateTransforms();
                }
            }
            else
            {
                m_frame.SetCentralPoint(lla);
                UpdateTransforms();
            }
        }
Esempio n. 4
0
        private static void GetTiltHeadingAndDistanceFromCameraAndTargetPosition(LatLong interestPoint, LatLongAltitude cameraPosition, out double tiltDegrees, out double headingDegrees, out double distance)
        {
            double distanceAlongGround = LatLong.EstimateGreatCircleDistance(interestPoint, cameraPosition.GetLatLong());
            double cameraAltitude      = cameraPosition.GetAltitude();

            distance       = Math.Sqrt(distanceAlongGround * distanceAlongGround + cameraAltitude * cameraAltitude);
            headingDegrees = cameraPosition.BearingTo(interestPoint);
            tiltDegrees    = MathsHelpers.Rad2Deg(Math.PI * 0.5 - Math.Atan2(cameraAltitude, distanceAlongGround));
        }
Esempio n. 5
0
 void PlaceBuilding(LatLongAltitude location) //adds building to db cache
 {
     CommonData.firebaseDatabaseManager.GetComponent <FirebaseDatabaseManager>().AddBuildingLocation(location.GetLatLong());
     return;
 }