class WPSPositioningHelper
(Niantic.Experimental.Lightship.AR.WPS.WPSPositioningHelper)
Overview
WPSPositioningHelper provides a simple way to position objects using geographic coordinates. When an object is added it will be automatically updated as the accuracy of the WPS datta improves.
class WPSPositioningHelper: MonoBehaviour {
public:
enumAltitudeMode;
class WorldPosition;
// fields
float _altitudeOffset = 0.0f;
// methods
void AddOrUpdateObject(
GameObject gameObject,
double latitude,
double longitude,
double altitude,
Quaternion rotationXYZToEUN
);
void RemoveObject(GameObject gameObject);
void RemoveAllObjects();
};
Detailed Documentation
WPSPositioningHelper provides a simple way to position objects using geographic coordinates. When an object is added it will be automatically updated as the accuracy of the WPS datta improves.
Methods
AddOrUpdateObject
void AddOrUpdateObject(
GameObject gameObject,
double latitude,
double longitude,
double altitude,
Quaternion rotationXYZToEUN
)
Adds an object using a world geographic position, or updates the position if it has already been added through a previous call to this method. Updating is only rquired for dynamic objects where the world position needs to change. The object will be added to the scene and placed at the corresponding location in the unity scene. If the WPS data becomes more accurate, the object position will be automatically updated.
Parameters:
gameObject
- The GameObject to add
latitude
- The latitude where the object should be placed
longitude
- The longitude where the object should be place
altitude
- The altitude where the object should be place
rotationXYZToEUN
- The rotation from object coordinates to world East-Up-North coordinates
RemoveObject
void RemoveObject(GameObject gameObject)
Removes the object from the scene and stops updating the position based on WPS data. This should only be called for objects which were previously added through a call to AddOrUpdateObject.
Parameters:
gameObject
- The object to remove and stop updating
RemoveAllObjects
void RemoveAllObjects()
Removes all objects from the scene which were previously added through a call to AddOrUpdateObject. The positions will no longer be updated using WPS data.