protected void Update() { if (Database != null && UserObject != null) { Database.ApplyCameraPosition(UserObject.transform.position); if (AltitudeText != null) { float altitudeInMeters = UserObject.transform.position.y * 10; AltitudeText.text = string.Format("m: {0:N2}, ft: {1:N2}, FL: {2:N2}", altitudeInMeters, altitudeInMeters * Cognitics.UnityCDB.VolumetricFeature.feetPerMeter, altitudeInMeters * Cognitics.UnityCDB.VolumetricFeature.feetPerMeter * Cognitics.UnityCDB.VolumetricFeature.flightLevelPerFoot); } } if (CameraPositionPanel != null) { CameraPosition campos = CameraPositionPanel.GetComponent <CameraPosition>(); float x = UserObject.transform.position.x; float z = UserObject.transform.position.z; var cartesianCoordinates = new CartesianCoordinates(x, z); var geographicCoordinates = cartesianCoordinates.TransformedWith(Database.Projection); campos.position.x = (float)geographicCoordinates.Longitude; campos.position.z = (float)geographicCoordinates.Latitude; campos.position.y = UserObject.transform.position.y / (float)Database.Projection.Scale; } }
//////////////////////////////////////////////////////////// void Update() { Database.ApplyCameraPosition(UserObject.transform.position); }