class_pinjoint2d.rst 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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/PinJoint2D.xml.
  6. .. _class_PinJoint2D:
  7. PinJoint2D
  8. ==========
  9. **Inherits:** :ref:`Joint2D<class_Joint2D>` **<** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely rotate.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely rotate. For example, a :ref:`RigidBody2D<class_RigidBody2D>` can be attached to a :ref:`StaticBody2D<class_StaticBody2D>` to create a pendulum or a seesaw.
  15. .. rst-class:: classref-reftable-group
  16. Properties
  17. ----------
  18. .. table::
  19. :widths: auto
  20. +---------------------------+-------------------------------------------------------------------------------+-----------+
  21. | :ref:`bool<class_bool>` | :ref:`angular_limit_enabled<class_PinJoint2D_property_angular_limit_enabled>` | ``false`` |
  22. +---------------------------+-------------------------------------------------------------------------------+-----------+
  23. | :ref:`float<class_float>` | :ref:`angular_limit_lower<class_PinJoint2D_property_angular_limit_lower>` | ``0.0`` |
  24. +---------------------------+-------------------------------------------------------------------------------+-----------+
  25. | :ref:`float<class_float>` | :ref:`angular_limit_upper<class_PinJoint2D_property_angular_limit_upper>` | ``0.0`` |
  26. +---------------------------+-------------------------------------------------------------------------------+-----------+
  27. | :ref:`bool<class_bool>` | :ref:`motor_enabled<class_PinJoint2D_property_motor_enabled>` | ``false`` |
  28. +---------------------------+-------------------------------------------------------------------------------+-----------+
  29. | :ref:`float<class_float>` | :ref:`motor_target_velocity<class_PinJoint2D_property_motor_target_velocity>` | ``0.0`` |
  30. +---------------------------+-------------------------------------------------------------------------------+-----------+
  31. | :ref:`float<class_float>` | :ref:`softness<class_PinJoint2D_property_softness>` | ``0.0`` |
  32. +---------------------------+-------------------------------------------------------------------------------+-----------+
  33. .. rst-class:: classref-section-separator
  34. ----
  35. .. rst-class:: classref-descriptions-group
  36. Property Descriptions
  37. ---------------------
  38. .. _class_PinJoint2D_property_angular_limit_enabled:
  39. .. rst-class:: classref-property
  40. :ref:`bool<class_bool>` **angular_limit_enabled** = ``false`` :ref:`🔗<class_PinJoint2D_property_angular_limit_enabled>`
  41. .. rst-class:: classref-property-setget
  42. - |void| **set_angular_limit_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  43. - :ref:`bool<class_bool>` **is_angular_limit_enabled**\ (\ )
  44. If ``true``, the pin maximum and minimum rotation, defined by :ref:`angular_limit_lower<class_PinJoint2D_property_angular_limit_lower>` and :ref:`angular_limit_upper<class_PinJoint2D_property_angular_limit_upper>` are applied.
  45. .. rst-class:: classref-item-separator
  46. ----
  47. .. _class_PinJoint2D_property_angular_limit_lower:
  48. .. rst-class:: classref-property
  49. :ref:`float<class_float>` **angular_limit_lower** = ``0.0`` :ref:`🔗<class_PinJoint2D_property_angular_limit_lower>`
  50. .. rst-class:: classref-property-setget
  51. - |void| **set_angular_limit_lower**\ (\ value\: :ref:`float<class_float>`\ )
  52. - :ref:`float<class_float>` **get_angular_limit_lower**\ (\ )
  53. The minimum rotation. Only active if :ref:`angular_limit_enabled<class_PinJoint2D_property_angular_limit_enabled>` is ``true``.
  54. .. rst-class:: classref-item-separator
  55. ----
  56. .. _class_PinJoint2D_property_angular_limit_upper:
  57. .. rst-class:: classref-property
  58. :ref:`float<class_float>` **angular_limit_upper** = ``0.0`` :ref:`🔗<class_PinJoint2D_property_angular_limit_upper>`
  59. .. rst-class:: classref-property-setget
  60. - |void| **set_angular_limit_upper**\ (\ value\: :ref:`float<class_float>`\ )
  61. - :ref:`float<class_float>` **get_angular_limit_upper**\ (\ )
  62. The maximum rotation. Only active if :ref:`angular_limit_enabled<class_PinJoint2D_property_angular_limit_enabled>` is ``true``.
  63. .. rst-class:: classref-item-separator
  64. ----
  65. .. _class_PinJoint2D_property_motor_enabled:
  66. .. rst-class:: classref-property
  67. :ref:`bool<class_bool>` **motor_enabled** = ``false`` :ref:`🔗<class_PinJoint2D_property_motor_enabled>`
  68. .. rst-class:: classref-property-setget
  69. - |void| **set_motor_enabled**\ (\ value\: :ref:`bool<class_bool>`\ )
  70. - :ref:`bool<class_bool>` **is_motor_enabled**\ (\ )
  71. When activated, a motor turns the pin.
  72. .. rst-class:: classref-item-separator
  73. ----
  74. .. _class_PinJoint2D_property_motor_target_velocity:
  75. .. rst-class:: classref-property
  76. :ref:`float<class_float>` **motor_target_velocity** = ``0.0`` :ref:`🔗<class_PinJoint2D_property_motor_target_velocity>`
  77. .. rst-class:: classref-property-setget
  78. - |void| **set_motor_target_velocity**\ (\ value\: :ref:`float<class_float>`\ )
  79. - :ref:`float<class_float>` **get_motor_target_velocity**\ (\ )
  80. Target speed for the motor. In radians per second.
  81. .. rst-class:: classref-item-separator
  82. ----
  83. .. _class_PinJoint2D_property_softness:
  84. .. rst-class:: classref-property
  85. :ref:`float<class_float>` **softness** = ``0.0`` :ref:`🔗<class_PinJoint2D_property_softness>`
  86. .. rst-class:: classref-property-setget
  87. - |void| **set_softness**\ (\ value\: :ref:`float<class_float>`\ )
  88. - :ref:`float<class_float>` **get_softness**\ (\ )
  89. The higher this value, the more the bond to the pinned partner can flex.
  90. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  91. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  92. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  93. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  94. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  95. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  96. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  97. .. |void| replace:: :abbr:`void (No return value.)`