Up to date
This page is up to date for Godot 4.2
.
If you still find outdated information, please open an issue.
PinJoint2D¶
继承: Joint2D < Node2D < CanvasItem < Node < Object
将两个 2D 物理体通过单点进行连接的物理关节,能够让它们自由旋转。
描述¶
将两个 2D 物理体通过单点进行连接的物理关节,能够让它们自由旋转。例如可以将 RigidBody2D 连接到 StaticBody2D 上,从而创建钟摆或跷跷板。
属性¶
|
||
|
||
|
||
|
||
|
||
|
属性说明¶
bool angular_limit_enabled = false
如果为 true
,则应用由 angular_limit_lower 和 angular_limit_upper 定义的销的最大和最小旋转。
float angular_limit_lower = 0.0
最小的旋转量。只有在 angular_limit_enabled 为 true
时才有效。
float angular_limit_upper = 0.0
最大的旋转量。只有在 angular_limit_enabled 为 true
时才有效。
bool motor_enabled = false
激活后,马达会转动该销。
float motor_target_velocity = 0.0
马达的目标速度。单位为弧度每秒。
float softness = 0.0
这个值越高,与被牵制的两个物体之间的的联系就越灵活。