class_hingejoint3d.rst 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  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/HingeJoint3D.xml.
  6. .. _class_HingeJoint3D:
  7. HingeJoint3D
  8. ============
  9. **Inherits:** :ref:`Joint3D<class_Joint3D>` **<** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A physics joint that restricts the rotation of a 3D physics body around an axis relative to another physics body.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A physics joint that restricts the rotation of a 3D physics body around an axis relative to another physics body. For example, Body A can be a :ref:`StaticBody3D<class_StaticBody3D>` representing a door hinge that a :ref:`RigidBody3D<class_RigidBody3D>` rotates around.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +---------------------------+---------------------------------------------------------------------------------------+-------------+
  21. | :ref:`float<class_float>` | :ref:`angular_limit/bias<class_HingeJoint3D_property_angular_limit/bias>` | ``0.3`` |
  22. +---------------------------+---------------------------------------------------------------------------------------+-------------+
  23. | :ref:`bool<class_bool>` | :ref:`angular_limit/enable<class_HingeJoint3D_property_angular_limit/enable>` | ``false`` |
  24. +---------------------------+---------------------------------------------------------------------------------------+-------------+
  25. | :ref:`float<class_float>` | :ref:`angular_limit/lower<class_HingeJoint3D_property_angular_limit/lower>` | ``-1.5708`` |
  26. +---------------------------+---------------------------------------------------------------------------------------+-------------+
  27. | :ref:`float<class_float>` | :ref:`angular_limit/relaxation<class_HingeJoint3D_property_angular_limit/relaxation>` | ``1.0`` |
  28. +---------------------------+---------------------------------------------------------------------------------------+-------------+
  29. | :ref:`float<class_float>` | :ref:`angular_limit/softness<class_HingeJoint3D_property_angular_limit/softness>` | ``0.9`` |
  30. +---------------------------+---------------------------------------------------------------------------------------+-------------+
  31. | :ref:`float<class_float>` | :ref:`angular_limit/upper<class_HingeJoint3D_property_angular_limit/upper>` | ``1.5708`` |
  32. +---------------------------+---------------------------------------------------------------------------------------+-------------+
  33. | :ref:`bool<class_bool>` | :ref:`motor/enable<class_HingeJoint3D_property_motor/enable>` | ``false`` |
  34. +---------------------------+---------------------------------------------------------------------------------------+-------------+
  35. | :ref:`float<class_float>` | :ref:`motor/max_impulse<class_HingeJoint3D_property_motor/max_impulse>` | ``1.0`` |
  36. +---------------------------+---------------------------------------------------------------------------------------+-------------+
  37. | :ref:`float<class_float>` | :ref:`motor/target_velocity<class_HingeJoint3D_property_motor/target_velocity>` | ``1.0`` |
  38. +---------------------------+---------------------------------------------------------------------------------------+-------------+
  39. | :ref:`float<class_float>` | :ref:`params/bias<class_HingeJoint3D_property_params/bias>` | ``0.3`` |
  40. +---------------------------+---------------------------------------------------------------------------------------+-------------+
  41. .. rst-class:: classref-reftable-group
  42. Methods
  43. -------
  44. .. table::
  45. :widths: auto
  46. +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`get_flag<class_HingeJoint3D_method_get_flag>` **(** :ref:`Flag<enum_HingeJoint3D_Flag>` flag **)** |const| |
  48. +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`float<class_float>` | :ref:`get_param<class_HingeJoint3D_method_get_param>` **(** :ref:`Param<enum_HingeJoint3D_Param>` param **)** |const| |
  50. +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`set_flag<class_HingeJoint3D_method_set_flag>` **(** :ref:`Flag<enum_HingeJoint3D_Flag>` flag, :ref:`bool<class_bool>` enabled **)** |
  52. +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`set_param<class_HingeJoint3D_method_set_param>` **(** :ref:`Param<enum_HingeJoint3D_Param>` param, :ref:`float<class_float>` value **)** |
  54. +---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
  55. .. rst-class:: classref-section-separator
  56. ----
  57. .. rst-class:: classref-descriptions-group
  58. Enumerations
  59. ------------
  60. .. _enum_HingeJoint3D_Param:
  61. .. rst-class:: classref-enumeration
  62. enum **Param**:
  63. .. _class_HingeJoint3D_constant_PARAM_BIAS:
  64. .. rst-class:: classref-enumeration-constant
  65. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_BIAS** = ``0``
  66. The speed with which the two bodies get pulled together when they move in different directions.
  67. .. _class_HingeJoint3D_constant_PARAM_LIMIT_UPPER:
  68. .. rst-class:: classref-enumeration-constant
  69. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_LIMIT_UPPER** = ``1``
  70. The maximum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint3D_property_angular_limit/enable>` is ``true``.
  71. .. _class_HingeJoint3D_constant_PARAM_LIMIT_LOWER:
  72. .. rst-class:: classref-enumeration-constant
  73. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_LIMIT_LOWER** = ``2``
  74. The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint3D_property_angular_limit/enable>` is ``true``.
  75. .. _class_HingeJoint3D_constant_PARAM_LIMIT_BIAS:
  76. .. rst-class:: classref-enumeration-constant
  77. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_LIMIT_BIAS** = ``3``
  78. The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
  79. .. _class_HingeJoint3D_constant_PARAM_LIMIT_SOFTNESS:
  80. .. rst-class:: classref-enumeration-constant
  81. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_LIMIT_SOFTNESS** = ``4``
  82. .. _class_HingeJoint3D_constant_PARAM_LIMIT_RELAXATION:
  83. .. rst-class:: classref-enumeration-constant
  84. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_LIMIT_RELAXATION** = ``5``
  85. The lower this value, the more the rotation gets slowed down.
  86. .. _class_HingeJoint3D_constant_PARAM_MOTOR_TARGET_VELOCITY:
  87. .. rst-class:: classref-enumeration-constant
  88. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_MOTOR_TARGET_VELOCITY** = ``6``
  89. Target speed for the motor.
  90. .. _class_HingeJoint3D_constant_PARAM_MOTOR_MAX_IMPULSE:
  91. .. rst-class:: classref-enumeration-constant
  92. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_MOTOR_MAX_IMPULSE** = ``7``
  93. Maximum acceleration for the motor.
  94. .. _class_HingeJoint3D_constant_PARAM_MAX:
  95. .. rst-class:: classref-enumeration-constant
  96. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_MAX** = ``8``
  97. Represents the size of the :ref:`Param<enum_HingeJoint3D_Param>` enum.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _enum_HingeJoint3D_Flag:
  101. .. rst-class:: classref-enumeration
  102. enum **Flag**:
  103. .. _class_HingeJoint3D_constant_FLAG_USE_LIMIT:
  104. .. rst-class:: classref-enumeration-constant
  105. :ref:`Flag<enum_HingeJoint3D_Flag>` **FLAG_USE_LIMIT** = ``0``
  106. If ``true``, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower<class_HingeJoint3D_property_angular_limit/lower>` and :ref:`angular_limit/upper<class_HingeJoint3D_property_angular_limit/upper>` has effects.
  107. .. _class_HingeJoint3D_constant_FLAG_ENABLE_MOTOR:
  108. .. rst-class:: classref-enumeration-constant
  109. :ref:`Flag<enum_HingeJoint3D_Flag>` **FLAG_ENABLE_MOTOR** = ``1``
  110. When activated, a motor turns the hinge.
  111. .. _class_HingeJoint3D_constant_FLAG_MAX:
  112. .. rst-class:: classref-enumeration-constant
  113. :ref:`Flag<enum_HingeJoint3D_Flag>` **FLAG_MAX** = ``2``
  114. Represents the size of the :ref:`Flag<enum_HingeJoint3D_Flag>` enum.
  115. .. rst-class:: classref-section-separator
  116. ----
  117. .. rst-class:: classref-descriptions-group
  118. Property Descriptions
  119. ---------------------
  120. .. _class_HingeJoint3D_property_angular_limit/bias:
  121. .. rst-class:: classref-property
  122. :ref:`float<class_float>` **angular_limit/bias** = ``0.3``
  123. .. rst-class:: classref-property-setget
  124. - void **set_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param, :ref:`float<class_float>` value **)**
  125. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param **)** |const|
  126. The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
  127. .. rst-class:: classref-item-separator
  128. ----
  129. .. _class_HingeJoint3D_property_angular_limit/enable:
  130. .. rst-class:: classref-property
  131. :ref:`bool<class_bool>` **angular_limit/enable** = ``false``
  132. .. rst-class:: classref-property-setget
  133. - void **set_flag** **(** :ref:`Flag<enum_HingeJoint3D_Flag>` flag, :ref:`bool<class_bool>` enabled **)**
  134. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flag<enum_HingeJoint3D_Flag>` flag **)** |const|
  135. If ``true``, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower<class_HingeJoint3D_property_angular_limit/lower>` and :ref:`angular_limit/upper<class_HingeJoint3D_property_angular_limit/upper>` has effects.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_HingeJoint3D_property_angular_limit/lower:
  139. .. rst-class:: classref-property
  140. :ref:`float<class_float>` **angular_limit/lower** = ``-1.5708``
  141. .. rst-class:: classref-property-setget
  142. - void **set_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param, :ref:`float<class_float>` value **)**
  143. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param **)** |const|
  144. The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint3D_property_angular_limit/enable>` is ``true``.
  145. .. rst-class:: classref-item-separator
  146. ----
  147. .. _class_HingeJoint3D_property_angular_limit/relaxation:
  148. .. rst-class:: classref-property
  149. :ref:`float<class_float>` **angular_limit/relaxation** = ``1.0``
  150. .. rst-class:: classref-property-setget
  151. - void **set_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param, :ref:`float<class_float>` value **)**
  152. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param **)** |const|
  153. The lower this value, the more the rotation gets slowed down.
  154. .. rst-class:: classref-item-separator
  155. ----
  156. .. _class_HingeJoint3D_property_angular_limit/softness:
  157. .. rst-class:: classref-property
  158. :ref:`float<class_float>` **angular_limit/softness** = ``0.9``
  159. .. rst-class:: classref-property-setget
  160. - void **set_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param, :ref:`float<class_float>` value **)**
  161. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param **)** |const|
  162. .. container:: contribute
  163. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  164. .. rst-class:: classref-item-separator
  165. ----
  166. .. _class_HingeJoint3D_property_angular_limit/upper:
  167. .. rst-class:: classref-property
  168. :ref:`float<class_float>` **angular_limit/upper** = ``1.5708``
  169. .. rst-class:: classref-property-setget
  170. - void **set_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param, :ref:`float<class_float>` value **)**
  171. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param **)** |const|
  172. The maximum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint3D_property_angular_limit/enable>` is ``true``.
  173. .. rst-class:: classref-item-separator
  174. ----
  175. .. _class_HingeJoint3D_property_motor/enable:
  176. .. rst-class:: classref-property
  177. :ref:`bool<class_bool>` **motor/enable** = ``false``
  178. .. rst-class:: classref-property-setget
  179. - void **set_flag** **(** :ref:`Flag<enum_HingeJoint3D_Flag>` flag, :ref:`bool<class_bool>` enabled **)**
  180. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flag<enum_HingeJoint3D_Flag>` flag **)** |const|
  181. When activated, a motor turns the hinge.
  182. .. rst-class:: classref-item-separator
  183. ----
  184. .. _class_HingeJoint3D_property_motor/max_impulse:
  185. .. rst-class:: classref-property
  186. :ref:`float<class_float>` **motor/max_impulse** = ``1.0``
  187. .. rst-class:: classref-property-setget
  188. - void **set_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param, :ref:`float<class_float>` value **)**
  189. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param **)** |const|
  190. Maximum acceleration for the motor.
  191. .. rst-class:: classref-item-separator
  192. ----
  193. .. _class_HingeJoint3D_property_motor/target_velocity:
  194. .. rst-class:: classref-property
  195. :ref:`float<class_float>` **motor/target_velocity** = ``1.0``
  196. .. rst-class:: classref-property-setget
  197. - void **set_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param, :ref:`float<class_float>` value **)**
  198. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param **)** |const|
  199. Target speed for the motor.
  200. .. rst-class:: classref-item-separator
  201. ----
  202. .. _class_HingeJoint3D_property_params/bias:
  203. .. rst-class:: classref-property
  204. :ref:`float<class_float>` **params/bias** = ``0.3``
  205. .. rst-class:: classref-property-setget
  206. - void **set_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param, :ref:`float<class_float>` value **)**
  207. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param **)** |const|
  208. The speed with which the two bodies get pulled together when they move in different directions.
  209. .. rst-class:: classref-section-separator
  210. ----
  211. .. rst-class:: classref-descriptions-group
  212. Method Descriptions
  213. -------------------
  214. .. _class_HingeJoint3D_method_get_flag:
  215. .. rst-class:: classref-method
  216. :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flag<enum_HingeJoint3D_Flag>` flag **)** |const|
  217. Returns the value of the specified flag.
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_HingeJoint3D_method_get_param:
  221. .. rst-class:: classref-method
  222. :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param **)** |const|
  223. Returns the value of the specified parameter.
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_HingeJoint3D_method_set_flag:
  227. .. rst-class:: classref-method
  228. void **set_flag** **(** :ref:`Flag<enum_HingeJoint3D_Flag>` flag, :ref:`bool<class_bool>` enabled **)**
  229. If ``true``, enables the specified flag.
  230. .. rst-class:: classref-item-separator
  231. ----
  232. .. _class_HingeJoint3D_method_set_param:
  233. .. rst-class:: classref-method
  234. void **set_param** **(** :ref:`Param<enum_HingeJoint3D_Param>` param, :ref:`float<class_float>` value **)**
  235. Sets the value of the specified parameter.
  236. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  237. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  238. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  239. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  240. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  241. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  242. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`