AREarthManager
Provides localization in Earth-relative coordinates.
ARCoreExtensionsConfig.GeospatialMode
must be GeospatialMode.Enabled
in order to make use of the Geospatial API. Not all devices support GeospatialMode.Enabled
, use AREarthManager.IsGeospatialModeSupported
to find whether the current device supports enabling this mode.
AREarthManager.CameraGeospatialPose
should only be used when AREarthManager.EarthTrackingState
is TrackingState.Tracking
, and otherwise should not be used. If the EarthTrackingState
does not become Tracking
, then AREarthManager.EarthState
may contain more information on this failure.
Summary
Inheritance
Inherits from:UnityEngine::MonoBehaviour
Properties |
|
---|---|
CameraGeospatialPose
|
Gets the
GeospatialPose for the camera in the latest frame, describing the geodedic position of the device. |
EarthState
|
Gets the
EarthState for the latest frame. |
EarthTrackingState
|
Gets the tracking state of Earth for the latest frame.
|
Public static functions |
|
---|---|
CheckVpsAvailability(double latitude, double longitude)
|
Deprecated.
Please use CheckVpsAvailabilityAsync(double, double) instead. Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position. |
CheckVpsAvailabilityAsync(double latitude, double longitude)
|
Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position.
|
Public functions |
|
---|---|
Convert(Pose pose)
|
Gets the
GeospatialPose from a local pose relative to camera, relative to the last frame. |
Convert(GeospatialPose geospatialPose)
|
Gets the local pose relative to camera from the
GeospatialPose . |
IsGeospatialModeSupported(GeospatialMode mode)
|
Checks whether the provided
GeospatialMode is supported on this device. |
Properties
CameraGeospatialPose
GeospatialPose CameraGeospatialPose
Gets the GeospatialPose
for the camera in the latest frame, describing the geodedic position of the device.
The position of the pose is located at the device's camera, while the orientation closely approximates the orientation of the display.
Note: This pose is only valid when EarthTrackingState
is TrackingState.Tracking
; otherwise, it should not be used.
EarthTrackingState
TrackingState EarthTrackingState
Gets the tracking state of Earth for the latest frame.
Public static functions
CheckVpsAvailability
VpsAvailabilityPromise CheckVpsAvailability( double latitude, double longitude )
Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position.
The availability of VPS in a given location helps to improve the quality of Geospatial localization and tracking accuracy. See the developer's guide on VPS availability.
This launches an asynchronous operation used to query the Google Cloud ARCore API. See InterruptiblePromise
for information on obtaining results and cancelling the operation.
Your app must be properly set up to communicate with the Google Cloud ARCore API in order to obtain a result from this call. See Enable the Geospatial API for more details on required permissions and setup steps.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Returns a
VpsAvailabilityPromise . See InterruptiblePromise for more information on how to retrieve results from the Promise. |
Deprecated.
Please use CheckVpsAvailabilityAsync(double, double)
instead.
CheckVpsAvailabilityAsync
VpsAvailabilityPromise CheckVpsAvailabilityAsync( double latitude, double longitude )
Gets the availability of the Visual Positioning System (VPS) at a specified horizontal position.
The availability of VPS in a given location helps to improve the quality of Geospatial localization and tracking accuracy. See the developer's guide on VPS availability.
This launches an asynchronous operation used to query the Google Cloud ARCore API. See InterruptiblePromise
for information on obtaining results and cancelling the operation.
Your app must be properly set up to communicate with the Google Cloud ARCore API in order to obtain a result from this call. See Enable the Geospatial API for more details on required permissions and setup steps.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
Returns a
VpsAvailabilityPromise used in a Unity Coroutine. It updates its results in frame update events. See Check VPS Availability for a usage example. |
Public functions
Convert
GeospatialPose Convert( Pose pose )
Gets the GeospatialPose
from a local pose relative to camera, relative to the last frame.
The rotation quaternion of GeospatialPose
is a rotation with respect to an East-Up-North coordinate frame. An identity quaternion will have the anchor oriented such that X+ points to the east, Y+ points up away from the center of the earth, and Z+ points to the north.
EarthTrackingState
must be in the TrackingState.Tracking
state for this to return a valid pose. The Heading
property will be zero for a GeospatialPose
returned by this method.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Convert
Pose Convert( GeospatialPose geospatialPose )
Gets the local pose relative to camera from the GeospatialPose
.
AREarthManager.EarthTrackingState
must be in the TrackingState.Tracking
state for this to return a valid pose.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
A
Pose . |
IsGeospatialModeSupported
FeatureSupported IsGeospatialModeSupported( GeospatialMode mode )
Checks whether the provided GeospatialMode
is supported on this device.
The current list of supported devices is documented on the ARCore supported devices page. A device may be incompatible with a given mode due to insufficient sensor capabilities.
Details | |||
---|---|---|---|
Parameters |
|
||
Returns |
Indicates whether the given mode is supported on this device. It will return
FeatureSupported.Unknown if the session is still under initialization. |