class_joint2d.rst 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  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/Joint2D.xml.
  6. .. _class_Joint2D:
  7. Joint2D
  8. =======
  9. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. **Inherited By:** :ref:`DampedSpringJoint2D<class_DampedSpringJoint2D>`, :ref:`GrooveJoint2D<class_GrooveJoint2D>`, :ref:`PinJoint2D<class_PinJoint2D>`
  11. Abstract base class for all 2D physics joints.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Abstract base class for all joints in 2D physics. 2D joints bind together two physics bodies (:ref:`node_a<class_Joint2D_property_node_a>` and :ref:`node_b<class_Joint2D_property_node_b>`) and apply a constraint.
  16. .. rst-class:: classref-reftable-group
  17. Properties
  18. ----------
  19. .. table::
  20. :widths: auto
  21. +---------------------------------+--------------------------------------------------------------------+------------------+
  22. | :ref:`float<class_float>` | :ref:`bias<class_Joint2D_property_bias>` | ``0.0`` |
  23. +---------------------------------+--------------------------------------------------------------------+------------------+
  24. | :ref:`bool<class_bool>` | :ref:`disable_collision<class_Joint2D_property_disable_collision>` | ``true`` |
  25. +---------------------------------+--------------------------------------------------------------------+------------------+
  26. | :ref:`NodePath<class_NodePath>` | :ref:`node_a<class_Joint2D_property_node_a>` | ``NodePath("")`` |
  27. +---------------------------------+--------------------------------------------------------------------+------------------+
  28. | :ref:`NodePath<class_NodePath>` | :ref:`node_b<class_Joint2D_property_node_b>` | ``NodePath("")`` |
  29. +---------------------------------+--------------------------------------------------------------------+------------------+
  30. .. rst-class:: classref-reftable-group
  31. Methods
  32. -------
  33. .. table::
  34. :widths: auto
  35. +-----------------------+------------------------------------------------------------+
  36. | :ref:`RID<class_RID>` | :ref:`get_rid<class_Joint2D_method_get_rid>`\ (\ ) |const| |
  37. +-----------------------+------------------------------------------------------------+
  38. .. rst-class:: classref-section-separator
  39. ----
  40. .. rst-class:: classref-descriptions-group
  41. Property Descriptions
  42. ---------------------
  43. .. _class_Joint2D_property_bias:
  44. .. rst-class:: classref-property
  45. :ref:`float<class_float>` **bias** = ``0.0`` :ref:`🔗<class_Joint2D_property_bias>`
  46. .. rst-class:: classref-property-setget
  47. - |void| **set_bias**\ (\ value\: :ref:`float<class_float>`\ )
  48. - :ref:`float<class_float>` **get_bias**\ (\ )
  49. When :ref:`node_a<class_Joint2D_property_node_a>` and :ref:`node_b<class_Joint2D_property_node_b>` move in different directions the :ref:`bias<class_Joint2D_property_bias>` controls how fast the joint pulls them back to their original position. The lower the :ref:`bias<class_Joint2D_property_bias>` the more the two bodies can pull on the joint.
  50. When set to ``0``, the default value from :ref:`ProjectSettings.physics/2d/solver/default_constraint_bias<class_ProjectSettings_property_physics/2d/solver/default_constraint_bias>` is used.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_Joint2D_property_disable_collision:
  54. .. rst-class:: classref-property
  55. :ref:`bool<class_bool>` **disable_collision** = ``true`` :ref:`🔗<class_Joint2D_property_disable_collision>`
  56. .. rst-class:: classref-property-setget
  57. - |void| **set_exclude_nodes_from_collision**\ (\ value\: :ref:`bool<class_bool>`\ )
  58. - :ref:`bool<class_bool>` **get_exclude_nodes_from_collision**\ (\ )
  59. If ``true``, the two bodies bound together do not collide with each other.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_Joint2D_property_node_a:
  63. .. rst-class:: classref-property
  64. :ref:`NodePath<class_NodePath>` **node_a** = ``NodePath("")`` :ref:`🔗<class_Joint2D_property_node_a>`
  65. .. rst-class:: classref-property-setget
  66. - |void| **set_node_a**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  67. - :ref:`NodePath<class_NodePath>` **get_node_a**\ (\ )
  68. Path to the first body (A) attached to the joint. The node must inherit :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
  69. .. rst-class:: classref-item-separator
  70. ----
  71. .. _class_Joint2D_property_node_b:
  72. .. rst-class:: classref-property
  73. :ref:`NodePath<class_NodePath>` **node_b** = ``NodePath("")`` :ref:`🔗<class_Joint2D_property_node_b>`
  74. .. rst-class:: classref-property-setget
  75. - |void| **set_node_b**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
  76. - :ref:`NodePath<class_NodePath>` **get_node_b**\ (\ )
  77. Path to the second body (B) attached to the joint. The node must inherit :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
  78. .. rst-class:: classref-section-separator
  79. ----
  80. .. rst-class:: classref-descriptions-group
  81. Method Descriptions
  82. -------------------
  83. .. _class_Joint2D_method_get_rid:
  84. .. rst-class:: classref-method
  85. :ref:`RID<class_RID>` **get_rid**\ (\ ) |const| :ref:`🔗<class_Joint2D_method_get_rid>`
  86. Returns the joint's internal :ref:`RID<class_RID>` from the :ref:`PhysicsServer2D<class_PhysicsServer2D>`.
  87. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  88. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  89. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  90. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  91. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  92. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  93. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  94. .. |void| replace:: :abbr:`void (No return value.)`