Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Joint2D
继承: Node2D < CanvasItem < Node < Object
派生: DampedSpringJoint2D, GrooveJoint2D, PinJoint2D
所有 2D 物理关节的抽象基类。
描述
属性
|
||
|
||
|
||
|
方法
get_rid() const |
属性说明
当 node_a 和 node_b 向不同方向移动时,bias 控制关节将它们拉回到原始位置的速度。bias 越低,两个实体对该关节的拉力就越大。
当被设置为 0
时,使用来自 ProjectSettings.physics/2d/solver/default_constraint_bias 的默认值。
bool disable_collision = true
🔗
如果为 true
,则绑定在一起的两个物体不会相互碰撞。
NodePath node_a = NodePath("")
🔗
连接到关节的第一个物体(A)的路径。该节点必须继承自 PhysicsBody2D。
NodePath node_b = NodePath("")
🔗
连接到关节的第二个物体(B)的路径。该节点必须继承自 PhysicsBody2D。
方法说明
从 PhysicsServer2D 返回关节的内部 RID。