示例#1
0
 internal Vector3 GeographicToWorldPoint(LatLongAltitude position, Camera camera)
 {
     if (m_coordinateSystem == CoordinateSystem.UnityWorld)
     {
         return(m_frame.ECEFToLocalSpace(position.ToECEF()));
     }
     else
     {
         return((position.ToECEF() - m_originECEF).ToSingleVector());
     }
 }
示例#2
0
 internal Vector3 GeographicToViewportPoint(LatLongAltitude position, Camera camera)
 {
     if (m_coordinateSystem == CoordinateSystem.UnityWorld)
     {
         var point = m_frame.ECEFToLocalSpace(position.ToECEF());
         return(camera.WorldToViewportPoint(point));
     }
     else
     {
         var point = (position.ToECEF() - m_originECEF).ToSingleVector();
         return(camera.WorldToViewportPoint(point));
     }
 }
示例#3
0
        internal Vector3 GeographicToWorldPoint(LatLongAltitude position)
        {
            Vector3 mapSpacePoint;

            if (m_coordinateSystem == CoordinateSystem.UnityWorld)
            {
                mapSpacePoint = m_frame.ECEFToLocalSpace(position.ToECEF());
            }
            else
            {
                mapSpacePoint = (position.ToECEF() - m_originECEF).ToSingleVector();
            }

            return(m_root.transform.TransformPoint(mapSpacePoint));
        }
示例#4
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();
            }
        }
示例#5
0
        public static DoubleVector3 LatLongAltToEcefDegrees(double latitudeInRadians, double longitudeInRadians, double altitudeInMeters)
        {
            LatLongAltitude latLongAlt = new LatLongAltitude(MathsHelpers.Rad2Deg(latitudeInRadians), MathsHelpers.Rad2Deg(longitudeInRadians), altitudeInMeters);

            return(latLongAlt.ToECEF());
        }