private void locationUpdatedHandler(LocationReading currentLocation, LocationReading lastLocation) { ARLocation.Utils.Logger.LogFromMethod("WaterMesh", "locationUpdatedHandler", $"({gameObject.name}): locationUpdatedHandler is called."); UpdatePosition(currentLocation.ToLocation()); LocationsStateDataChange.Invoke(state); }
protected bool ShouldUpdateLocation(LocationReading newLocation) { if (isRawTime() && newLocation.timestamp != currentLocation.timestamp) { return(true); } if ((options.maxDistanceFilter > 0) && (LocationReading.HorizontalDistance(rawLocationLast, rawLocationCurrent) > options.maxDistanceFilter)) { return(false); } if ((newLocation.timestamp == currentLocation.timestamp) || (newLocation.timestamp - currentLocation.timestamp < ((long)(options.updateTime * 1000)))) { return(false); } if (LocationReading.HorizontalDistance(newLocation, currentLocation) < options.distanceFilter) { return(false); } if ((newLocation.accuracy > options.accuracyFilter) && (options.accuracyFilter > 0)) { return(false); } return(true); }
private void Provider_LocationUpdated(LocationReading currentLocation, LocationReading lastLocation, DVector3 displacement) { if (onLocationUpdated != null) { onLocationUpdated(currentLocation, lastLocation, displacement); } }
private void LocationUpdated(LocationReading location, LocationReading _, DVector3 delta) { if (isDirty) { BuildSlpine(location.ToLocation()); translation = new Vector3(0, 0, 0); return; } translation += heightRelativeToDevice ? new Vector3((float)delta.x, 0, (float)delta.y) : delta.toVector3(); }
private void LocationUpdated(LocationReading currentLocation, LocationReading lastLocation, DVector3 displacement) { if (isDirty) { BuildSlpine(currentLocation.ToLocation()); translation = new Vector3(0, 0, 0); return; } translation += heightRelativeToDevice ? new Vector3((float)displacement.x, 0, (float)displacement.y) : displacement.toVector3(); }
public void DebugSetPosition(Coordinates coordinates) { LocationReading reading = new LocationReading( coordinates, 0, 0, 0, DateTime.Now); LastReading = reading; if (LocationUpdated != null) { LocationUpdated(this, reading); } }
public void DebugSetPosition(Coordinates coordinates) { LocationReading reading = new LocationReading( coordinates, 0, 0, 0, DateTime.Now); LastReading = reading; if (LocationUpdated != null) { LocationUpdated(this, new LocationUpdaterEventArgs(reading)); } }
protected void UpdateLocation(LocationReading newLocation) { rawLocationLast = rawLocationCurrent; rawLocationCurrent = newLocation; if (!ShouldUpdateLocation(newLocation)) { return; } lastLocation = currentLocation; currentLocation = newLocation; currentDisplacement = Location.VectorFromTo(lastLocation.ToLocation(), currentLocation.ToLocation()); EmitLocationUpdated(); }
public void onLocationUpdated(LocationReading loc) { LocationAccText.text = string.Format("{0}", loc.accuracy.ToString()); //syncContext.AddSynchronizationNodes() }
/// <summary> /// Called when the device location is updated /// </summary> /// <param name="location">Location.</param> /// <param name="accuracy">Accuracy.</param> void HandleLocationUpdatedDelegate(LocationReading currentLocation, LocationReading lastLocation, DVector3 displacement) { UpdatePositions(currentLocation.ToLocation(), displacement); }
protected virtual void OnFirstLocationReading(LocationReading reading) { }
public static double HorizontalDistance(LocationReading a, LocationReading b) { return(Location.HorizontalDistance(a.ToLocation(), b.ToLocation())); }
private void locationUpdatedHandler(LocationReading currentLocation, LocationReading lastLocation) { UpdatePosition(currentLocation.ToLocation()); GpsToWorld.SolveTransforamtion(); }
void Update() { LocationReading reading = null; if (m_running) { if (ApplicationHelper.IsMobile) { if (!m_didStartLocationServices) { m_logger.Debug("Starting location services"); Input.location.Start(); m_didStartLocationServices = true; } if (Input.location.status == LocationServiceStatus.Running) { Coordinates coordinates = new Coordinates { Latitude = Input.location.lastData.latitude, Longitude = Input.location.lastData.longitude }; reading = new LocationReading( coordinates, Input.location.lastData.altitude, Input.location.lastData.horizontalAccuracy, Input.location.lastData.verticalAccuracy, GetTimestamp(Input.location.lastData.timestamp)); } } else { reading = LastReading; } if (reading != null && LocationUpdated != null) { LastReading = reading; LocationUpdated(this, reading); } } else { // !m_running if (ApplicationHelper.IsMobile) { if (Input.location.status == LocationServiceStatus.Running) { m_didStartLocationServices = false; Input.location.Stop(); } } } }
void Update() { LocationReading reading = null; if (m_running) { if (ApplicationHelper.IsMobile) { if (!m_didStartLocationServices) { m_logger.Debug("Starting location services"); Input.location.Start(); m_didStartLocationServices = true; } if (Input.location.status == LocationServiceStatus.Running) { Coordinates coordinates = new Coordinates { Latitude = Input.location.lastData.latitude, Longitude = Input.location.lastData.longitude }; reading = new LocationReading( coordinates, Input.location.lastData.altitude, Input.location.lastData.horizontalAccuracy, Input.location.lastData.verticalAccuracy, GetTimestamp(Input.location.lastData.timestamp)); } } else { reading = LastReading; } if (reading != null && LocationUpdated != null) { if (LastReading != null && LastReading.Timestamp == reading.Timestamp) { return; } LastReading = reading; LocationUpdated(this, new LocationUpdaterEventArgs(reading)); } } else { // !m_running if (ApplicationHelper.IsMobile) { if (Input.location.status == LocationServiceStatus.Running) { m_didStartLocationServices = false; Input.location.Stop(); } } } }