123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- :github_url: hide
- .. DO NOT EDIT THIS FILE!!!
- .. Generated automatically from Godot engine sources.
- .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
- .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/Joint2D.xml.
- .. _class_Joint2D:
- Joint2D
- =======
- **Inherits:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
- **Inherited By:** :ref:`DampedSpringJoint2D<class_DampedSpringJoint2D>`, :ref:`GrooveJoint2D<class_GrooveJoint2D>`, :ref:`PinJoint2D<class_PinJoint2D>`
- Abstract base class for all 2D physics joints.
- .. rst-class:: classref-introduction-group
- Description
- -----------
- Abstract base class for all joints in 2D physics. 2D joints bind together two physics bodies and apply a constraint.
- .. rst-class:: classref-reftable-group
- Properties
- ----------
- .. table::
- :widths: auto
- +---------------------------------+--------------------------------------------------------------------+------------------+
- | :ref:`float<class_float>` | :ref:`bias<class_Joint2D_property_bias>` | ``0.0`` |
- +---------------------------------+--------------------------------------------------------------------+------------------+
- | :ref:`bool<class_bool>` | :ref:`disable_collision<class_Joint2D_property_disable_collision>` | ``true`` |
- +---------------------------------+--------------------------------------------------------------------+------------------+
- | :ref:`NodePath<class_NodePath>` | :ref:`node_a<class_Joint2D_property_node_a>` | ``NodePath("")`` |
- +---------------------------------+--------------------------------------------------------------------+------------------+
- | :ref:`NodePath<class_NodePath>` | :ref:`node_b<class_Joint2D_property_node_b>` | ``NodePath("")`` |
- +---------------------------------+--------------------------------------------------------------------+------------------+
- .. rst-class:: classref-reftable-group
- Methods
- -------
- .. table::
- :widths: auto
- +-----------------------+------------------------------------------------------------------+
- | :ref:`RID<class_RID>` | :ref:`get_rid<class_Joint2D_method_get_rid>` **(** **)** |const| |
- +-----------------------+------------------------------------------------------------------+
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Property Descriptions
- ---------------------
- .. _class_Joint2D_property_bias:
- .. rst-class:: classref-property
- :ref:`float<class_float>` **bias** = ``0.0``
- .. rst-class:: classref-property-setget
- - void **set_bias** **(** :ref:`float<class_float>` value **)**
- - :ref:`float<class_float>` **get_bias** **(** **)**
- 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.
- 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.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Joint2D_property_disable_collision:
- .. rst-class:: classref-property
- :ref:`bool<class_bool>` **disable_collision** = ``true``
- .. rst-class:: classref-property-setget
- - void **set_exclude_nodes_from_collision** **(** :ref:`bool<class_bool>` value **)**
- - :ref:`bool<class_bool>` **get_exclude_nodes_from_collision** **(** **)**
- If ``true``, :ref:`node_a<class_Joint2D_property_node_a>` and :ref:`node_b<class_Joint2D_property_node_b>` can not collide.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Joint2D_property_node_a:
- .. rst-class:: classref-property
- :ref:`NodePath<class_NodePath>` **node_a** = ``NodePath("")``
- .. rst-class:: classref-property-setget
- - void **set_node_a** **(** :ref:`NodePath<class_NodePath>` value **)**
- - :ref:`NodePath<class_NodePath>` **get_node_a** **(** **)**
- The first body attached to the joint. Must derive from :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
- .. rst-class:: classref-item-separator
- ----
- .. _class_Joint2D_property_node_b:
- .. rst-class:: classref-property
- :ref:`NodePath<class_NodePath>` **node_b** = ``NodePath("")``
- .. rst-class:: classref-property-setget
- - void **set_node_b** **(** :ref:`NodePath<class_NodePath>` value **)**
- - :ref:`NodePath<class_NodePath>` **get_node_b** **(** **)**
- The second body attached to the joint. Must derive from :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
- .. rst-class:: classref-section-separator
- ----
- .. rst-class:: classref-descriptions-group
- Method Descriptions
- -------------------
- .. _class_Joint2D_method_get_rid:
- .. rst-class:: classref-method
- :ref:`RID<class_RID>` **get_rid** **(** **)** |const|
- Returns the joint's :ref:`RID<class_RID>`.
- .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
- .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
- .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
- .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
- .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
- .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
- .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
|