Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/modules/openxr/doc_classes/OpenXRSpatialAnchorCapability.xml
11323 views
1
<?xml version="1.0" encoding="UTF-8" ?>
2
<class name="OpenXRSpatialAnchorCapability" inherits="OpenXRExtensionWrapper" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">
3
<brief_description>
4
Implementation for handling spatial entity anchor logic.
5
</brief_description>
6
<description>
7
This is an internal class that handles the OpenXR anchor spatial entity extension.
8
</description>
9
<tutorials>
10
</tutorials>
11
<methods>
12
<method name="create_new_anchor">
13
<return type="OpenXRAnchorTracker" />
14
<param index="0" name="transform" type="Transform3D" />
15
<param index="1" name="spatial_context" type="RID" default="RID()" />
16
<description>
17
Creates a new anchor that will be tracked by the XR runtime. The [param transform] should be a transform in the local space of your [XROrigin3D] node. If [param spatial_context] is not specified the default will be used, this requires [member ProjectSettings.xr/openxr/extensions/spatial_entity/enable_builtin_anchor_detection] to be set. The returned tracker will track the location in case our reference space changes.
18
</description>
19
</method>
20
<method name="create_persistence_context">
21
<return type="OpenXRFutureResult" />
22
<param index="0" name="scope" type="int" enum="OpenXRSpatialAnchorCapability.PersistenceScope" />
23
<param index="1" name="user_callback" type="Callable" default="Callable()" />
24
<description>
25
Creates a new persistence context for storing persistent data.
26
[b]Note:[/b] This is an asynchronous method and returns an [OpenXRFutureResult] object with which to track the status, discarding this object will not cancel the creation process. On success [param user_callback] will be called if specified. The result value for this function is the [RID] for our persistence context.
27
</description>
28
</method>
29
<method name="free_persistence_context">
30
<return type="void" />
31
<param index="0" name="persistence_context" type="RID" />
32
<description>
33
Frees a persistence context previously created with [method create_persistence_context].
34
</description>
35
</method>
36
<method name="get_persistence_context_handle" qualifiers="const">
37
<return type="int" />
38
<param index="0" name="persistence_context" type="RID" />
39
<description>
40
Returns the internal handle for this persistence context.
41
[b]Note:[/b] For GDExtension implementations.
42
</description>
43
</method>
44
<method name="is_persistence_scope_supported">
45
<return type="bool" />
46
<param index="0" name="scope" type="int" enum="OpenXRSpatialAnchorCapability.PersistenceScope" />
47
<description>
48
Returns [code]true[/code] if this persistence scope is supported by our spatial anchor capability.
49
[b]Note:[/b] Only valid after an OpenXR instance has been created.
50
</description>
51
</method>
52
<method name="is_spatial_anchor_supported">
53
<return type="bool" />
54
<description>
55
Returns [code]true[/code] if spatial anchors are supported by the hardware. Only returns a valid value after OpenXR has been initialized.
56
</description>
57
</method>
58
<method name="is_spatial_persistence_supported">
59
<return type="bool" />
60
<description>
61
Returns [code]true[/code] if persistent spatial anchors are supported by the hardware. Only returns a valid value after OpenXR has been initialized.
62
</description>
63
</method>
64
<method name="persist_anchor">
65
<return type="OpenXRFutureResult" />
66
<param index="0" name="anchor_tracker" type="OpenXRAnchorTracker" />
67
<param index="1" name="persistence_context" type="RID" default="RID()" />
68
<param index="2" name="user_callback" type="Callable" default="Callable()" />
69
<description>
70
Changes this anchor into a persistent anchor. This means its location will be stored on the device and the anchor will be restored the next time your application starts. If [param persistence_context] is not specified the default will be used, this requires [member ProjectSettings.xr/openxr/extensions/spatial_entity/enable_builtin_anchor_detection] to be set.
71
[b]Note:[/b] This is an asynchronous method and returns an [OpenXRFutureResult] object with which to track the status, discarding this object will not cancel the creation process. On success [param user_callback] will be called if specified. The result value for this function is a boolean which will be set to [code]true[/code] on successful completion.
72
</description>
73
</method>
74
<method name="remove_anchor">
75
<return type="void" />
76
<param index="0" name="anchor_tracker" type="OpenXRAnchorTracker" />
77
<description>
78
Remove an anchor previously created with [method create_new_anchor]. If this anchor was persistent you must first call [method unpersist_anchor] and await its callback.
79
</description>
80
</method>
81
<method name="unpersist_anchor">
82
<return type="OpenXRFutureResult" />
83
<param index="0" name="anchor_tracker" type="OpenXRAnchorTracker" />
84
<param index="1" name="persistence_context" type="RID" default="RID()" />
85
<param index="2" name="user_callback" type="Callable" default="Callable()" />
86
<description>
87
Removes the persistent data from this anchor. The runtime will not recreate the anchor when your application restarts. If [param persistence_context] is not specified the default will be used, this requires [member ProjectSettings.xr/openxr/extensions/spatial_entity/enabled] to be set.
88
[b]Note:[/b] This is an asynchronous method and returns an [OpenXRFutureResult] object with which to track the status, discarding this object will not cancel the creation process. On success [param user_callback] will be called if specified. The result value for this function is a boolean which will be set to [code]true[/code] on successful completion.
89
</description>
90
</method>
91
</methods>
92
<constants>
93
<constant name="PERSISTENCE_SCOPE_SYSTEM_MANAGED" value="1" enum="PersistenceScope">
94
Provides the application with read-only access (i.e. application cannot modify this scope) to spatial entities persisted and managed by the system. The application can use the UUID in the persistence component for this scope to correlate entities across spatial contexts and device reboots.
95
</constant>
96
<constant name="PERSISTENCE_SCOPE_LOCAL_ANCHORS" value="1000781000" enum="PersistenceScope">
97
Persistence operations and data access is limited to spatial anchors, on the same device, for the same user and same app (using [method persist_anchor] and [method unpersist_anchor] functions)
98
</constant>
99
</constants>
100
</class>
101
102