class_joint2d.rst 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/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. Base node for all joint constraints in 2D physics.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Base node for all joint constraints in 2D physics. Joints take 2 bodies and apply a custom 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-section-separator
  31. ----
  32. .. rst-class:: classref-descriptions-group
  33. Property Descriptions
  34. ---------------------
  35. .. _class_Joint2D_property_bias:
  36. .. rst-class:: classref-property
  37. :ref:`float<class_float>` **bias** = ``0.0``
  38. .. rst-class:: classref-property-setget
  39. - void **set_bias** **(** :ref:`float<class_float>` value **)**
  40. - :ref:`float<class_float>` **get_bias** **(** **)**
  41. When :ref:`node_a<class_Joint2D_property_node_a>` and :ref:`node_b<class_Joint2D_property_node_b>` move in different directions the ``bias`` controls how fast the joint pulls them back to their original position. The lower the ``bias`` the more the two bodies can pull on the joint.
  42. 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.
  43. .. rst-class:: classref-item-separator
  44. ----
  45. .. _class_Joint2D_property_disable_collision:
  46. .. rst-class:: classref-property
  47. :ref:`bool<class_bool>` **disable_collision** = ``true``
  48. .. rst-class:: classref-property-setget
  49. - void **set_exclude_nodes_from_collision** **(** :ref:`bool<class_bool>` value **)**
  50. - :ref:`bool<class_bool>` **get_exclude_nodes_from_collision** **(** **)**
  51. If ``true``, :ref:`node_a<class_Joint2D_property_node_a>` and :ref:`node_b<class_Joint2D_property_node_b>` can not collide.
  52. .. rst-class:: classref-item-separator
  53. ----
  54. .. _class_Joint2D_property_node_a:
  55. .. rst-class:: classref-property
  56. :ref:`NodePath<class_NodePath>` **node_a** = ``NodePath("")``
  57. .. rst-class:: classref-property-setget
  58. - void **set_node_a** **(** :ref:`NodePath<class_NodePath>` value **)**
  59. - :ref:`NodePath<class_NodePath>` **get_node_a** **(** **)**
  60. The first body attached to the joint. Must derive from :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
  61. .. rst-class:: classref-item-separator
  62. ----
  63. .. _class_Joint2D_property_node_b:
  64. .. rst-class:: classref-property
  65. :ref:`NodePath<class_NodePath>` **node_b** = ``NodePath("")``
  66. .. rst-class:: classref-property-setget
  67. - void **set_node_b** **(** :ref:`NodePath<class_NodePath>` value **)**
  68. - :ref:`NodePath<class_NodePath>` **get_node_b** **(** **)**
  69. The second body attached to the joint. Must derive from :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
  70. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  71. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  72. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  73. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  74. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  75. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`