github_url: | hide |
---|
Inherits: :ref:`Joint<class_Joint>` < :ref:`Spatial<class_Spatial>` < :ref:`Node<class_Node>` < :ref:`Object<class_Object>`
A hinge between two 3D bodies.
A HingeJoint normally uses the Z axis of body A as the hinge axis, another axis can be specified when adding it manually though.
enum Param:
- PARAM_BIAS = 0 --- The speed with which the two bodies get pulled together when they move in different directions.
- PARAM_LIMIT_UPPER = 1 --- The maximum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is
true
. - PARAM_LIMIT_LOWER = 2 --- The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is
true
. - PARAM_LIMIT_BIAS = 3 --- The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
- PARAM_LIMIT_SOFTNESS = 4
- PARAM_LIMIT_RELAXATION = 5 --- The lower this value, the more the rotation gets slowed down.
- PARAM_MOTOR_TARGET_VELOCITY = 6 --- Target speed for the motor.
- PARAM_MOTOR_MAX_IMPULSE = 7 --- Maximum acceleration for the motor.
- PARAM_MAX = 8 --- Represents the size of the :ref:`Param<enum_HingeJoint_Param>` enum.
enum Flag:
- FLAG_USE_LIMIT = 0 --- If
true
, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower<class_HingeJoint_property_angular_limit/lower>` and :ref:`angular_limit/upper<class_HingeJoint_property_angular_limit/upper>` has effects. - FLAG_ENABLE_MOTOR = 1 --- When activated, a motor turns the hinge.
- FLAG_MAX = 2 --- Represents the size of the :ref:`Flag<enum_HingeJoint_Flag>` enum.
- :ref:`float<class_float>` angular_limit/bias
Default | 0.3 |
Setter | set_param(value) |
Getter | get_param() |
The speed with which the rotation across the axis perpendicular to the hinge gets corrected.
- :ref:`bool<class_bool>` angular_limit/enable
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
If true
, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower<class_HingeJoint_property_angular_limit/lower>` and :ref:`angular_limit/upper<class_HingeJoint_property_angular_limit/upper>` has effects.
- :ref:`float<class_float>` angular_limit/lower
Default | -90.0 |
The minimum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is true
.
- :ref:`float<class_float>` angular_limit/relaxation
Default | 1.0 |
Setter | set_param(value) |
Getter | get_param() |
The lower this value, the more the rotation gets slowed down.
- :ref:`float<class_float>` angular_limit/softness
Default | 0.9 |
Setter | set_param(value) |
Getter | get_param() |
- :ref:`float<class_float>` angular_limit/upper
Default | 90.0 |
The maximum rotation. Only active if :ref:`angular_limit/enable<class_HingeJoint_property_angular_limit/enable>` is true
.
- :ref:`bool<class_bool>` motor/enable
Default | false |
Setter | set_flag(value) |
Getter | get_flag() |
When activated, a motor turns the hinge.
- :ref:`float<class_float>` motor/max_impulse
Default | 1.0 |
Setter | set_param(value) |
Getter | get_param() |
Maximum acceleration for the motor.
- :ref:`float<class_float>` motor/target_velocity
Default | 1.0 |
Setter | set_param(value) |
Getter | get_param() |
Target speed for the motor.
- :ref:`float<class_float>` params/bias
Default | 0.3 |
Setter | set_param(value) |
Getter | get_param() |
The speed with which the two bodies get pulled together when they move in different directions.
- :ref:`bool<class_bool>` get_flag ( :ref:`Flag<enum_HingeJoint_Flag>` flag ) const
Returns the value of the specified flag.
- :ref:`float<class_float>` get_param ( :ref:`Param<enum_HingeJoint_Param>` param ) const
Returns the value of the specified parameter.
- void set_flag ( :ref:`Flag<enum_HingeJoint_Flag>` flag, :ref:`bool<class_bool>` enabled )
If true
, enables the specified flag.
- void set_param ( :ref:`Param<enum_HingeJoint_Param>` param, :ref:`float<class_float>` value )
Sets the value of the specified parameter.