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()); } }
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)); } }
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)); }
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(); } }
public static DoubleVector3 LatLongAltToEcefDegrees(double latitudeInRadians, double longitudeInRadians, double altitudeInMeters) { LatLongAltitude latLongAlt = new LatLongAltitude(MathsHelpers.Rad2Deg(latitudeInRadians), MathsHelpers.Rad2Deg(longitudeInRadians), altitudeInMeters); return(latLongAlt.ToECEF()); }