Skip to main content
Version: 3.6

class WPSManager

(Niantic.Experimental.Lightship.AR.WPS.WPSManager)

Overview

The WPSManager class controls the XRWPSSubsystem and provides access to the underlying AR to world transform from the World Positioning System (WPS).

	class WPSManager: SubsystemLifecycleManager< XRWPSSubsystem, XRWPSSubsystemDescriptor, XRWPSSubsystem.Provider > {
public:
// fields

bool IsAvailable => Status == WPSStatus.Available;
Action<WPSStatus> OnStatusChanged;

// properties

WPSTangentialTransform WorldTransform;
WPSStatus? Status;
WPSCameraHelper DefaultCameraHelper;

// methods

void Update();
void OverrideTransform(WPSTangentialTransform simulatedTransform);
void EndOverride();

protected:
// methods

override void OnDisable();
};

Detailed Documentation

The WPSManager class controls the XRWPSSubsystem and provides access to the underlying AR to world transform from the World Positioning System (WPS).

It is unlikely that an application will need to use the value of WorldTransform directly. For applications requiring only a more accurate/stable version of GPS & compass, the properties on DefaultCameraHelper can be accessed to obtain Latitude, Longitude and Heading values which work similarly to those available through location services.

The transform can also be used to place objects into the AR View using geographic coordinates.

WPSPositioningHelper provides a more convenient interface for adding objects to the scene and updating their positions as WPS data becomes more accurate.

Fields

IsAvailable

bool IsAvailable => Status == WPSStatus.Available

Returns true if WPS is available.

OnStatusChanged

Action<WPSStatus> OnStatusChanged

Action that is called when the status changes

Properties

WorldTransform

WPSTangentialTransform WorldTransform

The current estimate of the transform between the AR tracking coordinates and the world geographic coordinate system. This property should only be used when the Status property is Available, otherwise it is undefined.

Status

WPSStatus? Status

The Status of the WorldTransform estimate. The WorldTransform is only valid when Status is Available.

DefaultCameraHelper

WPSCameraHelper DefaultCameraHelper

A WPSCameraHelper which is automatically generated for the default AR camera

Methods

OverrideTransform

void OverrideTransform(WPSTangentialTransform simulatedTransform)

Overrides the WPS transform with the value specified. This method allows the developer to simulate different locations. The WPSEditorControls class can be used to simulate different locations in the Unity editor.

EndOverride

void EndOverride()

Stops overriding the WPS transform. Use this to switch back to the real transform (on a device) or playback (in the Unity editor)