AR + GPS Location  3.0.0
All Classes Namespaces Functions Variables Properties Events Pages
ARLocation.ARLocationProvider Class Reference
Inheritance diagram for ARLocation.ARLocationProvider:
ARLocation.Utils.Singleton< ARLocationProvider >

Classes

class  CompassUpdatedUnityEvent
 
class  LocationEnabledUnityEvent
 
class  LocationUpdatedUnityEvent
 

Public Member Functions

override void Awake ()
 
void Mute ()
 
void Unmute (bool emit=true)
 
void ForceLocationUpdate ()
 Force the provider to emit a location update event. This wont force a new read of location, just emit the last available measurement. More...
 
void Pause ()
 Pauses location updates More...
 
void Resume ()
 Resumes location updates More...
 
void Restart ()
 Resets the location provider. More...
 
void OnLocationUpdatedEvent (LocationUpdatedDelegate locationUpdatedDelegate, bool useRawIfEnabled=false)
 Register a delegate to location updates. More...
 
void OnProviderRestartEvent (Action del)
 
void OnCompassUpdatedEvent (CompassUpdateDelegate compassUpdateDelegate)
 Register a delegate to compass/heading updates. More...
 
void OnEnabledEvent (LocationEnabledDelegate del)
 RegisterRegister delegate for when the provider enables location updates. More...
 
void OnFailedEvent (LocationFailedDelegate del)
 Register a delegate for when the provider fails to initialize location services. More...
 
Location GetLocationForWorldPosition (Vector3 position)
 Given a world position vector, return the corresponding geographical Location. More...
 

Public Attributes

LocationProviderOptions LocationProviderSettings = new LocationProviderOptions()
 
LocationData MockLocationData
 
uint MaxWaitTime = 200
 
uint StartUpDelay
 
bool DebugMode
 
LocationEnabledUnityEvent OnEnabled = new LocationEnabledUnityEvent()
 
LocationUpdatedUnityEvent OnLocationUpdated = new LocationUpdatedUnityEvent()
 
LocationUpdatedUnityEvent OnRawLocationUpdated = new LocationUpdatedUnityEvent()
 
CompassUpdatedUnityEvent OnCompassUpdated = new CompassUpdatedUnityEvent()
 
bool IsEnabled => Provider.IsEnabled
 If true, the location provider has received the first location data. More...
 
bool HasStarted => Provider.HasStarted
 If true, the location provider has started, but no location data has been read. More...
 
int LocationUpdateCount => Provider.LocationUpdateCount
 The number of location updates so far. More...
 
bool IsPaused => Provider.Paused
 If true, updates are paused. More...
 
LocationReading CurrentLocation => Provider.CurrentLocation
 The latest location data. More...
 
LocationReading LastLocation => Provider.LastLocation
 The previous location data. More...
 
HeadingReading CurrentHeading => Provider.CurrentHeading
 The current heading data. More...
 
float TimeSinceStart => Time.time - Provider.StartTime
 Time since the location provider has started. More...
 
double DistanceFromStartPoint => Provider.DistanceFromStartPoint
 The distance from the initial measured position. More...
 

Properties

ILocationProvider Provider [get]
 Returns the current location provider. More...
 
- Properties inherited from ARLocation.Utils.Singleton< ARLocationProvider >
static T Instance [get]
 Access singleton instance through this propriety. More...
 

Events

LocationUpdatedDelegate OnLocationUpdatedDelegate
 
CompassUpdateDelegate OnCompassUpdateDelegate
 
Action OnRestartDelegate
 

Detailed Description

Definition at line 16 of file ARLocationProvider.cs.

Member Function Documentation

◆ ForceLocationUpdate()

void ARLocation.ARLocationProvider.ForceLocationUpdate ( )

Force the provider to emit a location update event. This wont force a new read of location, just emit the last available measurement.

Definition at line 223 of file ARLocationProvider.cs.

◆ GetLocationForWorldPosition()

Location ARLocation.ARLocationProvider.GetLocationForWorldPosition ( Vector3  position)

Given a world position vector, return the corresponding geographical Location.

