Path: blob/master/modules/openxr/doc_classes/OpenXRSpatialAnchorCapability.xml
11323 views
<?xml version="1.0" encoding="UTF-8" ?>1<class name="OpenXRSpatialAnchorCapability" inherits="OpenXRExtensionWrapper" experimental="" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../doc/class.xsd">2<brief_description>3Implementation for handling spatial entity anchor logic.4</brief_description>5<description>6This is an internal class that handles the OpenXR anchor spatial entity extension.7</description>8<tutorials>9</tutorials>10<methods>11<method name="create_new_anchor">12<return type="OpenXRAnchorTracker" />13<param index="0" name="transform" type="Transform3D" />14<param index="1" name="spatial_context" type="RID" default="RID()" />15<description>16Creates 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.17</description>18</method>19<method name="create_persistence_context">20<return type="OpenXRFutureResult" />21<param index="0" name="scope" type="int" enum="OpenXRSpatialAnchorCapability.PersistenceScope" />22<param index="1" name="user_callback" type="Callable" default="Callable()" />23<description>24Creates a new persistence context for storing persistent data.25[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.26</description>27</method>28<method name="free_persistence_context">29<return type="void" />30<param index="0" name="persistence_context" type="RID" />31<description>32Frees a persistence context previously created with [method create_persistence_context].33</description>34</method>35<method name="get_persistence_context_handle" qualifiers="const">36<return type="int" />37<param index="0" name="persistence_context" type="RID" />38<description>39Returns the internal handle for this persistence context.40[b]Note:[/b] For GDExtension implementations.41</description>42</method>43<method name="is_persistence_scope_supported">44<return type="bool" />45<param index="0" name="scope" type="int" enum="OpenXRSpatialAnchorCapability.PersistenceScope" />46<description>47Returns [code]true[/code] if this persistence scope is supported by our spatial anchor capability.48[b]Note:[/b] Only valid after an OpenXR instance has been created.49</description>50</method>51<method name="is_spatial_anchor_supported">52<return type="bool" />53<description>54Returns [code]true[/code] if spatial anchors are supported by the hardware. Only returns a valid value after OpenXR has been initialized.55</description>56</method>57<method name="is_spatial_persistence_supported">58<return type="bool" />59<description>60Returns [code]true[/code] if persistent spatial anchors are supported by the hardware. Only returns a valid value after OpenXR has been initialized.61</description>62</method>63<method name="persist_anchor">64<return type="OpenXRFutureResult" />65<param index="0" name="anchor_tracker" type="OpenXRAnchorTracker" />66<param index="1" name="persistence_context" type="RID" default="RID()" />67<param index="2" name="user_callback" type="Callable" default="Callable()" />68<description>69Changes 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.70[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.71</description>72</method>73<method name="remove_anchor">74<return type="void" />75<param index="0" name="anchor_tracker" type="OpenXRAnchorTracker" />76<description>77Remove 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.78</description>79</method>80<method name="unpersist_anchor">81<return type="OpenXRFutureResult" />82<param index="0" name="anchor_tracker" type="OpenXRAnchorTracker" />83<param index="1" name="persistence_context" type="RID" default="RID()" />84<param index="2" name="user_callback" type="Callable" default="Callable()" />85<description>86Removes 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.87[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.88</description>89</method>90</methods>91<constants>92<constant name="PERSISTENCE_SCOPE_SYSTEM_MANAGED" value="1" enum="PersistenceScope">93Provides 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.94</constant>95<constant name="PERSISTENCE_SCOPE_LOCAL_ANCHORS" value="1000781000" enum="PersistenceScope">96Persistence 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)97</constant>98</constants>99</class>100101102