class_joint2d.rst 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 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. **Category:** Core
  11. Brief Description
  12. -----------------
  13. Base node for all joint constraints in 2D physics.
  14. Properties
  15. ----------
  16. +---------------------------------+--------------------------------------------------------------------+
  17. | :ref:`float<class_float>` | :ref:`bias<class_Joint2D_property_bias>` |
  18. +---------------------------------+--------------------------------------------------------------------+
  19. | :ref:`bool<class_bool>` | :ref:`disable_collision<class_Joint2D_property_disable_collision>` |
  20. +---------------------------------+--------------------------------------------------------------------+
  21. | :ref:`NodePath<class_NodePath>` | :ref:`node_a<class_Joint2D_property_node_a>` |
  22. +---------------------------------+--------------------------------------------------------------------+
  23. | :ref:`NodePath<class_NodePath>` | :ref:`node_b<class_Joint2D_property_node_b>` |
  24. +---------------------------------+--------------------------------------------------------------------+
  25. Description
  26. -----------
  27. Base node for all joint constraints in 2D physics. Joints take 2 bodies and apply a custom constraint.
  28. Property Descriptions
  29. ---------------------
  30. .. _class_Joint2D_property_bias:
  31. - :ref:`float<class_float>` **bias**
  32. +----------+-----------------+
  33. | *Setter* | set_bias(value) |
  34. +----------+-----------------+
  35. | *Getter* | get_bias() |
  36. +----------+-----------------+
  37. 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. Default value: ``0``
  38. ----
  39. .. _class_Joint2D_property_disable_collision:
  40. - :ref:`bool<class_bool>` **disable_collision**
  41. +----------+-----------------------------------------+
  42. | *Setter* | set_exclude_nodes_from_collision(value) |
  43. +----------+-----------------------------------------+
  44. | *Getter* | get_exclude_nodes_from_collision() |
  45. +----------+-----------------------------------------+
  46. If ``true``, :ref:`node_a<class_Joint2D_property_node_a>` and :ref:`node_b<class_Joint2D_property_node_b>` can collide. Default value: ``false``.
  47. ----
  48. .. _class_Joint2D_property_node_a:
  49. - :ref:`NodePath<class_NodePath>` **node_a**
  50. +----------+-------------------+
  51. | *Setter* | set_node_a(value) |
  52. +----------+-------------------+
  53. | *Getter* | get_node_a() |
  54. +----------+-------------------+
  55. The first body attached to the joint. Must derive from :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
  56. ----
  57. .. _class_Joint2D_property_node_b:
  58. - :ref:`NodePath<class_NodePath>` **node_b**
  59. +----------+-------------------+
  60. | *Setter* | set_node_b(value) |
  61. +----------+-------------------+
  62. | *Getter* | get_node_b() |
  63. +----------+-------------------+
  64. The second body attached to the joint. Must derive from :ref:`PhysicsBody2D<class_PhysicsBody2D>`.