PinJoint2D
继承: Joint2D
< Node2D
< CanvasItem
< Node
< Object
A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely rotate.
描述
A physics joint that attaches two 2D physics bodies at a single point, allowing them to freely rotate. For example, a RigidBody2D
can be attached to a StaticBody2D
to create a pendulum or a seesaw.
属性
bool | angular_limit_enabled |
float | angular_limit_lower |
float | angular_limit_upper |
bool | motor_enabled |
float | motor_target_velocity |
float | softness |
属性说明
bool
angular_limit_enabled = false
If true
, the pin maximum and minimum rotation, defined by angular_limit_lower
and angular_limit_upper
are applied.
float
angular_limit_lower = 0.0
The minimum rotation. Only active if angular_limit_enabled
is true
.
float
angular_limit_upper = 0.0
The maximum rotation. Only active if angular_limit_enabled
is true
.
bool
motor_enabled = false
When activated, a motor turns the pin.
float
motor_target_velocity = 0.0
Target speed for the motor. In radians per second.
float
softness = 0.0
The higher this value, the more the bond to the pinned partner can flex.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。