mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-04 10:09:56 +03:00
152 lines
7.3 KiB
ReStructuredText
152 lines
7.3 KiB
ReStructuredText
:github_url: hide
|
||
|
||
.. _class_Joint2D:
|
||
|
||
Joint2D
|
||
=======
|
||
|
||
**Наследует:** :ref:`Node2D<class_Node2D>` **<** :ref:`CanvasItem<class_CanvasItem>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
||
|
||
**Наследуется от:** :ref:`DampedSpringJoint2D<class_DampedSpringJoint2D>`, :ref:`GrooveJoint2D<class_GrooveJoint2D>`, :ref:`PinJoint2D<class_PinJoint2D>`
|
||
|
||
Абстрактный базовый класс для всех 2D физических суставов.
|
||
|
||
.. rst-class:: classref-introduction-group
|
||
|
||
Описание
|
||
----------------
|
||
|
||
Абстрактный базовый класс для всех суставов в 2D-физике. 2D-суставы связывают вместе два физических тела (:ref:`node_a<class_Joint2D_property_node_a>` и :ref:`node_b<class_Joint2D_property_node_b>`) и применяют ограничение.
|
||
|
||
.. rst-class:: classref-reftable-group
|
||
|
||
Свойства
|
||
----------------
|
||
|
||
.. 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
|
||
|
||
Методы
|
||
------------
|
||
|
||
.. 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
|
||
|
||
Описания свойств
|
||
--------------------------------
|
||
|
||
.. _class_Joint2D_property_bias:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`float<class_float>` **bias** = ``0.0`` :ref:`🔗<class_Joint2D_property_bias>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_bias**\ (\ value\: :ref:`float<class_float>`\ )
|
||
- :ref:`float<class_float>` **get_bias**\ (\ )
|
||
|
||
Когда :ref:`node_a<class_Joint2D_property_node_a>` и :ref:`node_b<class_Joint2D_property_node_b>` движутся в разных направлениях, :ref:`bias<class_Joint2D_property_bias>` управляет тем, как быстро сочленение тянет их обратно в исходное положение. Чем ниже :ref:`bias<class_Joint2D_property_bias>`, тем больше два тела могут тянуть сочленение.
|
||
|
||
При установке ``0`` используется значение по умолчанию из :ref:`ProjectSettings.physics/2d/solver/default_constraint_bias<class_ProjectSettings_property_physics/2d/solver/default_constraint_bias>`.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Joint2D_property_disable_collision:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`bool<class_bool>` **disable_collision** = ``true`` :ref:`🔗<class_Joint2D_property_disable_collision>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_exclude_nodes_from_collision**\ (\ value\: :ref:`bool<class_bool>`\ )
|
||
- :ref:`bool<class_bool>` **get_exclude_nodes_from_collision**\ (\ )
|
||
|
||
Если ``true``, два связанных вместе тела не сталкиваются друг с другом.
|
||
|
||
.. rst-class:: classref-item-separator
|
||
|
||
----
|
||
|
||
.. _class_Joint2D_property_node_a:
|
||
|
||
.. rst-class:: classref-property
|
||
|
||
:ref:`NodePath<class_NodePath>` **node_a** = ``NodePath("")`` :ref:`🔗<class_Joint2D_property_node_a>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_node_a**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
|
||
- :ref:`NodePath<class_NodePath>` **get_node_a**\ (\ )
|
||
|
||
Путь к первому телу (A), прикрепленному к суставу. Узел должен наследовать :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("")`` :ref:`🔗<class_Joint2D_property_node_b>`
|
||
|
||
.. rst-class:: classref-property-setget
|
||
|
||
- |void| **set_node_b**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
|
||
- :ref:`NodePath<class_NodePath>` **get_node_b**\ (\ )
|
||
|
||
Путь ко второму телу (B), прикрепленному к суставу. Узел должен наследовать :ref:`PhysicsBody2D<class_PhysicsBody2D>`.
|
||
|
||
.. rst-class:: classref-section-separator
|
||
|
||
----
|
||
|
||
.. rst-class:: classref-descriptions-group
|
||
|
||
Описания метода
|
||
------------------------------
|
||
|
||
.. _class_Joint2D_method_get_rid:
|
||
|
||
.. rst-class:: classref-method
|
||
|
||
:ref:`RID<class_RID>` **get_rid**\ (\ ) |const| :ref:`🔗<class_Joint2D_method_get_rid>`
|
||
|
||
Возвращает внутренний :ref:`RID<class_RID>` сочленения из :ref:`PhysicsServer2D<class_PhysicsServer2D>`.
|
||
|
||
.. |virtual| replace:: :abbr:`virtual (Этот метод обычно должен быть переопределен пользователем, чтобы иметь какой-либо эффект.)`
|
||
.. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)`
|
||
.. |const| replace:: :abbr:`const (Этот метод не имеет побочных эффектов. Он не изменяет ни одну из переменных-членов экземпляра.)`
|
||
.. |vararg| replace:: :abbr:`vararg (Этот метод принимает любое количество аргументов после описанных здесь.)`
|
||
.. |constructor| replace:: :abbr:`constructor (Этот метод используется для создания типа.)`
|
||
.. |static| replace:: :abbr:`static (Этот метод не нуждается в вызове экземпляра, поэтому его можно вызвать напрямую, используя имя класса.)`
|
||
.. |operator| replace:: :abbr:`operator (Этот метод описывает допустимый оператор для использования с этим типом в качестве левого операнда.)`
|
||
.. |bitfield| replace:: :abbr:`BitField (Это значение является целым числом, составленным как битовая маска следующих флагов.)`
|
||
.. |void| replace:: :abbr:`void (Нет возвращаемого значения.)`
|