class_joint2d.rst 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/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. .. rst-class:: classref-item-separator
  43. ----
  44. .. _class_Joint2D_property_disable_collision:
  45. .. rst-class:: classref-property
  46. :ref:`bool<class_bool>` **disable_collision** = ``true``
  47. .. rst-class:: classref-property-setget
  48. - void **set_exclude_nodes_from_collision** **(** :ref:`bool<class_bool>` value **)**
  49. - :ref:`bool<class_bool>` **get_exclude_nodes_from_collision** **(** **)**
  50. If ``true``, :ref:`node_a<class_Joint2D_property_node_a>` and :ref:`node_b<class_Joint2D_property_node_b>` can not collide.
  51. .. rst-class:: classref-item-separator
  52. ----
  53. .. _class_Joint2D_property_node_a:
  54. .. rst-class:: classref-property
  55. :ref:`NodePath<class_NodePath>` **node_a** = ``NodePath("")``
  56. .. rst-class:: classref-property-setget
  57. - void **set_node_a** **(** :ref:`NodePath<class_NodePath>` value **)**
  58. - :ref:`NodePath<class_NodePath>` **get_node_a** **(** **)**
  59. The first body attached to the joint. Must derive from :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
  60. .. rst-class:: classref-item-separator
  61. ----
  62. .. _class_Joint2D_property_node_b:
  63. .. rst-class:: classref-property
  64. :ref:`NodePath<class_NodePath>` **node_b** = ``NodePath("")``
  65. .. rst-class:: classref-property-setget
  66. - void **set_node_b** **(** :ref:`NodePath<class_NodePath>` value **)**
  67. - :ref:`NodePath<class_NodePath>` **get_node_b** **(** **)**
  68. The second body attached to the joint. Must derive from :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
  69. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  70. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  71. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  72. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`