本文へスキップ

class ARPersistentAnchorManager

(Niantic.Lightship.AR.PersistentAnchors.ARPersistentAnchorManager)

概要

永続的なアンカーを管理します。

	class ARPersistentAnchorManager:ARTrackableManager< XRPersistentAnchorSubsystem, XRPersistentAnchorSubsystemDescriptor, XRPersistentAnchorSubsystem.Provider, XRPersistentAnchor, ARPersistentAnchor > {
public
// プロパティ

float InterpolationTimeSeconds;
bool ContinuousLocalizationEnabled;
bool InterpolationEnabled;
bool TemporalFusionEnabled;
int JpegCompressionQuality;
bool TransformUpdateSmoothingEnabled;
float InitialServiceRequestIntervalSeconds;
float ContinuousServiceRequestIntervalSeconds;
bool DiagnosticsEnabled;
float DeviceMappingLocalizationRequestIntervalSeconds;
bool CloudLocalizationEnabled;
bool DeviceMappingLocalizationEnabled;
DeviceMappingType DeviceMappingType;
bool DeviceMapDownloadEnabled;

// イベント

event arPersistentAnchorStateChanged();
event DebugInfoUpdated();

// メソッド

async Task RestartSubsystemAsync();
IEnumerator RestartSubsystemAsyncCoroutine();
bool GetVpsSessionId(out string vpsSessionId)

bool TryCreateAnchor(
Pose anchorLocalPose,
out ARPersistentAnchor arPersistentAnchor
);

bool TryTrackAnchor(
ARPersistentAnchorPayload payload,
out ARPersistentAnchor arPersistentAnchor
);

void DestroyAnchor(ARPersistentAnchor arPersistentAnchor);

protected
//

override string gameObjectName => "Persistent Anchor";

// methods

override GameObject GetPrefab();
override void OnEnable();
override void OnBeforeStart();
virtual void Start()
override void OnDisable();
override void OnDestroy();

override void OnTrackablesChanged(
List<ARPersistentAnchor> added,
List<ARPersistentAnchor> updated,
List<ARPersistentAnchor> removed
);
};

// 直接の子孫

class ARLocationManager

詳細なドキュメント

永続的なアンカーを管理します。

このコンポーネントを使用して、プログラムによって永続的なアンカーの復元や削除、クエリを行います。 永続的なアンカーとは、処理されたスキャンによって生成される、世界における永続的なポーズのことで、今後のセッションでも同じ現実世界の場所に存在する。 仮想コンテンツを永続的なアンカーに相対的に配置することで、将来のセッションで現実世界の同じ位置に復元することができます。

永続的なアンカーを管理するための低レベルのAPIです。 Unity Editorでバーチャルコンテンツをオーサリングする場合は、代わりにARLocationManagerとARLocationsを使用してください。

ARPersistentAnchorManager.arPersistentAnchorStateChangedイベントで変更(追加、更新、削除)をサブスクライブします。

    参照

    ARTrackableManager<TSubsystem,TSubsystemDescriptor,TProvider,TSessionRelativeData,TTrackable>

フィールド

gameObjectName

override string gameObjectName => "Persistent Anchor"

ARPersistentAnchorごとにインスタンス化されるGameObjectに割り当てる名前

Properties

InterpolationTimeSeconds

float InterpolationTimeSeconds

アンカー補間が行われる秒数。 タイムが速いほど、動きはより顕著になります。

.. 注::

これは実験的な機能であり、予告なく変更または廃止されることがあります

ContinuousLocalizationEnabled

bool ContinuousLocalizationEnabled

連続ローカライズを有効にするか無効にするか

InterpolationEnabled

bool InterpolationEnabled

レガシーなMonoBehaviour駆動補間を有効または無効にするかどうか。このプロパティの代わりに、ネイティブ・ソリューション "TransformUpdateSmoothingEnabled "を使用することを推奨します。

TemporalFusionEnabled

bool TemporalFusionEnabled

テンポラルフュージョンを有効にするか無効にするか。 フュージョンは複数のローカライズ結果を平均化し、より安定したローカライズを提供する。

JpegCompressionQuality

int JpegCompressionQuality

ローカライズ画像の JPEG 圧縮品質を定義します。 これはクラウド・ローカリゼーションにのみ適用される。 圧縮率を低くすると、帯域幅の使用量が少なくなります。ローカライズの品質低下を避けるため、20以上にすることをお勧めします。

TransformUpdateSmoothingEnabled

bool TransformUpdateSmoothingEnabled

トランスフォーム更新のスムージングを有効にするか無効にするか

InitialServiceRequestIntervalSeconds

float InitialServiceRequestIntervalSeconds

初期ローカリゼーションのためのサーバーリクエスト間の秒数。 0値は、可能な限り多くのリクエストを意味する。

ContinuousServiceRequestIntervalSeconds

float ContinuousServiceRequestIntervalSeconds

継続的なローカリゼーションのためのサーバーリクエスト間の秒数。 0値は、可能な限り多くのリクエストを意味する。

DiagnosticsEnabled

