Joint2D

Inherits: Node2D < CanvasItem < Node < Object

Inherited By: DampedSpringJoint2D, GrooveJoint2D, PinJoint2D

2D 物理中所有关节约束的基础节点。

描述

2D 物理中所有关节约束的基础节点。关节采用 2 个实体并应用自定义约束。

属性

float

bias

0.0

bool

disable_collision

true

NodePath

node_a

NodePath(“”)

NodePath

node_b

NodePath(“”)

属性说明

Default

0.0

Setter

set_bias(value)

Getter

get_bias()

node_anode_b 向不同方向移动时,bias 控制关节将它们拉回原始位置的所需时间。 bias 越低,两个物体在关节上受到的拉力越大。


  • bool disable_collision

Default

true

Setter

set_exclude_nodes_from_collision(value)

Getter

get_exclude_nodes_from_collision()

如果为truenode_anode_b不能碰撞。


Default

NodePath(“”)

Setter

set_node_a(value)

Getter

get_node_a()

连接到关节的第一个实体。必须继承自 PhysicsBody2D


Default

NodePath(“”)

Setter

set_node_b(value)

Getter

get_node_b()

连接到关节的第二实体。必须继承自PhysicsBody2D