class_hingejoint.rst 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the HingeJoint.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_HingeJoint:
  6. HingeJoint
  7. ==========
  8. **Inherits:** :ref:`Joint<class_Joint>` **<** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Category:** Core
  10. Brief Description
  11. -----------------
  12. A hinge between two 3D bodies.
  13. Properties
  14. ----------
  15. +---------------------------+-------------------------------------------------------------------------------------+-------+
  16. | :ref:`float<class_float>` | :ref:`angular_limit/bias<class_HingeJoint_property_angular_limit/bias>` | 0.3 |
  17. +---------------------------+-------------------------------------------------------------------------------------+-------+
  18. | :ref:`bool<class_bool>` | :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` | false |
  19. +---------------------------+-------------------------------------------------------------------------------------+-------+
  20. | :ref:`float<class_float>` | :ref:`angular_limit/lower<class_HingeJoint_property_angular_limit/lower>` | -90.0 |
  21. +---------------------------+-------------------------------------------------------------------------------------+-------+
  22. | :ref:`float<class_float>` | :ref:`angular_limit/relaxation<class_HingeJoint_property_angular_limit/relaxation>` | 1.0 |
  23. +---------------------------+-------------------------------------------------------------------------------------+-------+
  24. | :ref:`float<class_float>` | :ref:`angular_limit/softness<class_HingeJoint_property_angular_limit/softness>` | 0.9 |
  25. +---------------------------+-------------------------------------------------------------------------------------+-------+
  26. | :ref:`float<class_float>` | :ref:`angular_limit/upper<class_HingeJoint_property_angular_limit/upper>` | 90.0 |
  27. +---------------------------+-------------------------------------------------------------------------------------+-------+
  28. | :ref:`bool<class_bool>` | :ref:`motor/enable<class_HingeJoint_property_motor/enable>` | false |
  29. +---------------------------+-------------------------------------------------------------------------------------+-------+
  30. | :ref:`float<class_float>` | :ref:`motor/max_impulse<class_HingeJoint_property_motor/max_impulse>` | 1.0 |
  31. +---------------------------+-------------------------------------------------------------------------------------+-------+
  32. | :ref:`float<class_float>` | :ref:`motor/target_velocity<class_HingeJoint_property_motor/target_velocity>` | 1.0 |
  33. +---------------------------+-------------------------------------------------------------------------------------+-------+
  34. | :ref:`float<class_float>` | :ref:`params/bias<class_HingeJoint_property_params/bias>` | 0.3 |
  35. +---------------------------+-------------------------------------------------------------------------------------+-------+
  36. Methods
  37. -------
  38. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`bool<class_bool>` | :ref:`get_flag<class_HingeJoint_method_get_flag>` **(** :ref:`Flag<enum_HingeJoint_Flag>` flag **)** const |
  40. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`float<class_float>` | :ref:`get_param<class_HingeJoint_method_get_param>` **(** :ref:`Param<enum_HingeJoint_Param>` param **)** const |
  42. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  43. | void | :ref:`set_flag<class_HingeJoint_method_set_flag>` **(** :ref:`Flag<enum_HingeJoint_Flag>` flag, :ref:`bool<class_bool>` enabled **)** |
  44. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  45. | void | :ref:`set_param<class_HingeJoint_method_set_param>` **(** :ref:`Param<enum_HingeJoint_Param>` param, :ref:`float<class_float>` value **)** |
  46. +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+
  47. Enumerations
  48. ------------
  49. .. _enum_HingeJoint_Param:
  50. .. _class_HingeJoint_constant_PARAM_BIAS:
  51. .. _class_HingeJoint_constant_PARAM_LIMIT_UPPER:
  52. .. _class_HingeJoint_constant_PARAM_LIMIT_LOWER:
  53. .. _class_HingeJoint_constant_PARAM_LIMIT_BIAS:
  54. .. _class_HingeJoint_constant_PARAM_LIMIT_SOFTNESS:
  55. .. _class_HingeJoint_constant_PARAM_LIMIT_RELAXATION:
  56. .. _class_HingeJoint_constant_PARAM_MOTOR_TARGET_VELOCITY:
  57. .. _class_HingeJoint_constant_PARAM_MOTOR_MAX_IMPULSE:
  58. .. _class_HingeJoint_constant_PARAM_MAX:
  59. enum **Param**:
  60. - **PARAM_BIAS** = **0** --- The speed with which the two bodies get pulled together when they move in different directions.
  61. - **PARAM_LIMIT_UPPER** = **1** --- The maximum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
  62. - **PARAM_LIMIT_LOWER** = **2** --- The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
  63. - **PARAM_LIMIT_BIAS** = **3** --- The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
  64. - **PARAM_LIMIT_SOFTNESS** = **4**
  65. - **PARAM_LIMIT_RELAXATION** = **5** --- The lower this value, the more the rotation gets slowed down.
  66. - **PARAM_MOTOR_TARGET_VELOCITY** = **6** --- Target speed for the motor.
  67. - **PARAM_MOTOR_MAX_IMPULSE** = **7** --- Maximum acceleration for the motor.
  68. - **PARAM_MAX** = **8** --- Represents the size of the :ref:`Param<enum_HingeJoint_Param>` enum.
  69. .. _enum_HingeJoint_Flag:
  70. .. _class_HingeJoint_constant_FLAG_USE_LIMIT:
  71. .. _class_HingeJoint_constant_FLAG_ENABLE_MOTOR:
  72. .. _class_HingeJoint_constant_FLAG_MAX:
  73. enum **Flag**:
  74. - **FLAG_USE_LIMIT** = **0** --- 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.
  75. - **FLAG_ENABLE_MOTOR** = **1** --- When activated, a motor turns the hinge.
  76. - **FLAG_MAX** = **2** --- Represents the size of the :ref:`Flag<enum_HingeJoint_Flag>` enum.
  77. Description
  78. -----------
  79. A HingeJoint normally uses the Z axis of body A as the hinge axis, another axis can be specified when adding it manually though.
  80. Property Descriptions
  81. ---------------------
  82. .. _class_HingeJoint_property_angular_limit/bias:
  83. - :ref:`float<class_float>` **angular_limit/bias**
  84. +-----------+------------------+
  85. | *Default* | 0.3 |
  86. +-----------+------------------+
  87. | *Setter* | set_param(value) |
  88. +-----------+------------------+
  89. | *Getter* | get_param() |
  90. +-----------+------------------+
  91. The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
  92. .. _class_HingeJoint_property_angular_limit/enable:
  93. - :ref:`bool<class_bool>` **angular_limit/enable**
  94. +-----------+-----------------+
  95. | *Default* | false |
  96. +-----------+-----------------+
  97. | *Setter* | set_flag(value) |
  98. +-----------+-----------------+
  99. | *Getter* | get_flag() |
  100. +-----------+-----------------+
  101. 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.
  102. .. _class_HingeJoint_property_angular_limit/lower:
  103. - :ref:`float<class_float>` **angular_limit/lower**
  104. +-----------+-------+
  105. | *Default* | -90.0 |
  106. +-----------+-------+
  107. The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
  108. .. _class_HingeJoint_property_angular_limit/relaxation:
  109. - :ref:`float<class_float>` **angular_limit/relaxation**
  110. +-----------+------------------+
  111. | *Default* | 1.0 |
  112. +-----------+------------------+
  113. | *Setter* | set_param(value) |
  114. +-----------+------------------+
  115. | *Getter* | get_param() |
  116. +-----------+------------------+
  117. The lower this value, the more the rotation gets slowed down.
  118. .. _class_HingeJoint_property_angular_limit/softness:
  119. - :ref:`float<class_float>` **angular_limit/softness**
  120. +-----------+------------------+
  121. | *Default* | 0.9 |
  122. +-----------+------------------+
  123. | *Setter* | set_param(value) |
  124. +-----------+------------------+
  125. | *Getter* | get_param() |
  126. +-----------+------------------+
  127. .. _class_HingeJoint_property_angular_limit/upper:
  128. - :ref:`float<class_float>` **angular_limit/upper**
  129. +-----------+------+
  130. | *Default* | 90.0 |
  131. +-----------+------+
  132. The maximum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is ``true``.
  133. .. _class_HingeJoint_property_motor/enable:
  134. - :ref:`bool<class_bool>` **motor/enable**
  135. +-----------+-----------------+
  136. | *Default* | false |
  137. +-----------+-----------------+
  138. | *Setter* | set_flag(value) |
  139. +-----------+-----------------+
  140. | *Getter* | get_flag() |
  141. +-----------+-----------------+
  142. When activated, a motor turns the hinge.
  143. .. _class_HingeJoint_property_motor/max_impulse:
  144. - :ref:`float<class_float>` **motor/max_impulse**
  145. +-----------+------------------+
  146. | *Default* | 1.0 |
  147. +-----------+------------------+
  148. | *Setter* | set_param(value) |
  149. +-----------+------------------+
  150. | *Getter* | get_param() |
  151. +-----------+------------------+
  152. Maximum acceleration for the motor.
  153. .. _class_HingeJoint_property_motor/target_velocity:
  154. - :ref:`float<class_float>` **motor/target_velocity**
  155. +-----------+------------------+
  156. | *Default* | 1.0 |
  157. +-----------+------------------+
  158. | *Setter* | set_param(value) |
  159. +-----------+------------------+
  160. | *Getter* | get_param() |
  161. +-----------+------------------+
  162. Target speed for the motor.
  163. .. _class_HingeJoint_property_params/bias:
  164. - :ref:`float<class_float>` **params/bias**
  165. +-----------+------------------+
  166. | *Default* | 0.3 |
  167. +-----------+------------------+
  168. | *Setter* | set_param(value) |
  169. +-----------+------------------+
  170. | *Getter* | get_param() |
  171. +-----------+------------------+
  172. The speed with which the two bodies get pulled together when they move in different directions.
  173. Method Descriptions
  174. -------------------
  175. .. _class_HingeJoint_method_get_flag:
  176. - :ref:`bool<class_bool>` **get_flag** **(** :ref:`Flag<enum_HingeJoint_Flag>` flag **)** const
  177. .. _class_HingeJoint_method_get_param:
  178. - :ref:`float<class_float>` **get_param** **(** :ref:`Param<enum_HingeJoint_Param>` param **)** const
  179. .. _class_HingeJoint_method_set_flag:
  180. - void **set_flag** **(** :ref:`Flag<enum_HingeJoint_Flag>` flag, :ref:`bool<class_bool>` enabled **)**
  181. .. _class_HingeJoint_method_set_param:
  182. - void **set_param** **(** :ref:`Param<enum_HingeJoint_Param>` param, :ref:`float<class_float>` value **)**