class_xrpose.rst 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/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-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  22. | :ref:`Vector3<class_Vector3>` | :ref:`angular_velocity<class_XRPose_property_angular_velocity>` | ``Vector3(0, 0, 0)`` |
  23. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  24. | :ref:`bool<class_bool>` | :ref:`has_tracking_data<class_XRPose_property_has_tracking_data>` | ``false`` |
  25. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  26. | :ref:`Vector3<class_Vector3>` | :ref:`linear_velocity<class_XRPose_property_linear_velocity>` | ``Vector3(0, 0, 0)`` |
  27. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  28. | :ref:`StringName<class_StringName>` | :ref:`name<class_XRPose_property_name>` | ``&""`` |
  29. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  30. | :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` | :ref:`tracking_confidence<class_XRPose_property_tracking_confidence>` | ``0`` |
  31. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  32. | :ref:`Transform3D<class_Transform3D>` | :ref:`transform<class_XRPose_property_transform>` | ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)`` |
  33. +-----------------------------------------------------------+-----------------------------------------------------------------------+-----------------------------------------------------+
  34. .. rst-class:: classref-reftable-group
  35. Methods
  36. -------
  37. .. table::
  38. :widths: auto
  39. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  40. | :ref:`Transform3D<class_Transform3D>` | :ref:`get_adjusted_transform<class_XRPose_method_get_adjusted_transform>` **(** **)** |const| |
  41. +---------------------------------------+-----------------------------------------------------------------------------------------------+
  42. .. rst-class:: classref-section-separator
  43. ----
  44. .. rst-class:: classref-descriptions-group
  45. Enumerations
  46. ------------
  47. .. _enum_XRPose_TrackingConfidence:
  48. .. rst-class:: classref-enumeration
  49. enum **TrackingConfidence**:
  50. .. _class_XRPose_constant_XR_TRACKING_CONFIDENCE_NONE:
  51. .. rst-class:: classref-enumeration-constant
  52. :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` **XR_TRACKING_CONFIDENCE_NONE** = ``0``
  53. No tracking information is available for this pose.
  54. .. _class_XRPose_constant_XR_TRACKING_CONFIDENCE_LOW:
  55. .. rst-class:: classref-enumeration-constant
  56. :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` **XR_TRACKING_CONFIDENCE_LOW** = ``1``
  57. Tracking information may be inaccurate or estimated. For example, with inside out tracking this would indicate a controller may be (partially) obscured.
  58. .. _class_XRPose_constant_XR_TRACKING_CONFIDENCE_HIGH:
  59. .. rst-class:: classref-enumeration-constant
  60. :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` **XR_TRACKING_CONFIDENCE_HIGH** = ``2``
  61. Tracking information is deemed accurate and up to date.
  62. .. rst-class:: classref-section-separator
  63. ----
  64. .. rst-class:: classref-descriptions-group
  65. Property Descriptions
  66. ---------------------
  67. .. _class_XRPose_property_angular_velocity:
  68. .. rst-class:: classref-property
  69. :ref:`Vector3<class_Vector3>` **angular_velocity** = ``Vector3(0, 0, 0)``
  70. .. rst-class:: classref-property-setget
  71. - void **set_angular_velocity** **(** :ref:`Vector3<class_Vector3>` value **)**
  72. - :ref:`Vector3<class_Vector3>` **get_angular_velocity** **(** **)**
  73. The angular velocity for this pose.
  74. .. rst-class:: classref-item-separator
  75. ----
  76. .. _class_XRPose_property_has_tracking_data:
  77. .. rst-class:: classref-property
  78. :ref:`bool<class_bool>` **has_tracking_data** = ``false``
  79. .. rst-class:: classref-property-setget
  80. - void **set_has_tracking_data** **(** :ref:`bool<class_bool>` value **)**
  81. - :ref:`bool<class_bool>` **get_has_tracking_data** **(** **)**
  82. 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.
  83. .. rst-class:: classref-item-separator
  84. ----
  85. .. _class_XRPose_property_linear_velocity:
  86. .. rst-class:: classref-property
  87. :ref:`Vector3<class_Vector3>` **linear_velocity** = ``Vector3(0, 0, 0)``
  88. .. rst-class:: classref-property-setget
  89. - void **set_linear_velocity** **(** :ref:`Vector3<class_Vector3>` value **)**
  90. - :ref:`Vector3<class_Vector3>` **get_linear_velocity** **(** **)**
  91. The linear velocity of this pose.
  92. .. rst-class:: classref-item-separator
  93. ----
  94. .. _class_XRPose_property_name:
  95. .. rst-class:: classref-property
  96. :ref:`StringName<class_StringName>` **name** = ``&""``
  97. .. rst-class:: classref-property-setget
  98. - void **set_name** **(** :ref:`StringName<class_StringName>` value **)**
  99. - :ref:`StringName<class_StringName>` **get_name** **(** **)**
  100. 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:
  101. - ``root`` defines a root location, often used for tracked objects that do not have further nodes.
  102. - ``aim`` defines the tip of a controller with the orientation pointing outwards, for example: add your raycasts to this.
  103. - ``grip`` defines the location where the user grips the controller
  104. - ``skeleton`` defines the root location a hand mesh should be placed when using hand tracking and the animated skeleton supplied by the XR runtime.
  105. .. rst-class:: classref-item-separator
  106. ----
  107. .. _class_XRPose_property_tracking_confidence:
  108. .. rst-class:: classref-property
  109. :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` **tracking_confidence** = ``0``
  110. .. rst-class:: classref-property-setget
  111. - void **set_tracking_confidence** **(** :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` value **)**
  112. - :ref:`TrackingConfidence<enum_XRPose_TrackingConfidence>` **get_tracking_confidence** **(** **)**
  113. The tracking confidence for this pose, provides insight on how accurate the spatial positioning of this record is.
  114. .. rst-class:: classref-item-separator
  115. ----
  116. .. _class_XRPose_property_transform:
  117. .. rst-class:: classref-property
  118. :ref:`Transform3D<class_Transform3D>` **transform** = ``Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)``
  119. .. rst-class:: classref-property-setget
  120. - void **set_transform** **(** :ref:`Transform3D<class_Transform3D>` value **)**
  121. - :ref:`Transform3D<class_Transform3D>` **get_transform** **(** **)**
  122. The transform containing the original and transform as reported by the XR runtime.
  123. .. rst-class:: classref-section-separator
  124. ----
  125. .. rst-class:: classref-descriptions-group
  126. Method Descriptions
  127. -------------------
  128. .. _class_XRPose_method_get_adjusted_transform:
  129. .. rst-class:: classref-method
  130. :ref:`Transform3D<class_Transform3D>` **get_adjusted_transform** **(** **)** |const|
  131. 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.
  132. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  133. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  134. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  135. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  136. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  137. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`