Class reference

HingeJoint3D

Inherits Joint3D

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

Description

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.

Properties

float angular_limit/bias = 0.3

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

float angular_limit/relaxation = 1.0

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

float angular_limit/softness = 0.9

Deprecated.

This property is never set by the engine and is kept for compatibility purposes.

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.

Methods

bool get_flag(int flag) const

Returns the value of the specified flag.

float get_param(int param) const

Returns the value of the specified parameter.

void set_flag(int flag, bool enabled)

If true, enables the specified flag.

void set_param(int param, float value)

Sets the value of the specified parameter.

Constants

PARAM_BIAS = 0

Enum: Param

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

PARAM_LIMIT_BIAS = 3

Enum: Param

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

PARAM_LIMIT_SOFTNESS = 4

Enum: Param

Deprecated.

This property is never used by the engine and is kept for compatibility purpose.

PARAM_LIMIT_RELAXATION = 5

Enum: Param

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

PARAM_MOTOR_TARGET_VELOCITY = 6

Enum: Param

Target speed for the motor.

PARAM_MOTOR_MAX_IMPULSE = 7

Enum: Param

Maximum acceleration for the motor.

PARAM_MAX = 8

Enum: Param

Represents the size of the Param enum.

FLAG_ENABLE_MOTOR = 1

Enum: Flag

When activated, a motor turns the hinge.

FLAG_MAX = 2

Enum: Flag

Represents the size of the Flag enum.

Source revision 5592dc3a7a61
Connection interrupted. Reload×

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.