Google. XR. ARCoreExtensions. ARAnchorManagerExtensions
Extensions to AR Foundation's ARAnchorManager class.
Summary
Public static functions |
|
---|---|
AddCloudReferencePoint(this ARAnchorManager referencePointManager, ARAnchor referencePoint)
|
Deprecated.
Please use HostCloudAnchor(ARAnchor) instead. Creates a new cloud reference point using an existing local Reference Point. |
EstimateFeatureMapQualityForHosting(this ARAnchorManager anchorManager, Pose pose)
|
Estimates the quality of the visual feature points seen by ARCore in the preceding few seconds and visible from the provided camera pose .
|
HostCloudAnchor(this ARAnchorManager anchorManager, ARAnchor anchor)
|
Creates a new Cloud Anchor using an existing local ARAnchor.
|
HostCloudAnchor(this ARAnchorManager anchorManager, ARAnchor anchor, int ttlDays)
|
Creates a new Cloud Anchor with a given lifetime using an existing local ARAnchor.
|
ResolveCloudAnchorId(this ARAnchorManager anchorManager, string cloudAnchorId)
|
Creates a new local Cloud Anchor from the provided Id.
|
ResolveCloudReferenceId(this ARAnchorManager referencePointManager, string cloudReferenceId)
|
Deprecated.
Please use ResolveCloudAnchorId(string) instead. Creates a new local cloud reference point from the provided Id. |
SetAuthToken(this ARAnchorManager anchorManager, string authToken)
|
void
Set the token to use when authenticating with the ARCore Cloud Anchor service on the iOS platform.
|
Public static functions
AddCloudReferencePoint
ARCloudReferencePoint AddCloudReferencePoint( this ARAnchorManager referencePointManager, ARAnchor referencePoint )
Creates a new cloud reference point using an existing local Reference Point.
Deprecated. Please use HostCloudAnchor(ARAnchor) instead.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
If successful, a
ARCloudReferencePoint , otherwise null . |
EstimateFeatureMapQualityForHosting
FeatureMapQuality EstimateFeatureMapQualityForHosting( this ARAnchorManager anchorManager, Pose pose )
Estimates the quality of the visual feature points seen by ARCore in the preceding few seconds and visible from the provided camera pose .
Cloud Anchors hosted using higher feature map quality will generally result in easier and more accurately resolved ARCloudAnchor
poses. If feature map quality cannot be estimated for the given pose , a warning message "Failed to estimate feature map quality" with the error status is logged and FeatureMapQuality
.Insufficient
is returned.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
The estimated feature map quality.
|
HostCloudAnchor
ARCloudAnchor HostCloudAnchor( this ARAnchorManager anchorManager, ARAnchor anchor )
Creates a new Cloud Anchor using an existing local ARAnchor.
The sample code below illustrates how to host a Cloud Anchor.
private ARCloudAnchor _cloudAnchor;
void HostCloudAnchor(Pose pose)
{
// Create a local anchor, you may also use another ARAnchor you already have.
ARAnchor localAnchor = AnchorManager.AddAnchor(pose);
// Request the Cloud Anchor.
_cloudAnchor = AnchorManager.HostCloudAnchor(localAnchor);
}
void Update()
{
if (_cloudAnchor)
{
// Check the Cloud Anchor state.
CloudAnchorState cloudAnchorState = _cloudAnchor.cloudAnchorState;
if (cloudAnchorState == CloudAnchorState.Success)
{
myOtherGameObject.transform.SetParent(_cloudAnchor.transform, false);
_cloudAnchor = null;
}
else if (cloudAnchorState == CloudAnchorState.TaskInProgress)
{
// Wait, not ready yet.
}
else
{
// An error has occurred.
}
}
}
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
If successful, a
ARCloudAnchor , otherwise null . |
HostCloudAnchor
ARCloudAnchor HostCloudAnchor( this ARAnchorManager anchorManager, ARAnchor anchor, int ttlDays )
Creates a new Cloud Anchor with a given lifetime using an existing local ARAnchor.
Details | |||||||
---|---|---|---|---|---|---|---|
Parameters |
|
||||||
Returns |
If successful, an
ARCloudAnchor , otherwise null . |
ResolveCloudAnchorId
ARCloudAnchor ResolveCloudAnchorId( this ARAnchorManager anchorManager, string cloudAnchorId )
Creates a new local Cloud Anchor from the provided Id.
The sample code below illustrates how to resolve a Cloud Anchor.
private ARCloudAnchor _cloudAnchor;
void ResolveCloudAnchor(string cloudAnchorId)
{
// Request the Cloud Anchor.
_cloudAnchor = AnchorManager.ResolveCloudAnchorId(cloudAnchorId);
}
void Update()
{
if (_cloudAnchor)
{
// Check the Cloud Anchor state.
CloudAnchorState cloudAnchorState = _cloudAnchor.cloudAnchorState;
if (cloudAnchorState == CloudAnchorState.Success)
{
myOtherGameObject.transform.SetParent(_cloudAnchor.transform, false);
_cloudAnchor = null;
}
else if (cloudAnchorState == CloudAnchorState.TaskInProgress)
{
// Wait, not ready yet.
}
else
{
// An error has occurred.
}
}
}
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
If successful, a
ARCloudAnchor , otherwise null . |
ResolveCloudReferenceId
ARCloudReferencePoint ResolveCloudReferenceId( this ARAnchorManager referencePointManager, string cloudReferenceId )
Creates a new local cloud reference point from the provided Id.
Deprecated. Please use ResolveCloudAnchorId(string) instead.
Details | |||||
---|---|---|---|---|---|
Parameters |
|
||||
Returns |
If successful, a
ARCloudReferencePoint , otherwise null . |
SetAuthToken
void SetAuthToken( this ARAnchorManager anchorManager, string authToken )
Set the token to use when authenticating with the ARCore Cloud Anchor service on the iOS platform.
This should be called each time the application's token is refreshed.
Details | |||||
---|---|---|---|---|---|
Parameters |
|