Inheritance #

HingeJoint3D
Table of contents

HingeJoint3D #

is_instantiable, Node3D, Node, core, not_builtin_classes

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.

Members #

var angular_limit/bias: float = 0.3#

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

var angular_limit/enable: bool = false#

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

var angular_limit/lower: float = -1.5708#

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

var angular_limit/relaxation: float = 1.0#

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

var angular_limit/softness: float = 0.9#

var angular_limit/upper: float = 1.5708#

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

var motor/enable: bool = false#

When activated, a motor turns the hinge.

var motor/max_impulse: float = 1.0#

Maximum acceleration for the motor.

var motor/target_velocity: float = 1.0#

Target speed for the motor.

var params/bias: float = 0.3#

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

Methods #

const func get_flag(flag: int enumHingeJoint3D.Flag) -> bool#

Returns the value of the specified flag.

const func get_param(param: int enumHingeJoint3D.Param) -> float#

Returns the value of the specified parameter.

func set_flag(enabled: bool) -> void#

If true, enables the specified flag.

func set_param(value: float) -> void#

Sets the value of the specified parameter.

Annotations #

Constants #

const PARAM_BIAS = 0 enum Param#

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

const PARAM_LIMIT_UPPER = 1 enum Param#

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

const PARAM_LIMIT_LOWER = 2 enum Param#

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

const PARAM_LIMIT_BIAS = 3 enum Param#

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

const PARAM_LIMIT_SOFTNESS = 4 enum Param
Deprecated
#

const PARAM_LIMIT_RELAXATION = 5 enum Param#

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

const PARAM_MOTOR_TARGET_VELOCITY = 6 enum Param#

Target speed for the motor.

const PARAM_MOTOR_MAX_IMPULSE = 7 enum Param#

Maximum acceleration for the motor.

const PARAM_MAX = 8 enum Param#

Represents the size of the Param enum.

const FLAG_USE_LIMIT = 0 enum Flag#

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

const FLAG_ENABLE_MOTOR = 1 enum Flag#

When activated, a motor turns the hinge.

const FLAG_MAX = 2 enum Flag#

Represents the size of the Flag enum.

Constructors #

Enums #

Param#

enum Param { PARAM_BIAS = 0, PARAM_LIMIT_UPPER = 1, PARAM_LIMIT_LOWER = 2, PARAM_LIMIT_BIAS = 3, PARAM_LIMIT_SOFTNESS = 4, PARAM_LIMIT_RELAXATION = 5, PARAM_MOTOR_TARGET_VELOCITY = 6, PARAM_MOTOR_MAX_IMPULSE = 7, PARAM_MAX = 8, }

Flag#

enum Flag { FLAG_USE_LIMIT = 0, FLAG_ENABLE_MOTOR = 1, FLAG_MAX = 2, }

Operators #

Signals #

Theme Items #

Tutorials #