bool DiagnosticsEnabled

フレーム診断を有効にするか無効にするか DebugInfoUpdatedイベントをリッスンして診断データを取得する

DeviceMappingLocalizationRequestIntervalSeconds

float DeviceMappingLocalizationRequestIntervalSeconds

Device Mapping のローカリゼーション要求の間隔を定義します。 毎フレーム処理する場合は0に設定する。

DeviceMappingLocalizationEnabled

bool DeviceMappingLocalizationEnabled

デバイスのローカライズを有効にする

.. 注::

これは実験的な機能であり、予告なく変更または廃止されることがあります

DeviceMappingType

DeviceMappingType DeviceMappingType

デバイスのローカライズで学習済み機能を有効にする

.. 注::

これは実験的な機能であり、予告なく変更または廃止されることがあります

DeviceMapDownloadEnabled

bool DeviceMapDownloadEnabled

デバイスのローカライゼーションのために地図のダウンロードを有効にするか無効にするか 地図は当社のクラウドからダウンロードされ、GPSの位置に基づいています。

.. 注::

これは実験的な機能であり、予告なく変更または廃止されることがあります

イベント

arPersistentAnchorStateChanged

event arPersistentAnchorStateChanged()

アンカーの状態が変化すると呼び出されます。

このイベントの各呼び出しには、このフレームで状態またはポーズが変更された1つのPersistent Anchorが含まれます。 argのarPersistentAnchorのTrackingStateを問い合わせて、新しいTrackingStateを決定する。 arPersistentAnchor の PredictedPose を問い合わせて、新しい PredictedPose を決定します。

DebugInfoUpdated

event DebugInfoUpdated()

デバッグ情報が取得可能になると呼び出されます。

このイベントの各呼び出しは、XRPersintAnchorNetworkRequestStatus、XRPersintAnchorLocalizationStatus、およびXRPersintAnchorFrameDiagnosticsの配列を含むXRPersintAnchorDebugInfoオブジェクトを含みます。

メソッド

GetPrefab

override GameObject GetPrefab()

ARPersistentAnchorを作成するときに使用するプレハブ。 NULLの場合は、新しいGameObjectが作成されます。

OnTrackablesChanged

override void OnTrackablesChanged(
List<ARPersistentAnchor> added,
List<ARPersistentAnchor> updated,
List<ARPersistentAnchor> removed
)

ベースクラスで追跡可能な変更が検出されると呼び出されます。

    パラメーター:

    added - 追加されたアンカーのリスト。

    updated - 更新されたアンカーのリスト。

    removed - 削除されたアンカーのリスト。

RestartSubsystemAsync

async Task RestartSubsystemAsync()

サブシステムを現在のコンフィギュレーションで非同期に再起動する。 これにより、すべてのアンカーが削除され、サブシステムが停止してから再起動する。

RestartSubsystemAsyncCoroutine

IEnumerator RestartSubsystemAsyncCoroutine()

サブシステムを現在のコンフィギュレーションで非同期に再起動する。 これにより、すべてのアンカーが削除され、サブシステムが停止してから再起動する。

GetVpsSessionId

bool GetVpsSessionId(out string vpsSessionId)

vpsセッションIDを取得します(32文字の16進数大文字文字列) vpsセッションは、指定されたアンカーセットに対して最初のTryTrackAnchorと最後のDestroyAnchorの間で定義されます。

    パラメーター:

    vpsSessionId - vps セッション id で、32 文字の 16 進大文字の文字列。

    戻り値:

    True vpsセッションIDを取得できる場合 False vpsセッションが実行されていない場合

TryCreateAnchor

bool TryCreateAnchor(
Pose anchorLocalPose,
out ARPersistentAnchor arPersistentAnchor
)

ポーズからアンカーを作る

.. 注::

これは実験的な機能であり、予告なく変更または廃止されることがあります

    パラメーター:

    anchorLocalPose - 作成するアンカーの localToCamera。

    arPersistentAnchor - ポーズから作成されたARPersistentAnchor

    戻り値:

    True アンカーがトラッキングのために正常にクレート/追加された場合。 False アンカーをクレートに入れることはできません。

TryTrackAnchor

bool TryTrackAnchor(
ARPersistentAnchorPayload payload,
out ARPersistentAnchor arPersistentAnchor
)

ペイロードから永続的なアンカーを復元します。 Anchor GameObjectが直ちに返るため、子オブジェクトを追加できますが、適切な位置や回転はTrackingStateがTrackingになるまで適用されません。

    パラメーター:

    payload - 復元するアンカーのペイロード

    arPersistentAnchor - ペイロードから作成されたARPersistentAnchor

    戻り値:

    トラッキングのためにアンカーが正常に追加された場合はTrue アンカーを追加できない、すでに追加されている、ペイロードが無効である場合はFalse

DestroyAnchor

void DestroyAnchor(ARPersistentAnchor arPersistentAnchor)

アンカーを破壊し、トラッキングを停止します。

    パラメーター:

    arPersistentAnchor- 破棄するアンカー