You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc_classes/OpenXRAndroidAnchorTracker.xml
+54-2Lines changed: 54 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@
6
6
<description>
7
7
An anchor tracker (from [code]XR_ANDROID_trackables[/code]).
8
8
9
-
[OpenXRAndroidAnchorTracker]s can be created by [method OpenXRAndroidTrackablesExtension.create_anchor_tracker].
10
-
All newly created [OpenXRAndroidAnchorTracker]s have up-to-date state, as in, no need to call [method get_location_flags] with [code]update == true[/code].
9
+
[OpenXRAndroidAnchorTracker]s can be created by [method OpenXRAndroidTrackablesExtension.create_anchor_tracker] and [method OpenXRAndroidDeviceAnchorPersistenceExtension.create_persisted_anchor_tracker].
10
+
All newly created [OpenXRAndroidAnchorTracker]s have up-to-date state, as in, no need to call [method get_persist_state] and/or [method get_location_flags] with [code]update == true[/code].
11
11
When an [OpenXRAndroidAnchorTracker] is created by [method OpenXRAndroidTrackablesExtension.create_anchor_tracker], the [code]trackable[/code] parameter can be set to either [code]null[/code] or a plane [OpenXRAndroidTracker].
12
12
The [OpenXRAndroidAnchorTracker] is called a "spatial anchor" when created with a [code]null[/code] [OpenXRAndroidTracker].
13
13
The [OpenXRAndroidAnchorTracker] is called a "plane anchor" when created with a plane [OpenXRAndroidTracker].
@@ -42,10 +42,45 @@
42
42
See [method get_location_flags] for documentation for [param update].
Get the [enum OpenXRAndroidAnchorTracker.PersistState].
50
+
If [param update] is [code]false[/code], then get the cached persist state.
51
+
If [param update] is [code]true[/code], then query the xr runtime for the latest persist state, which may be identical to the cached persist state.
52
+
If the new persist state changed from the cached value, the cached value is updated and [signal persist_state_changed] is emitted.
53
+
</description>
54
+
</method>
55
+
<methodname="get_persist_uuid"qualifiers="const">
56
+
<returntype="StringName" />
57
+
<description>
58
+
Get the persisted anchor uuid, represented as a [StringName].
59
+
The returned [StringName] is non-empty if this anchor tracker is persisting or persisted. See also [method get_persist_state] to get the actual persisted state.
60
+
The returned [StringName] is empty if this anchor tracker is not persisted.
61
+
</description>
62
+
</method>
45
63
<methodname="get_tracker"qualifiers="const">
46
64
<returntype="OpenXRAndroidTracker" />
47
65
<description>
48
66
Return the [OpenXRAndroidTracker] that this [OpenXRAndroidAnchorTracker] was created with.
67
+
This method always returns [code]null[/code] for [OpenXRAndroidAnchorTracker]s created with [method OpenXRAndroidDeviceAnchorPersistenceExtension.create_persisted_anchor_tracker], even if the original anchor was created with an [OpenXRAndroidTracker].
68
+
</description>
69
+
</method>
70
+
<methodname="persist">
71
+
<returntype="bool" />
72
+
<description>
73
+
Persist this anchor tracker if it isn't already.
74
+
Returns true if the anchor tracker was persisted successfully, or it was already persisted.
75
+
NOTE: it takes some time for the xr runtime to persist an anchor tracker (usually less than a second, but sometimes longer). Connect to [signal persist_state_changed] to be notified when this tracker is persisting.
76
+
</description>
77
+
</method>
78
+
<methodname="unpersist">
79
+
<returntype="bool" />
80
+
<description>
81
+
Unpersist this anchor tracker if it isn't already.
82
+
Returns true if the anchor tracker was unpersisted successfully, or it was already unpersisted.
83
+
NOTE: it takes some time for the xr runtime to unpersist an anchor tracker (usually less than a second, but sometimes longer). Connect to [signal persist_state_changed] to be notified when this tracker is unpersisted.
49
84
</description>
50
85
</method>
51
86
</methods>
@@ -56,6 +91,11 @@
56
91
This signal is not emitted when a location's pose changes, however this tracker's [code]default[/code] pose is modified (and consequently its signal is also emitted) when the location transform changes.
57
92
</description>
58
93
</signal>
94
+
<signalname="persist_state_changed">
95
+
<description>
96
+
Signal emitted when the persist state changes, which can be retrieved with [method get_persist_state].
Implementation for creating and handling persisted anchor trackers (from [code]XR_ANDROID_device_anchor_persistence[/code]).
5
+
</brief_description>
6
+
<description>
7
+
Implementation for creating and handling persisted anchor trackers (from [code]XR_ANDROID_device_anchor_persistence[/code]).
8
+
See also [OpenXRAndroidTrackablesExtension].
9
+
</description>
10
+
<tutorials>
11
+
</tutorials>
12
+
<methods>
13
+
<methodname="create_persisted_anchor_tracker">
14
+
<returntype="OpenXRAndroidAnchorTracker" />
15
+
<paramindex="0"name="uuid"type="StringName" />
16
+
<description>
17
+
Create a [OpenXRAndroidAnchorTracker] from a persisted [param uuid].
18
+
Repeat calls to [method create_persisted_anchor_tracker] with the same [param uuid], without unpersisting, will return the same [OpenXRAndroidAnchorTracker] instance.
19
+
[param uuid] could have come from [method get_all_persisted_anchors], [method persist_anchor_tracker], or from a cache that an app may have stored in a previous session.
20
+
</description>
21
+
</method>
22
+
<methodname="get_all_persisted_anchors">
23
+
<returntype="StringName[]" />
24
+
<description>
25
+
Retrieve an [Array] of persisted anchor uuids, as [StringName]s, that have been previously persisted with [method persist_anchor_tracker] by the app.
26
+
Persisted anchors are returned even after restarting the app or rebooting the device, as long as the anchor was never unpersisted (see [method unpersist_anchor_tracker]).
27
+
Persisted anchors from other apps are not returned.
If a [OpenXRAndroidAnchorTracker] instance was already created for [param uuid] (via [method create_persisted_anchor_tracker]), then [method OpenXRAndroidAnchorTracker.get_persist_state] is called.
56
+
Otherwise, the persist state is found from the [param uuid] and [param update] is ignored.
Retrieve all [OpenXRAndroidAnchorTracker]s that have been created from persisted anchor trackers since the last time the app was restarted.
63
+
The number of anchor trackers returned by this function will always be less than, or equal to, the number of persisted anchor uuids returned by [method get_all_persisted_anchors].
Copy file name to clipboardExpand all lines: doc_classes/OpenXRAndroidTrackablesExtension.xml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -105,7 +105,7 @@
105
105
<methodname="update_anchor_trackers">
106
106
<returntype="void" />
107
107
<description>
108
-
Update all anchor trackers; updating their pose (see [method OpenXRAndroidAnchorTracker.get_location_pose]).
108
+
Update all anchor trackers; updating their pose and persist state (see [method OpenXRAndroidAnchorTracker.get_persist_state] and [method OpenXRAndroidAnchorTracker.get_location_pose]).
109
109
This API is called automatically by default (see [method set_anchor_tracker_update_cooldown]).
0 commit comments