Parameters
position
Returns

Definition at line 323 of file ARLocationProvider.cs.

◆ OnCompassUpdatedEvent()

void ARLocation.ARLocationProvider.OnCompassUpdatedEvent ( CompassUpdateDelegate  compassUpdateDelegate)

Register a delegate to compass/heading updates.

Parameters
compassUpdateDelegate

Definition at line 295 of file ARLocationProvider.cs.

◆ OnEnabledEvent()

void ARLocation.ARLocationProvider.OnEnabledEvent ( LocationEnabledDelegate  del)

RegisterRegister delegate for when the provider enables location updates.

Parameters
delDel.

Definition at line 304 of file ARLocationProvider.cs.

◆ OnFailedEvent()

void ARLocation.ARLocationProvider.OnFailedEvent ( LocationFailedDelegate  del)

Register a delegate for when the provider fails to initialize location services.

Parameters
delDel.

Definition at line 313 of file ARLocationProvider.cs.

◆ OnLocationUpdatedEvent()

void ARLocation.ARLocationProvider.OnLocationUpdatedEvent ( LocationUpdatedDelegate  locationUpdatedDelegate,
bool  useRawIfEnabled = false 
)

Register a delegate to location updates.

The useRawIfEnabled method if for situations where we want the latest data, like when we are adding objects at runtime.

Parameters
locationUpdatedDelegate
useRawIfEnabled

Definition at line 276 of file ARLocationProvider.cs.

◆ Pause()

void ARLocation.ARLocationProvider.Pause ( )

Pauses location updates

Definition at line 242 of file ARLocationProvider.cs.

◆ Restart()

void ARLocation.ARLocationProvider.Restart ( )

Resets the location provider.

Definition at line 260 of file ARLocationProvider.cs.

◆ Resume()

void ARLocation.ARLocationProvider.Resume ( )

Resumes location updates

Definition at line 251 of file ARLocationProvider.cs.

Member Data Documentation

◆ CurrentHeading

HeadingReading ARLocation.ARLocationProvider.CurrentHeading => Provider.CurrentHeading

The current heading data.

Definition at line 98 of file ARLocationProvider.cs.

◆ CurrentLocation

LocationReading ARLocation.ARLocationProvider.CurrentLocation => Provider.CurrentLocation

The latest location data.

Definition at line 88 of file ARLocationProvider.cs.

◆ DistanceFromStartPoint

double ARLocation.ARLocationProvider.DistanceFromStartPoint => Provider.DistanceFromStartPoint

The distance from the initial measured position.

Definition at line 109 of file ARLocationProvider.cs.

◆ HasStarted

bool ARLocation.ARLocationProvider.HasStarted => Provider.HasStarted

If true, the location provider has started, but no location data has been read.

Definition at line 73 of file ARLocationProvider.cs.

◆ IsEnabled

bool ARLocation.ARLocationProvider.IsEnabled => Provider.IsEnabled

If true, the location provider has received the first location data.

Definition at line 68 of file ARLocationProvider.cs.

◆ IsPaused

bool ARLocation.ARLocationProvider.IsPaused => Provider.Paused

If true, updates are paused.

Definition at line 83 of file ARLocationProvider.cs.

◆ LastLocation

LocationReading ARLocation.ARLocationProvider.LastLocation => Provider.LastLocation

The previous location data.

Definition at line 93 of file ARLocationProvider.cs.

◆ LocationUpdateCount

int ARLocation.ARLocationProvider.LocationUpdateCount => Provider.LocationUpdateCount

The number of location updates so far.

Definition at line 78 of file ARLocationProvider.cs.

◆ TimeSinceStart

float ARLocation.ARLocationProvider.TimeSinceStart => Time.time - Provider.StartTime

Time since the location provider has started.

Definition at line 104 of file ARLocationProvider.cs.

Property Documentation

◆ Provider

ILocationProvider ARLocation.ARLocationProvider.Provider
get

Returns the current location provider.

Definition at line 63 of file ARLocationProvider.cs.


The documentation for this class was generated from the following file: