GrooveJoint2D

继承: Joint2D < Node2D < CanvasItem < Node < Object

A physics joint that restricts the movement of two 2D physics bodies to a fixed axis.

描述

A physics joint that restricts the movement of two 2D physics bodies to a fixed axis. For example, a StaticBody2D representing a piston base can be attached to a RigidBody2D representing the piston head, moving up and down.

属性


属性说明

float initial_offset = 25.0

  • void set_initial_offset ( value: float )
  • float get_initial_offset ( )

The body B's initial anchor position defined by the joint's origin and a local offset initial_offset along the joint's Y axis (along the groove).


float length = 50.0

  • void set_length ( value: float )
  • float get_length ( )

The groove's length. The groove is from the joint's origin towards length along the joint's local Y axis.

1

本方法通常需要用户覆盖才能生效。

2

本方法无副作用,不会修改该实例的任何成员变量。

3

本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。

4

本方法用于构造某个类型。

5

调用本方法无需实例,可直接使用类名进行调用。

6

本方法描述的是使用本类型作为左操作数的有效运算符。

7

这个值是由下列位标志构成位掩码的整数。

8

无返回值。