class_xrpositionaltracker.rst 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/XRPositionalTracker.xml.
  6. .. _class_XRPositionalTracker:
  7. XRPositionalTracker
  8. ===================
  9. **Inherits:** :ref:`XRTracker<class_XRTracker>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`XRBodyTracker<class_XRBodyTracker>`, :ref:`XRControllerTracker<class_XRControllerTracker>`, :ref:`XRHandTracker<class_XRHandTracker>`
  11. A tracked object.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. An instance of this object represents a device that is tracked, such as a controller or anchor point. HMDs aren't represented here as they are handled internally.
  16. As controllers are turned on and the :ref:`XRInterface<class_XRInterface>` detects them, instances of this object are automatically added to this list of active tracking objects accessible through the :ref:`XRServer<class_XRServer>`.
  17. The :ref:`XRNode3D<class_XRNode3D>` and :ref:`XRAnchor3D<class_XRAnchor3D>` both consume objects of this type and should be used in your project. The positional trackers are just under-the-hood objects that make this all work. These are mostly exposed so that GDExtension-based interfaces can interact with them.
  18. .. rst-class:: classref-introduction-group
  19. Tutorials
  20. ---------
  21. - :doc:`XR documentation index <../tutorials/xr/index>`
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +----------------------------------------------------------+------------------------------------------------------------+--------+
  28. | :ref:`TrackerHand<enum_XRPositionalTracker_TrackerHand>` | :ref:`hand<class_XRPositionalTracker_property_hand>` | ``0`` |
  29. +----------------------------------------------------------+------------------------------------------------------------+--------+
  30. | :ref:`String<class_String>` | :ref:`profile<class_XRPositionalTracker_property_profile>` | ``""`` |
  31. +----------------------------------------------------------+------------------------------------------------------------+--------+
  32. .. rst-class:: classref-reftable-group
  33. Methods
  34. -------
  35. .. table::
  36. :widths: auto
  37. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  38. | :ref:`Variant<class_Variant>` | :ref:`get_input<class_XRPositionalTracker_method_get_input>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  39. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  40. | :ref:`XRPose<class_XRPose>` | :ref:`get_pose<class_XRPositionalTracker_method_get_pose>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  41. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | :ref:`bool<class_bool>` | :ref:`has_pose<class_XRPositionalTracker_method_has_pose>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| |
  43. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | |void| | :ref:`invalidate_pose<class_XRPositionalTracker_method_invalidate_pose>`\ (\ name\: :ref:`StringName<class_StringName>`\ ) |
  45. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | |void| | :ref:`set_input<class_XRPositionalTracker_method_set_input>`\ (\ name\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ ) |
  47. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | |void| | :ref:`set_pose<class_XRPositionalTracker_method_set_pose>`\ (\ name\: :ref:`StringName<class_StringName>`, transform\: :ref:`Transform3D<class_Transform3D>`, linear_velocity\: :ref:`Vector3<class_Vector3>`, angular_velocity\: :ref:`Vector3<class_Vector3>`, tracking_confidence\: :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>`\ ) |
  49. +-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. .. rst-class:: classref-section-separator
  51. ----
  52. .. rst-class:: classref-descriptions-group
  53. Signals
  54. -------
  55. .. _class_XRPositionalTracker_signal_button_pressed:
  56. .. rst-class:: classref-signal
  57. **button_pressed**\ (\ name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_XRPositionalTracker_signal_button_pressed>`
  58. Emitted when a button on this tracker is pressed. Note that many XR runtimes allow other inputs to be mapped to buttons.
  59. .. rst-class:: classref-item-separator
  60. ----
  61. .. _class_XRPositionalTracker_signal_button_released:
  62. .. rst-class:: classref-signal
  63. **button_released**\ (\ name\: :ref:`String<class_String>`\ ) :ref:`🔗<class_XRPositionalTracker_signal_button_released>`
  64. Emitted when a button on this tracker is released.
  65. .. rst-class:: classref-item-separator
  66. ----
  67. .. _class_XRPositionalTracker_signal_input_float_changed:
  68. .. rst-class:: classref-signal
  69. **input_float_changed**\ (\ name\: :ref:`String<class_String>`, value\: :ref:`float<class_float>`\ ) :ref:`🔗<class_XRPositionalTracker_signal_input_float_changed>`
  70. Emitted when a trigger or similar input on this tracker changes value.
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_XRPositionalTracker_signal_input_vector2_changed:
  74. .. rst-class:: classref-signal
  75. **input_vector2_changed**\ (\ name\: :ref:`String<class_String>`, vector\: :ref:`Vector2<class_Vector2>`\ ) :ref:`🔗<class_XRPositionalTracker_signal_input_vector2_changed>`
  76. Emitted when a thumbstick or thumbpad on this tracker moves.
  77. .. rst-class:: classref-item-separator
  78. ----
  79. .. _class_XRPositionalTracker_signal_pose_changed:
  80. .. rst-class:: classref-signal
  81. **pose_changed**\ (\ pose\: :ref:`XRPose<class_XRPose>`\ ) :ref:`🔗<class_XRPositionalTracker_signal_pose_changed>`
  82. Emitted when the state of a pose tracked by this tracker changes.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_XRPositionalTracker_signal_pose_lost_tracking:
  86. .. rst-class:: classref-signal
  87. **pose_lost_tracking**\ (\ pose\: :ref:`XRPose<class_XRPose>`\ ) :ref:`🔗<class_XRPositionalTracker_signal_pose_lost_tracking>`
  88. Emitted when a pose tracked by this tracker stops getting updated tracking data.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_XRPositionalTracker_signal_profile_changed:
  92. .. rst-class:: classref-signal
  93. **profile_changed**\ (\ role\: :ref:`String<class_String>`\ ) :ref:`🔗<class_XRPositionalTracker_signal_profile_changed>`
  94. Emitted when the profile of our tracker changes.
  95. .. rst-class:: classref-section-separator
  96. ----
  97. .. rst-class:: classref-descriptions-group
  98. Enumerations
  99. ------------
  100. .. _enum_XRPositionalTracker_TrackerHand:
  101. .. rst-class:: classref-enumeration
  102. enum **TrackerHand**: :ref:`🔗<enum_XRPositionalTracker_TrackerHand>`
  103. .. _class_XRPositionalTracker_constant_TRACKER_HAND_UNKNOWN:
  104. .. rst-class:: classref-enumeration-constant
  105. :ref:`TrackerHand<enum_XRPositionalTracker_TrackerHand>` **TRACKER_HAND_UNKNOWN** = ``0``
  106. The hand this tracker is held in is unknown or not applicable.
  107. .. _class_XRPositionalTracker_constant_TRACKER_HAND_LEFT:
  108. .. rst-class:: classref-enumeration-constant
  109. :ref:`TrackerHand<enum_XRPositionalTracker_TrackerHand>` **TRACKER_HAND_LEFT** = ``1``
  110. This tracker is the left hand controller.
  111. .. _class_XRPositionalTracker_constant_TRACKER_HAND_RIGHT:
  112. .. rst-class:: classref-enumeration-constant
  113. :ref:`TrackerHand<enum_XRPositionalTracker_TrackerHand>` **TRACKER_HAND_RIGHT** = ``2``
  114. This tracker is the right hand controller.
  115. .. _class_XRPositionalTracker_constant_TRACKER_HAND_MAX:
  116. .. rst-class:: classref-enumeration-constant
  117. :ref:`TrackerHand<enum_XRPositionalTracker_TrackerHand>` **TRACKER_HAND_MAX** = ``3``
  118. Represents the size of the :ref:`TrackerHand<enum_XRPositionalTracker_TrackerHand>` enum.
  119. .. rst-class:: classref-section-separator
  120. ----
  121. .. rst-class:: classref-descriptions-group
  122. Property Descriptions
  123. ---------------------
  124. .. _class_XRPositionalTracker_property_hand:
  125. .. rst-class:: classref-property
  126. :ref:`TrackerHand<enum_XRPositionalTracker_TrackerHand>` **hand** = ``0`` :ref:`🔗<class_XRPositionalTracker_property_hand>`
  127. .. rst-class:: classref-property-setget
  128. - |void| **set_tracker_hand**\ (\ value\: :ref:`TrackerHand<enum_XRPositionalTracker_TrackerHand>`\ )
  129. - :ref:`TrackerHand<enum_XRPositionalTracker_TrackerHand>` **get_tracker_hand**\ (\ )
  130. Defines which hand this tracker relates to.
  131. .. rst-class:: classref-item-separator
  132. ----
  133. .. _class_XRPositionalTracker_property_profile:
  134. .. rst-class:: classref-property
  135. :ref:`String<class_String>` **profile** = ``""`` :ref:`🔗<class_XRPositionalTracker_property_profile>`
  136. .. rst-class:: classref-property-setget
  137. - |void| **set_tracker_profile**\ (\ value\: :ref:`String<class_String>`\ )
  138. - :ref:`String<class_String>` **get_tracker_profile**\ (\ )
  139. The profile associated with this tracker, interface dependent but will indicate the type of controller being tracked.
  140. .. rst-class:: classref-section-separator
  141. ----
  142. .. rst-class:: classref-descriptions-group
  143. Method Descriptions
  144. -------------------
  145. .. _class_XRPositionalTracker_method_get_input:
  146. .. rst-class:: classref-method
  147. :ref:`Variant<class_Variant>` **get_input**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_XRPositionalTracker_method_get_input>`
  148. **Deprecated:** Use through :ref:`XRControllerTracker<class_XRControllerTracker>`.
  149. Returns an input for this tracker. It can return a boolean, float or :ref:`Vector2<class_Vector2>` value depending on whether the input is a button, trigger or thumbstick/thumbpad.
  150. .. rst-class:: classref-item-separator
  151. ----
  152. .. _class_XRPositionalTracker_method_get_pose:
  153. .. rst-class:: classref-method
  154. :ref:`XRPose<class_XRPose>` **get_pose**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_XRPositionalTracker_method_get_pose>`
  155. Returns the current :ref:`XRPose<class_XRPose>` state object for the bound ``name`` pose.
  156. .. rst-class:: classref-item-separator
  157. ----
  158. .. _class_XRPositionalTracker_method_has_pose:
  159. .. rst-class:: classref-method
  160. :ref:`bool<class_bool>` **has_pose**\ (\ name\: :ref:`StringName<class_StringName>`\ ) |const| :ref:`🔗<class_XRPositionalTracker_method_has_pose>`
  161. Returns ``true`` if the tracker is available and is currently tracking the bound ``name`` pose.
  162. .. rst-class:: classref-item-separator
  163. ----
  164. .. _class_XRPositionalTracker_method_invalidate_pose:
  165. .. rst-class:: classref-method
  166. |void| **invalidate_pose**\ (\ name\: :ref:`StringName<class_StringName>`\ ) :ref:`🔗<class_XRPositionalTracker_method_invalidate_pose>`
  167. Marks this pose as invalid, we don't clear the last reported state but it allows users to decide if trackers need to be hidden if we lose tracking or just remain at their last known position.
  168. .. rst-class:: classref-item-separator
  169. ----
  170. .. _class_XRPositionalTracker_method_set_input:
  171. .. rst-class:: classref-method
  172. |void| **set_input**\ (\ name\: :ref:`StringName<class_StringName>`, value\: :ref:`Variant<class_Variant>`\ ) :ref:`🔗<class_XRPositionalTracker_method_set_input>`
  173. **Deprecated:** Use through :ref:`XRControllerTracker<class_XRControllerTracker>`.
  174. Changes the value for the given input. This method is called by a :ref:`XRInterface<class_XRInterface>` implementation and should not be used directly.
  175. .. rst-class:: classref-item-separator
  176. ----
  177. .. _class_XRPositionalTracker_method_set_pose:
  178. .. rst-class:: classref-method
  179. |void| **set_pose**\ (\ name\: :ref:`StringName<class_StringName>`, transform\: :ref:`Transform3D<class_Transform3D>`, linear_velocity\: :ref:`Vector3<class_Vector3>`, angular_velocity\: :ref:`Vector3<class_Vector3>`, tracking_confidence\: :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>`\ ) :ref:`🔗<class_XRPositionalTracker_method_set_pose>`
  180. Sets the transform, linear velocity, angular velocity and tracking confidence for the given pose. This method is called by a :ref:`XRInterface<class_XRInterface>` implementation and should not be used directly.
  181. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  182. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  183. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  184. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  185. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  186. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  187. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  188. .. |void| replace:: :abbr:`void (No return value.)`