:github_url: hide .. _class_Joint3D: Joint3D ======= **继承:** :ref:`Node3D` **<** :ref:`Node` **<** :ref:`Object` **派生:** :ref:`ConeTwistJoint3D`, :ref:`Generic6DOFJoint3D`, :ref:`HingeJoint3D`, :ref:`PinJoint3D`, :ref:`SliderJoint3D` 所有 3D 物理关节的抽象基类。 .. rst-class:: classref-introduction-group 描述 ---- 3D 物理中所有关节的抽象基类。3D 关节将两个物理体(\ :ref:`node_a` 和 :ref:`node_b`\ )绑定在一起并应用约束。如果仅定义一个物体,则将其附加到固定的 :ref:`StaticBody3D` 上,而没有碰撞形状。 .. rst-class:: classref-introduction-group 教程 ---- - `3D 货车镇演示 `__ .. rst-class:: classref-reftable-group 属性 ---- .. table:: :widths: auto +---------------------------------+------------------------------------------------------------------------------------------+------------------+ | :ref:`bool` | :ref:`exclude_nodes_from_collision` | ``true`` | +---------------------------------+------------------------------------------------------------------------------------------+------------------+ | :ref:`NodePath` | :ref:`node_a` | ``NodePath("")`` | +---------------------------------+------------------------------------------------------------------------------------------+------------------+ | :ref:`NodePath` | :ref:`node_b` | ``NodePath("")`` | +---------------------------------+------------------------------------------------------------------------------------------+------------------+ | :ref:`int` | :ref:`solver_priority` | ``1`` | +---------------------------------+------------------------------------------------------------------------------------------+------------------+ .. rst-class:: classref-reftable-group 方法 ---- .. table:: :widths: auto +-----------------------+------------------------------------------------------------+ | :ref:`RID` | :ref:`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` **exclude_nodes_from_collision** = ``true`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_exclude_nodes_from_collision**\ (\ value\: :ref:`bool`\ ) - :ref:`bool` **get_exclude_nodes_from_collision**\ (\ ) 如果为 ``true``\ ,则绑定在一起的两个物体不会相互碰撞。 .. rst-class:: classref-item-separator ---- .. _class_Joint3D_property_node_a: .. rst-class:: classref-property :ref:`NodePath` **node_a** = ``NodePath("")`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_node_a**\ (\ value\: :ref:`NodePath`\ ) - :ref:`NodePath` **get_node_a**\ (\ ) 连接到关节的第一个节点(A)的路径。该节点必须继承自 :ref:`PhysicsBody3D`\ 。 如果留空且设置了 :ref:`node_b`\ ,则该物体将连接到固定的 :ref:`StaticBody3D`\ ,且没有碰撞形状。 .. rst-class:: classref-item-separator ---- .. _class_Joint3D_property_node_b: .. rst-class:: classref-property :ref:`NodePath` **node_b** = ``NodePath("")`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_node_b**\ (\ value\: :ref:`NodePath`\ ) - :ref:`NodePath` **get_node_b**\ (\ ) 连接到关节的第二个节点(B)的路径。该节点必须继承自 :ref:`PhysicsBody3D`\ 。 如果留空且设置了 :ref:`node_a`\ ,则该物体将连接到固定的 :ref:`StaticBody3D`\ ,且没有碰撞形状。 .. rst-class:: classref-item-separator ---- .. _class_Joint3D_property_solver_priority: .. rst-class:: classref-property :ref:`int` **solver_priority** = ``1`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_solver_priority**\ (\ value\: :ref:`int`\ ) - :ref:`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` **get_rid**\ (\ ) |const| :ref:`🔗` 从 :ref:`PhysicsServer3D` 返回关节的内部 :ref:`RID`\ 。 .. |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 (无返回值。)`