HingeJoint3D

继承: Joint3D < Node3D < Node < Object

A physics joint that restricts the rotation of a 3D physics body around an axis relative to another physics body.

描述

A physics joint that restricts the rotation of a 3D physics body around an axis relative to another physics body. For example, Body A can be a StaticBody3D representing a door hinge that a RigidBody3D rotates around.

属性

方法

boolget_flag ( flag: Flag ) const1
floatget_param ( param: Param ) const1
voidset_flag ( flag: Flag, enabled: bool )
voidset_param ( param: Param, value: float )

枚举

enum Param:

Param PARAM_BIAS = 0

The speed with which the two bodies get pulled together when they move in different directions.

Param PARAM_LIMIT_UPPER = 1

The maximum rotation. Only active if angular_limit/enable is true.

Param PARAM_LIMIT_LOWER = 2

The minimum rotation. Only active if angular_limit/enable is true.

Param PARAM_LIMIT_BIAS = 3

The speed with which the rotation across the axis perpendicular to the hinge gets corrected.

Param PARAM_LIMIT_SOFTNESS = 4

已弃用: This property is never used by the engine and is kept for compatibility purpose.

Param PARAM_LIMIT_RELAXATION = 5

The lower this value, the more the rotation gets slowed down.

Param PARAM_MOTOR_TARGET_VELOCITY = 6

Target speed for the motor.

Param PARAM_MOTOR_MAX_IMPULSE = 7

Maximum acceleration for the motor.

Param PARAM_MAX = 8

Represents the size of the Param enum.


enum Flag:

Flag FLAG_USE_LIMIT = 0

If true, the hinges maximum and minimum rotation, defined by angular_limit/lower and angular_limit/upper has effects.

Flag FLAG_ENABLE_MOTOR = 1

When activated, a motor turns the hinge.

Flag FLAG_MAX = 2

Represents the size of the Flag enum.


属性说明

float angular_limit/bias = 0.3

The speed with which the rotation across the axis perpendicular to the hinge gets corrected.


bool angular_limit/enable = false

If true, the hinges maximum and minimum rotation, defined by angular_limit/lower and angular_limit/upper has effects.


float angular_limit/lower = -1.5708

The minimum rotation. Only active if angular_limit/enable is true.


float angular_limit/relaxation = 1.0

The lower this value, the more the rotation gets slowed down.


float angular_limit/softness = 0.9

已弃用: This property is never set by the engine and is kept for compatibility purposes.


float angular_limit/upper = 1.5708

The maximum rotation. Only active if angular_limit/enable is true.


bool motor/enable = false

When activated, a motor turns the hinge.


float motor/max_impulse = 1.0

Maximum acceleration for the motor.


float motor/target_velocity = 1.0

Target speed for the motor.


float params/bias = 0.3

The speed with which the two bodies get pulled together when they move in different directions.


方法说明

bool get_flag ( flag: Flag ) const1

Returns the value of the specified flag.


float get_param ( param: Param ) const1

Returns the value of the specified parameter.


void set_flag ( flag: Flag, enabled: bool )

If true, enables the specified flag.


void set_param ( param: Param, value: float )

Sets the value of the specified parameter.

2

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

1

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

3

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

4

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

5

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

6

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

7

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

8

无返回值。