class_hingejoint.rst 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/HingeJoint.xml.
  6. .. _class_HingeJoint:
  7. HingeJoint
  8. ==========
  9. **Inherits:** :ref:`Joint<class_Joint>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A hinge between two 3D PhysicsBodies.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A HingeJoint normally uses the Z axis of body A as the hinge axis, another axis can be specified when adding it manually though. See also :ref:`Generic6DOFJoint<class_Generic6DOFJoint>`.
  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_HingeJoint_property_angular_limit/bias>` | ``0.3`` |
  22. +---------------------------+-------------------------------------------------------------------------------------+-----------+
  23. | :ref:`bool<class_bool>` | :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` | ``false`` |
  24. +---------------------------+-------------------------------------------------------------------------------------+-----------+
  25. | :ref:`float<class_float>` | :ref:`angular_limit/lower<class_HingeJoint_property_angular_limit/lower>` | ``-90.0`` |
  26. +---------------------------+-------------------------------------------------------------------------------------+-----------+
  27. | :ref:`float<class_float>` | :ref:`angular_limit/relaxation<class_HingeJoint_property_angular_limit/relaxation>` | ``1.0`` |
  28. +---------------------------+-------------------------------------------------------------------------------------+-----------+
  29. | :ref:`float<class_float>` | :ref:`angular_limit/softness<class_HingeJoint_property_angular_limit/softness>` | ``0.9`` |
  30. +---------------------------+-------------------------------------------------------------------------------------+-----------+
  31. | :ref:`float<class_float>` | :ref:`angular_limit/upper<class_HingeJoint_property_angular_limit/upper>` | ``90.0`` |
  32. +---------------------------+-------------------------------------------------------------------------------------+-----------+
  33. | :ref:`bool<class_bool>` | :ref:`motor/enable<class_HingeJoint_property_motor/enable>` | ``false`` |
  34. +---------------------------+-------------------------------------------------------------------------------------+-----------+
  35. | :ref:`float<class_float>` | :ref:`motor/max_impulse<class_HingeJoint_property_motor/max_impulse>` | ``1.0`` |
  36. +---------------------------+-------------------------------------------------------------------------------------+-----------+
  37. | :ref:`float<class_float>` | :ref:`motor/target_velocity<class_HingeJoint_property_motor/target_velocity>` | ``1.0`` |
  38. +---------------------------+-------------------------------------------------------------------------------------+-----------+
  39. | :ref:`float<class_float>` | :ref:`params/bias<class_HingeJoint_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_HingeJoint_method_get_flag>` **(** :ref:`Flag<enum_HingeJoint_Flag>` flag **)** |const| |
  48. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`float<class_float>` | :ref:`get_param<class_HingeJoint_method_get_param>` **(** :ref:`Param<enum_HingeJoint_Param>` param **)** |const| |
  50. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  51. | void | :ref:`set_flag<class_HingeJoint_method_set_flag>` **(** :ref:`Flag<enum_HingeJoint_Flag>` flag, :ref:`bool<class_bool>` enabled **)** |
  52. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  53. | void | :ref:`set_param<class_HingeJoint_method_set_param>` **(** :ref:`Param<enum_HingeJoint_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_HingeJoint_Param:
  61. .. rst-class:: classref-enumeration
  62. enum **Param**:
  63. .. _class_HingeJoint_constant_PARAM_BIAS:
  64. .. rst-class:: classref-enumeration-constant
  65. :ref:`Param<enum_HingeJoint_Param>` **PARAM_BIAS** = ``0``
  66. The speed with which the two bodies get pulled together when they move in different directions.
  67. .. _class_HingeJoint_constant_PARAM_LIMIT_UPPER:
  68. .. rst-class:: classref-enumeration-constant
  69. :ref:`Param<enum_HingeJoint_Param>` **PARAM_LIMIT_UPPER** = ``1``
  70. The maximum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
  71. .. _class_HingeJoint_constant_PARAM_LIMIT_LOWER:
  72. .. rst-class:: classref-enumeration-constant
  73. :ref:`Param<enum_HingeJoint_Param>` **PARAM_LIMIT_LOWER** = ``2``
  74. The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
  75. .. _class_HingeJoint_constant_PARAM_LIMIT_BIAS:
  76. .. rst-class:: classref-enumeration-constant
  77. :ref:`Param<enum_HingeJoint_Param>` **PARAM_LIMIT_BIAS** = ``3``
  78. The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
  79. .. _class_HingeJoint_constant_PARAM_LIMIT_SOFTNESS:
  80. .. rst-class:: classref-enumeration-constant
  81. :ref:`Param<enum_HingeJoint_Param>` **PARAM_LIMIT_SOFTNESS** = ``4``
  82. .. _class_HingeJoint_constant_PARAM_LIMIT_RELAXATION:
  83. .. rst-class:: classref-enumeration-constant
  84. :ref:`Param<enum_HingeJoint_Param>` **PARAM_LIMIT_RELAXATION** = ``5``
  85. The lower this value, the more the rotation gets slowed down.
  86. .. _class_HingeJoint_constant_PARAM_MOTOR_TARGET_VELOCITY:
  87. .. rst-class:: classref-enumeration-constant
  88. :ref:`Param<enum_HingeJoint_Param>` **PARAM_MOTOR_TARGET_VELOCITY** = ``6``
  89. Target speed for the motor.
  90. .. _class_HingeJoint_constant_PARAM_MOTOR_MAX_IMPULSE:
  91. .. rst-class:: classref-enumeration-constant
  92. :ref:`Param<enum_HingeJoint_Param>` **PARAM_MOTOR_MAX_IMPULSE** = ``7``
  93. Maximum acceleration for the motor.
  94. .. _class_HingeJoint_constant_PARAM_MAX:
  95. .. rst-class:: classref-enumeration-constant
  96. :ref:`Param<enum_HingeJoint_Param>` **PARAM_MAX** = ``8``
  97. Represents the size of the :ref:`Param<enum_HingeJoint_Param>` enum.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _enum_HingeJoint_Flag:
  101. .. rst-class:: classref-enumeration
  102. enum **Flag**:
  103. .. _class_HingeJoint_constant_FLAG_USE_LIMIT:
  104. .. rst-class:: classref-enumeration-constant
  105. :ref:`Flag<enum_HingeJoint_Flag>` **FLAG_USE_LIMIT** = ``0``
  106. If ``true``, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower<class_HingeJoint_property_angular_limit/lower>` and :ref:`angular_limit/upper<class_HingeJoint_property_angular_limit/upper>` has effects.
  107. .. _class_HingeJoint_constant_FLAG_ENABLE_MOTOR:
  108. .. rst-class:: classref-enumeration-constant
  109. :ref:`Flag<enum_HingeJoint_Flag>` **FLAG_ENABLE_MOTOR** = ``1``
  110. When activated, a motor turns the hinge.
  111. .. _class_HingeJoint_constant_FLAG_MAX:
  112. .. rst-class:: classref-enumeration-constant
  113. :ref:`Flag<enum_HingeJoint_Flag>` **FLAG_MAX** = ``2``
  114. Represents the size of the :ref:`Flag<enum_HingeJoint_Flag>` enum.
  115. .. rst-class:: classref-section-separator
  116. ----
  117. .. rst-class:: classref-descriptions-group
  118. Property Descriptions
  119. ---------------------
  120. .. _class_HingeJoint_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_HingeJoint_Param>` param, :ref:`float<class_float>` value **)**
  125. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint_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_HingeJoint_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_HingeJoint_Flag>` flag, :ref:`bool<class_bool>` enabled **)**
  134. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flag<enum_HingeJoint_Flag>` flag **)** |const|
  135. If ``true``, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower<class_HingeJoint_property_angular_limit/lower>` and :ref:`angular_limit/upper<class_HingeJoint_property_angular_limit/upper>` has effects.
  136. .. rst-class:: classref-item-separator
  137. ----
  138. .. _class_HingeJoint_property_angular_limit/lower:
  139. .. rst-class:: classref-property
  140. :ref:`float<class_float>` **angular_limit/lower** = ``-90.0``
  141. The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
  142. .. rst-class:: classref-item-separator
  143. ----
  144. .. _class_HingeJoint_property_angular_limit/relaxation:
  145. .. rst-class:: classref-property
  146. :ref:`float<class_float>` **angular_limit/relaxation** = ``1.0``
  147. .. rst-class:: classref-property-setget
  148. - void **set_param** **(** :ref:`Param<enum_HingeJoint_Param>` param, :ref:`float<class_float>` value **)**
  149. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint_Param>` param **)** |const|
  150. The lower this value, the more the rotation gets slowed down.
  151. .. rst-class:: classref-item-separator
  152. ----
  153. .. _class_HingeJoint_property_angular_limit/softness:
  154. .. rst-class:: classref-property
  155. :ref:`float<class_float>` **angular_limit/softness** = ``0.9``
  156. .. rst-class:: classref-property-setget
  157. - void **set_param** **(** :ref:`Param<enum_HingeJoint_Param>` param, :ref:`float<class_float>` value **)**
  158. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint_Param>` param **)** |const|
  159. .. container:: contribute
  160. There is currently no description for this property. Please help us by :ref:`contributing one <doc_updating_the_class_reference>`!
  161. .. rst-class:: classref-item-separator
  162. ----
  163. .. _class_HingeJoint_property_angular_limit/upper:
  164. .. rst-class:: classref-property
  165. :ref:`float<class_float>` **angular_limit/upper** = ``90.0``
  166. The maximum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
  167. .. rst-class:: classref-item-separator
  168. ----
  169. .. _class_HingeJoint_property_motor/enable:
  170. .. rst-class:: classref-property
  171. :ref:`bool<class_bool>` **motor/enable** = ``false``
  172. .. rst-class:: classref-property-setget
  173. - void **set_flag** **(** :ref:`Flag<enum_HingeJoint_Flag>` flag, :ref:`bool<class_bool>` enabled **)**
  174. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flag<enum_HingeJoint_Flag>` flag **)** |const|
  175. When activated, a motor turns the hinge.
  176. .. rst-class:: classref-item-separator
  177. ----
  178. .. _class_HingeJoint_property_motor/max_impulse:
  179. .. rst-class:: classref-property
  180. :ref:`float<class_float>` **motor/max_impulse** = ``1.0``
  181. .. rst-class:: classref-property-setget
  182. - void **set_param** **(** :ref:`Param<enum_HingeJoint_Param>` param, :ref:`float<class_float>` value **)**
  183. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint_Param>` param **)** |const|
  184. Maximum acceleration for the motor.
  185. .. rst-class:: classref-item-separator
  186. ----
  187. .. _class_HingeJoint_property_motor/target_velocity:
  188. .. rst-class:: classref-property
  189. :ref:`float<class_float>` **motor/target_velocity** = ``1.0``
  190. .. rst-class:: classref-property-setget
  191. - void **set_param** **(** :ref:`Param<enum_HingeJoint_Param>` param, :ref:`float<class_float>` value **)**
  192. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint_Param>` param **)** |const|
  193. Target speed for the motor.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_HingeJoint_property_params/bias:
  197. .. rst-class:: classref-property
  198. :ref:`float<class_float>` **params/bias** = ``0.3``
  199. .. rst-class:: classref-property-setget
  200. - void **set_param** **(** :ref:`Param<enum_HingeJoint_Param>` param, :ref:`float<class_float>` value **)**
  201. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint_Param>` param **)** |const|
  202. The speed with which the two bodies get pulled together when they move in different directions.
  203. .. rst-class:: classref-section-separator
  204. ----
  205. .. rst-class:: classref-descriptions-group
  206. Method Descriptions
  207. -------------------
  208. .. _class_HingeJoint_method_get_flag:
  209. .. rst-class:: classref-method
  210. :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flag<enum_HingeJoint_Flag>` flag **)** |const|
  211. Returns the value of the specified flag.
  212. .. rst-class:: classref-item-separator
  213. ----
  214. .. _class_HingeJoint_method_get_param:
  215. .. rst-class:: classref-method
  216. :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint_Param>` param **)** |const|
  217. Returns the value of the specified parameter.
  218. .. rst-class:: classref-item-separator
  219. ----
  220. .. _class_HingeJoint_method_set_flag:
  221. .. rst-class:: classref-method
  222. void **set_flag** **(** :ref:`Flag<enum_HingeJoint_Flag>` flag, :ref:`bool<class_bool>` enabled **)**
  223. If ``true``, enables the specified flag.
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_HingeJoint_method_set_param:
  227. .. rst-class:: classref-method
  228. void **set_param** **(** :ref:`Param<enum_HingeJoint_Param>` param, :ref:`float<class_float>` value **)**
  229. Sets the value of the specified parameter.
  230. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  231. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  232. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  233. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`