示例#1
0
 private void UpdateGlobeMarker()
 {
     if (markerTracker.tracked == true)
     {
         latLongValue.latitude  = Mathf.Clamp(90f * (markerTarget.transform.InverseTransformPoint(mapTarget.transform.position).z) / scaleFactorZ, -90, 90);
         latLongValue.longitude = Mathf.Clamp(180f * (markerTarget.transform.InverseTransformPoint(mapTarget.transform.position).x) / scaleFactorX, -180, 180);
         Vector3 relativePosition = LatLongValue.Get3DPoint(latLongValue, 1, 0, 0, true) * scaleFactorGlobe;
         //Adjusts for the rotation of the "Globe" gameobject
         transform.localPosition = new Vector3(relativePosition.z, -relativePosition.x, -relativePosition.y);
     }
     transform.rotation = Quaternion.LookRotation(transform.position - globe.transform.position);
 }
示例#2
0
 public LatLongValue GetLatLonFrom3DPoint(Vector3 point)
 {
     return(LatLongValue.GetLatLonFrom3DPoint(point, transformToWrap));
 }
示例#3
0
 private void Start()
 {
     latLongValue = new LatLongValue(0, 0, 0);
 }