mirror of
https://github.com/godotengine/godot-docs-l10n.git
synced 2026-01-05 14:10:19 +03:00
161 lines
6.4 KiB
ReStructuredText
161 lines
6.4 KiB
ReStructuredText
:github_url: hide
|
|
|
|
.. _class_Joint3D:
|
|
|
|
Joint3D
|
|
=======
|
|
|
|
**繼承:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
|
|
|
|
**被繼承:** :ref:`ConeTwistJoint3D<class_ConeTwistJoint3D>`, :ref:`Generic6DOFJoint3D<class_Generic6DOFJoint3D>`, :ref:`HingeJoint3D<class_HingeJoint3D>`, :ref:`PinJoint3D<class_PinJoint3D>`, :ref:`SliderJoint3D<class_SliderJoint3D>`
|
|
|
|
所有 3D 物理關節的抽象基底類別。
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
說明
|
|
----
|
|
|
|
Abstract base class for all joints in 3D physics. 3D joints bind together two physics bodies (:ref:`node_a<class_Joint3D_property_node_a>` and :ref:`node_b<class_Joint3D_property_node_b>`) and apply a constraint. If only one body is defined, it is attached to a fixed :ref:`StaticBody3D<class_StaticBody3D>` without collision shapes.
|
|
|
|
.. rst-class:: classref-introduction-group
|
|
|
|
教學
|
|
----
|
|
|
|
- `3D 貨車鎮演示 <https://godotengine.org/asset-library/asset/2752>`__
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
屬性
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+---------------------------------+------------------------------------------------------------------------------------------+------------------+
|
|
| :ref:`bool<class_bool>` | :ref:`exclude_nodes_from_collision<class_Joint3D_property_exclude_nodes_from_collision>` | ``true`` |
|
|
+---------------------------------+------------------------------------------------------------------------------------------+------------------+
|
|
| :ref:`NodePath<class_NodePath>` | :ref:`node_a<class_Joint3D_property_node_a>` | ``NodePath("")`` |
|
|
+---------------------------------+------------------------------------------------------------------------------------------+------------------+
|
|
| :ref:`NodePath<class_NodePath>` | :ref:`node_b<class_Joint3D_property_node_b>` | ``NodePath("")`` |
|
|
+---------------------------------+------------------------------------------------------------------------------------------+------------------+
|
|
| :ref:`int<class_int>` | :ref:`solver_priority<class_Joint3D_property_solver_priority>` | ``1`` |
|
|
+---------------------------------+------------------------------------------------------------------------------------------+------------------+
|
|
|
|
.. rst-class:: classref-reftable-group
|
|
|
|
方法
|
|
----
|
|
|
|
.. table::
|
|
:widths: auto
|
|
|
|
+-----------------------+------------------------------------------------------------+
|
|
| :ref:`RID<class_RID>` | :ref:`get_rid<class_Joint3D_method_get_rid>`\ (\ ) |const| |
|
|
+-----------------------+------------------------------------------------------------+
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
屬性說明
|
|
--------
|
|
|
|
.. _class_Joint3D_property_exclude_nodes_from_collision:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`bool<class_bool>` **exclude_nodes_from_collision** = ``true`` :ref:`🔗<class_Joint3D_property_exclude_nodes_from_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**\ (\ )
|
|
|
|
If ``true``, the two bodies bound together do not collide with each other.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Joint3D_property_node_a:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`NodePath<class_NodePath>` **node_a** = ``NodePath("")`` :ref:`🔗<class_Joint3D_property_node_a>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_node_a**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
|
|
- :ref:`NodePath<class_NodePath>` **get_node_a**\ (\ )
|
|
|
|
Path to the first node (A) attached to the joint. The node must inherit :ref:`PhysicsBody3D<class_PhysicsBody3D>`.
|
|
|
|
If left empty and :ref:`node_b<class_Joint3D_property_node_b>` is set, the body is attached to a fixed :ref:`StaticBody3D<class_StaticBody3D>` without collision shapes.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Joint3D_property_node_b:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`NodePath<class_NodePath>` **node_b** = ``NodePath("")`` :ref:`🔗<class_Joint3D_property_node_b>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_node_b**\ (\ value\: :ref:`NodePath<class_NodePath>`\ )
|
|
- :ref:`NodePath<class_NodePath>` **get_node_b**\ (\ )
|
|
|
|
Path to the second node (B) attached to the joint. The node must inherit :ref:`PhysicsBody3D<class_PhysicsBody3D>`.
|
|
|
|
If left empty and :ref:`node_a<class_Joint3D_property_node_a>` is set, the body is attached to a fixed :ref:`StaticBody3D<class_StaticBody3D>` without collision shapes.
|
|
|
|
.. rst-class:: classref-item-separator
|
|
|
|
----
|
|
|
|
.. _class_Joint3D_property_solver_priority:
|
|
|
|
.. rst-class:: classref-property
|
|
|
|
:ref:`int<class_int>` **solver_priority** = ``1`` :ref:`🔗<class_Joint3D_property_solver_priority>`
|
|
|
|
.. rst-class:: classref-property-setget
|
|
|
|
- |void| **set_solver_priority**\ (\ value\: :ref:`int<class_int>`\ )
|
|
- :ref:`int<class_int>` **get_solver_priority**\ (\ )
|
|
|
|
用於定義哪個解算器在多個關節中被首先執行的優先順序。數值越低,優先順序越高。
|
|
|
|
.. rst-class:: classref-section-separator
|
|
|
|
----
|
|
|
|
.. rst-class:: classref-descriptions-group
|
|
|
|
方法說明
|
|
--------
|
|
|
|
.. _class_Joint3D_method_get_rid:
|
|
|
|
.. rst-class:: classref-method
|
|
|
|
:ref:`RID<class_RID>` **get_rid**\ (\ ) |const| :ref:`🔗<class_Joint3D_method_get_rid>`
|
|
|
|
Returns the joint's internal :ref:`RID<class_RID>` from the :ref:`PhysicsServer3D<class_PhysicsServer3D>`.
|
|
|
|
.. |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 (無回傳值。)`
|