TryGetGeolocation
Declaration
public bool TryGetGeolocation(Pose pose, out XRVps2Geolocation geolocationOut)
Summary
Remarks
The pose is in AR session space, not Unity world space. To convert a world-space
transform, bring it into session space first via
origin.TrackablesParent.InverseTransformPose. The heading is the direction of the
pose's forward axis projected onto the horizontal plane, which matches
CameraDirection in TryGetDeviceGeolocation.
DeviceTop is not offered because it depends on the display
orientation, which an arbitrary pose does not have. The heading is not meaningful when
the forward axis points straight up or down, or close to it. The pose can be any pose,
not just the camera's.
Returns
false if the subsystem is unavailable or VPS2 has not localized yet.
Parameters
| Name | Type | Summary |
|---|---|---|
| pose | Pose | The pose in AR session space, with position in meters. |
| geolocationOut | out XRVps2Geolocation | Receives the geolocation on success. |
Attempts to convert a pose in AR session space to a position and orientation in the
global coordinate system, using the latest VPS2 localization. The inverse of
TryGetPose.