class_xrpose.rst 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  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/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/XRPose.xml.
  6. .. _class_XRPose:
  7. XRPose
  8. ======
  9. **Inherits:** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. This object contains all data related to a pose on a tracked object.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. XR runtimes often identify multiple locations on devices such as controllers that are spatially tracked.
  15. Orientation, location, linear velocity and angular velocity are all provided for each pose by the XR runtime. This object contains this state of a pose.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`XR documentation index <../tutorials/xr/index>`
  20. .. rst-class:: classref-reftable-group
  21. Properties
  22. ----------
  23. .. table::
  24. :widths: auto
  25. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  26. | :ref:`Vector3<class_Vector3>` | :ref:`angular_velocity<class_XRPose_property_angular_velocity>` | ``Vector3(0, 0, 0)`` |
  27. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  28. | :ref:`bool<class_bool>` | :ref:`has_tracking_data<class_XRPose_property_has_tracking_data>` | ``false`` |
  29. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  30. | :ref:`Vector3<class_Vector3>` | :ref:`linear_velocity<class_XRPose_property_linear_velocity>` | ``Vector3(0, 0, 0)`` |
  31. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  32. | :ref:`StringName<class_StringName>` | :ref:`name<class_XRPose_property_name>` | ``&""`` |
  33. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  34. | :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` | :ref:`tracking_confidence<class_XRPose_property_tracking_confidence>` | ``0`` |
  35. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  36. | :ref:`Transform3D<class_Transform3D>` | :ref:`transform<class_XRPose_property_transform>` | ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` |
  37. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  38. .. rst-class:: classref-reftable-group
  39. Methods
  40. -------
  41. .. table::
  42. :widths: auto
  43. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  44. | :ref:`Transform3D<class_Transform3D>` | :ref:`get_adjusted_transform<class_XRPose_method_get_adjusted_transform>` **(** **)** |const| |
  45. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  46. .. rst-class:: classref-section-separator
  47. ----
  48. .. rst-class:: classref-descriptions-group
  49. Enumerations
  50. ------------
  51. .. _enum_XRPose_TrackingConfidence:
  52. .. rst-class:: classref-enumeration
  53. enum **TrackingConfidence**:
  54. .. _class_XRPose_constant_XR_TRACKING_CONFIDENCE_NONE:
  55. .. rst-class:: classref-enumeration-constant
  56. :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` **XR_TRACKING_CONFIDENCE_NONE** = ``0``
  57. No tracking information is available for this pose.
  58. .. _class_XRPose_constant_XR_TRACKING_CONFIDENCE_LOW:
  59. .. rst-class:: classref-enumeration-constant
  60. :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` **XR_TRACKING_CONFIDENCE_LOW** = ``1``
  61. Tracking information may be inaccurate or estimated. For example, with inside out tracking this would indicate a controller may be (partially) obscured.
  62. .. _class_XRPose_constant_XR_TRACKING_CONFIDENCE_HIGH:
  63. .. rst-class:: classref-enumeration-constant
  64. :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` **XR_TRACKING_CONFIDENCE_HIGH** = ``2``
  65. Tracking information is deemed accurate and up to date.
  66. .. rst-class:: classref-section-separator
  67. ----
  68. .. rst-class:: classref-descriptions-group
  69. Property Descriptions
  70. ---------------------
  71. .. _class_XRPose_property_angular_velocity:
  72. .. rst-class:: classref-property
  73. :ref:`Vector3<class_Vector3>` **angular_velocity** = ``Vector3(0, 0, 0)``
  74. .. rst-class:: classref-property-setget
  75. - void **set_angular_velocity** **(** :ref:`Vector3<class_Vector3>` value **)**
  76. - :ref:`Vector3<class_Vector3>` **get_angular_velocity** **(** **)**
  77. The angular velocity for this pose.
  78. .. rst-class:: classref-item-separator
  79. ----
  80. .. _class_XRPose_property_has_tracking_data:
  81. .. rst-class:: classref-property
  82. :ref:`bool<class_bool>` **has_tracking_data** = ``false``
  83. .. rst-class:: classref-property-setget
  84. - void **set_has_tracking_data** **(** :ref:`bool<class_bool>` value **)**
  85. - :ref:`bool<class_bool>` **get_has_tracking_data** **(** **)**
  86. If ``true`` our tracking data is up to date. If ``false`` we're no longer receiving new tracking data and our state is whatever that last valid state was.
  87. .. rst-class:: classref-item-separator
  88. ----
  89. .. _class_XRPose_property_linear_velocity:
  90. .. rst-class:: classref-property
  91. :ref:`Vector3<class_Vector3>` **linear_velocity** = ``Vector3(0, 0, 0)``
  92. .. rst-class:: classref-property-setget
  93. - void **set_linear_velocity** **(** :ref:`Vector3<class_Vector3>` value **)**
  94. - :ref:`Vector3<class_Vector3>` **get_linear_velocity** **(** **)**
  95. The linear velocity of this pose.
  96. .. rst-class:: classref-item-separator
  97. ----
  98. .. _class_XRPose_property_name:
  99. .. rst-class:: classref-property
  100. :ref:`StringName<class_StringName>` **name** = ``&""``
  101. .. rst-class:: classref-property-setget
  102. - void **set_name** **(** :ref:`StringName<class_StringName>` value **)**
  103. - :ref:`StringName<class_StringName>` **get_name** **(** **)**
  104. The name of this pose. Pose names are often driven by an action map setup by the user. Godot does suggest a number of pose names that it expects :ref:`XRInterface<class_XRInterface>`\ s to implement:
  105. - ``root`` defines a root location, often used for tracked objects that do not have further nodes.
  106. - ``aim`` defines the tip of a controller with the orientation pointing outwards, for example: add your raycasts to this.
  107. - ``grip`` defines the location where the user grips the controller
  108. - ``skeleton`` defines the root location a hand mesh should be placed when using hand tracking and the animated skeleton supplied by the XR runtime.
  109. .. rst-class:: classref-item-separator
  110. ----
  111. .. _class_XRPose_property_tracking_confidence:
  112. .. rst-class:: classref-property
  113. :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` **tracking_confidence** = ``0``
  114. .. rst-class:: classref-property-setget
  115. - void **set_tracking_confidence** **(** :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` value **)**
  116. - :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` **get_tracking_confidence** **(** **)**
  117. The tracking confidence for this pose, provides insight on how accurate the spatial positioning of this record is.
  118. .. rst-class:: classref-item-separator
  119. ----
  120. .. _class_XRPose_property_transform:
  121. .. rst-class:: classref-property
  122. :ref:`Transform3D<class_Transform3D>` **transform** = ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)``
  123. .. rst-class:: classref-property-setget
  124. - void **set_transform** **(** :ref:`Transform3D<class_Transform3D>` value **)**
  125. - :ref:`Transform3D<class_Transform3D>` **get_transform** **(** **)**
  126. The transform containing the original and transform as reported by the XR runtime.
  127. .. rst-class:: classref-section-separator
  128. ----
  129. .. rst-class:: classref-descriptions-group
  130. Method Descriptions
  131. -------------------
  132. .. _class_XRPose_method_get_adjusted_transform:
  133. .. rst-class:: classref-method
  134. :ref:`Transform3D<class_Transform3D>` **get_adjusted_transform** **(** **)** |const|
  135. Returns the :ref:`transform<class_XRPose_property_transform>` with world scale and our reference frame applied. This is the transform used to position :ref:`XRNode3D<class_XRNode3D>` objects.
  136. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  137. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  138. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  139. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  140. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  141. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  142. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`