class_hingejoint3d.rst 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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/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>`\ (\ flag\: :ref:`Flag<enum_HingeJoint3D_Flag>`\ ) |const| |
  48. +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`float<class_float>` | :ref:`get_param<class_HingeJoint3D_method_get_param>`\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`\ ) |const| |
  50. +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  51. | |void| | :ref:`set_flag<class_HingeJoint3D_method_set_flag>`\ (\ flag\: :ref:`Flag<enum_HingeJoint3D_Flag>`, enabled\: :ref:`bool<class_bool>`\ ) |
  52. +---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
  53. | |void| | :ref:`set_param<class_HingeJoint3D_method_set_param>`\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`, value\: :ref:`float<class_float>`\ ) |
  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**: :ref:`🔗<enum_HingeJoint3D_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. **Deprecated:** This property is never used by the engine and is kept for compatibility purpose.
  83. .. _class_HingeJoint3D_constant_PARAM_LIMIT_RELAXATION:
  84. .. rst-class:: classref-enumeration-constant
  85. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_LIMIT_RELAXATION** = ``5``
  86. The lower this value, the more the rotation gets slowed down.
  87. .. _class_HingeJoint3D_constant_PARAM_MOTOR_TARGET_VELOCITY:
  88. .. rst-class:: classref-enumeration-constant
  89. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_MOTOR_TARGET_VELOCITY** = ``6``
  90. Target speed for the motor.
  91. .. _class_HingeJoint3D_constant_PARAM_MOTOR_MAX_IMPULSE:
  92. .. rst-class:: classref-enumeration-constant
  93. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_MOTOR_MAX_IMPULSE** = ``7``
  94. Maximum acceleration for the motor.
  95. .. _class_HingeJoint3D_constant_PARAM_MAX:
  96. .. rst-class:: classref-enumeration-constant
  97. :ref:`Param<enum_HingeJoint3D_Param>` **PARAM_MAX** = ``8``
  98. Represents the size of the :ref:`Param<enum_HingeJoint3D_Param>` enum.
  99. .. rst-class:: classref-item-separator
  100. ----
  101. .. _enum_HingeJoint3D_Flag:
  102. .. rst-class:: classref-enumeration
  103. enum **Flag**: :ref:`🔗<enum_HingeJoint3D_Flag>`
  104. .. _class_HingeJoint3D_constant_FLAG_USE_LIMIT:
  105. .. rst-class:: classref-enumeration-constant
  106. :ref:`Flag<enum_HingeJoint3D_Flag>` **FLAG_USE_LIMIT** = ``0``
  107. 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.
  108. .. _class_HingeJoint3D_constant_FLAG_ENABLE_MOTOR:
  109. .. rst-class:: classref-enumeration-constant
  110. :ref:`Flag<enum_HingeJoint3D_Flag>` **FLAG_ENABLE_MOTOR** = ``1``
  111. When activated, a motor turns the hinge.
  112. .. _class_HingeJoint3D_constant_FLAG_MAX:
  113. .. rst-class:: classref-enumeration-constant
  114. :ref:`Flag<enum_HingeJoint3D_Flag>` **FLAG_MAX** = ``2``
  115. Represents the size of the :ref:`Flag<enum_HingeJoint3D_Flag>` enum.
  116. .. rst-class:: classref-section-separator
  117. ----
  118. .. rst-class:: classref-descriptions-group
  119. Property Descriptions
  120. ---------------------
  121. .. _class_HingeJoint3D_property_angular_limit/bias:
  122. .. rst-class:: classref-property
  123. :ref:`float<class_float>` **angular_limit/bias** = ``0.3`` :ref:`🔗<class_HingeJoint3D_property_angular_limit/bias>`
  124. .. rst-class:: classref-property-setget
  125. - |void| **set_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`, value\: :ref:`float<class_float>`\ )
  126. - :ref:`float<class_float>` **get_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`\ ) |const|
  127. The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
  128. .. rst-class:: classref-item-separator
  129. ----
  130. .. _class_HingeJoint3D_property_angular_limit/enable:
  131. .. rst-class:: classref-property
  132. :ref:`bool<class_bool>` **angular_limit/enable** = ``false`` :ref:`🔗<class_HingeJoint3D_property_angular_limit/enable>`
  133. .. rst-class:: classref-property-setget
  134. - |void| **set_flag**\ (\ flag\: :ref:`Flag<enum_HingeJoint3D_Flag>`, enabled\: :ref:`bool<class_bool>`\ )
  135. - :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flag<enum_HingeJoint3D_Flag>`\ ) |const|
  136. 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.
  137. .. rst-class:: classref-item-separator
  138. ----
  139. .. _class_HingeJoint3D_property_angular_limit/lower:
  140. .. rst-class:: classref-property
  141. :ref:`float<class_float>` **angular_limit/lower** = ``-1.5708`` :ref:`🔗<class_HingeJoint3D_property_angular_limit/lower>`
  142. .. rst-class:: classref-property-setget
  143. - |void| **set_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`, value\: :ref:`float<class_float>`\ )
  144. - :ref:`float<class_float>` **get_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`\ ) |const|
  145. The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint3D_property_angular_limit/enable>` is ``true``.
  146. .. rst-class:: classref-item-separator
  147. ----
  148. .. _class_HingeJoint3D_property_angular_limit/relaxation:
  149. .. rst-class:: classref-property
  150. :ref:`float<class_float>` **angular_limit/relaxation** = ``1.0`` :ref:`🔗<class_HingeJoint3D_property_angular_limit/relaxation>`
  151. .. rst-class:: classref-property-setget
  152. - |void| **set_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`, value\: :ref:`float<class_float>`\ )
  153. - :ref:`float<class_float>` **get_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`\ ) |const|
  154. The lower this value, the more the rotation gets slowed down.
  155. .. rst-class:: classref-item-separator
  156. ----
  157. .. _class_HingeJoint3D_property_angular_limit/softness:
  158. .. rst-class:: classref-property
  159. :ref:`float<class_float>` **angular_limit/softness** = ``0.9`` :ref:`🔗<class_HingeJoint3D_property_angular_limit/softness>`
  160. .. rst-class:: classref-property-setget
  161. - |void| **set_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`, value\: :ref:`float<class_float>`\ )
  162. - :ref:`float<class_float>` **get_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`\ ) |const|
  163. **Deprecated:** This property is never set by the engine and is kept for compatibility purposes.
  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`` :ref:`🔗<class_HingeJoint3D_property_angular_limit/upper>`
  169. .. rst-class:: classref-property-setget
  170. - |void| **set_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`, value\: :ref:`float<class_float>`\ )
  171. - :ref:`float<class_float>` **get_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_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`` :ref:`🔗<class_HingeJoint3D_property_motor/enable>`
  178. .. rst-class:: classref-property-setget
  179. - |void| **set_flag**\ (\ flag\: :ref:`Flag<enum_HingeJoint3D_Flag>`, enabled\: :ref:`bool<class_bool>`\ )
  180. - :ref:`bool<class_bool>` **get_flag**\ (\ flag\: :ref:`Flag<enum_HingeJoint3D_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`` :ref:`🔗<class_HingeJoint3D_property_motor/max_impulse>`
  187. .. rst-class:: classref-property-setget
  188. - |void| **set_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`, value\: :ref:`float<class_float>`\ )
  189. - :ref:`float<class_float>` **get_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_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`` :ref:`🔗<class_HingeJoint3D_property_motor/target_velocity>`
  196. .. rst-class:: classref-property-setget
  197. - |void| **set_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`, value\: :ref:`float<class_float>`\ )
  198. - :ref:`float<class_float>` **get_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_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`` :ref:`🔗<class_HingeJoint3D_property_params/bias>`
  205. .. rst-class:: classref-property-setget
  206. - |void| **set_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`, value\: :ref:`float<class_float>`\ )
  207. - :ref:`float<class_float>` **get_param**\ (\ param\: :ref:`Param<enum_HingeJoint3D_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**\ (\ flag\: :ref:`Flag<enum_HingeJoint3D_Flag>`\ ) |const| :ref:`🔗<class_HingeJoint3D_method_get_flag>`
  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**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`\ ) |const| :ref:`🔗<class_HingeJoint3D_method_get_param>`
  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**\ (\ flag\: :ref:`Flag<enum_HingeJoint3D_Flag>`, enabled\: :ref:`bool<class_bool>`\ ) :ref:`🔗<class_HingeJoint3D_method_set_flag>`
  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**\ (\ param\: :ref:`Param<enum_HingeJoint3D_Param>`, value\: :ref:`float<class_float>`\ ) :ref:`🔗<class_HingeJoint3D_method_set_param>`
  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.)`
  243. .. |void| replace:: :abbr:`void (No return value.)`