33 lines
928 B
C#
33 lines
928 B
C#
using System;
|
|
using GISTech.GISTerrainLoader;
|
|
using UnityEngine;
|
|
|
|
public class PositionUpdate : MonoBehaviour
|
|
{
|
|
public RealWorldElevation ElevationMode = RealWorldElevation.Altitude;
|
|
|
|
public GISTerrainContainer container;
|
|
|
|
public GISTerrainLoaderGeoPoint point;
|
|
|
|
public WayPoints GeoWaypoints;
|
|
|
|
public AirplaneDemo Airplane;
|
|
|
|
private void Start()
|
|
{
|
|
container.GetStoredHeightmap();
|
|
GeoWaypoints.ConvertLatLonToSpacePosition(container, InstantiateGameObjects: false);
|
|
if (GeoWaypoints.UnityWorldSpacePoints.Count > 0)
|
|
{
|
|
Airplane.TargetPoint = GeoWaypoints.UnityWorldSpacePoints[0];
|
|
}
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
DVector3 dVector = GISTerrainLoaderGeoConversion.UnityWorldSpaceToRealWorldCoordinates(Airplane.transform.position, container, GetElevation: true, ElevationMode);
|
|
point.Unite_TextMesh.text = "NAD83/UTM Zone 10N\n" + dVector.x + "\n" + dVector.y + "\n" + Math.Round(dVector.z, 2) + " m";
|
|
}
|
|
}
|