class_joint2d.rst 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. :github_url: hide
  2. .. Generated automatically by doc/tools/make_rst.py in Godot's source tree.
  3. .. DO NOT EDIT THIS FILE, but the Joint2D.xml source instead.
  4. .. The source is found in doc/classes or modules/<name>/doc_classes.
  5. .. _class_Joint2D:
  6. Joint2D
  7. =======
  8. **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  9. **Inherited By:** :ref:`DampedSpringJoint2D<class_DampedSpringJoint2D>`, :ref:`GrooveJoint2D<class_GrooveJoint2D>`, :ref:`PinJoint2D<class_PinJoint2D>`
  10. Base node for all joint constraints in 2D physics.
  11. Description
  12. -----------
  13. Base node for all joint constraints in 2D physics. Joints take 2 bodies and apply a custom constraint.
  14. Properties
  15. ----------
  16. +---------------------------------+--------------------------------------------------------------------+------------------+
  17. | :ref:`float<class_float>` | :ref:`bias<class_Joint2D_property_bias>` | ``0.0`` |
  18. +---------------------------------+--------------------------------------------------------------------+------------------+
  19. | :ref:`bool<class_bool>` | :ref:`disable_collision<class_Joint2D_property_disable_collision>` | ``true`` |
  20. +---------------------------------+--------------------------------------------------------------------+------------------+
  21. | :ref:`NodePath<class_NodePath>` | :ref:`node_a<class_Joint2D_property_node_a>` | ``NodePath("")`` |
  22. +---------------------------------+--------------------------------------------------------------------+------------------+
  23. | :ref:`NodePath<class_NodePath>` | :ref:`node_b<class_Joint2D_property_node_b>` | ``NodePath("")`` |
  24. +---------------------------------+--------------------------------------------------------------------+------------------+
  25. Property Descriptions
  26. ---------------------
  27. .. _class_Joint2D_property_bias:
  28. - :ref:`float<class_float>` **bias**
  29. +-----------+-----------------+
  30. | *Default* | ``0.0`` |
  31. +-----------+-----------------+
  32. | *Setter* | set_bias(value) |
  33. +-----------+-----------------+
  34. | *Getter* | get_bias() |
  35. +-----------+-----------------+
  36. 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.
  37. 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.
  38. ----
  39. .. _class_Joint2D_property_disable_collision:
  40. - :ref:`bool<class_bool>` **disable_collision**
  41. +-----------+-----------------------------------------+
  42. | *Default* | ``true`` |
  43. +-----------+-----------------------------------------+
  44. | *Setter* | set_exclude_nodes_from_collision(value) |
  45. +-----------+-----------------------------------------+
  46. | *Getter* | get_exclude_nodes_from_collision() |
  47. +-----------+-----------------------------------------+
  48. If ``true``, :ref:`node_a<class_Joint2D_property_node_a>` and :ref:`node_b<class_Joint2D_property_node_b>` can not collide.
  49. ----
  50. .. _class_Joint2D_property_node_a:
  51. - :ref:`NodePath<class_NodePath>` **node_a**
  52. +-----------+-------------------+
  53. | *Default* | ``NodePath("")`` |
  54. +-----------+-------------------+
  55. | *Setter* | set_node_a(value) |
  56. +-----------+-------------------+
  57. | *Getter* | get_node_a() |
  58. +-----------+-------------------+
  59. The first body attached to the joint. Must derive from :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
  60. ----
  61. .. _class_Joint2D_property_node_b:
  62. - :ref:`NodePath<class_NodePath>` **node_b**
  63. +-----------+-------------------+
  64. | *Default* | ``NodePath("")`` |
  65. +-----------+-------------------+
  66. | *Setter* | set_node_b(value) |
  67. +-----------+-------------------+
  68. | *Getter* | get_node_b() |
  69. +-----------+-------------------+
  70. The second body attached to the joint. Must derive from :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
  71. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  72. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  73. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  74. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  75. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  76. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`