:github_url: hide .. DO NOT EDIT THIS FILE!!! .. Generated automatically from Godot engine sources. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/HingeJoint.xml. .. _class_HingeJoint: HingeJoint ========== **Inherits:** :ref:`Joint` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` A hinge between two 3D PhysicsBodies. .. rst-class:: classref-introduction-group Description ----------- A HingeJoint normally uses the Z axis of body A as the hinge axis, another axis can be specified when adding it manually though. See also :ref:`Generic6DOFJoint`. .. rst-class:: classref-reftable-group Properties ---------- .. table:: :widths: auto +---------------------------+-------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`angular_limit/bias` | ``0.3`` | +---------------------------+-------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`angular_limit/enable` | ``false`` | +---------------------------+-------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`angular_limit/lower` | ``-90.0`` | +---------------------------+-------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`angular_limit/relaxation` | ``1.0`` | +---------------------------+-------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`angular_limit/softness` | ``0.9`` | +---------------------------+-------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`angular_limit/upper` | ``90.0`` | +---------------------------+-------------------------------------------------------------------------------------+-----------+ | :ref:`bool` | :ref:`motor/enable` | ``false`` | +---------------------------+-------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`motor/max_impulse` | ``1.0`` | +---------------------------+-------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`motor/target_velocity` | ``1.0`` | +---------------------------+-------------------------------------------------------------------------------------+-----------+ | :ref:`float` | :ref:`params/bias` | ``0.3`` | +---------------------------+-------------------------------------------------------------------------------------+-----------+ .. rst-class:: classref-reftable-group Methods ------- .. table:: :widths: auto +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`bool` | :ref:`get_flag` **(** :ref:`Flag` flag **)** |const| | +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_param` **(** :ref:`Param` param **)** |const| | +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_flag` **(** :ref:`Flag` flag, :ref:`bool` enabled **)** | +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_param` **(** :ref:`Param` param, :ref:`float` value **)** | +---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Enumerations ------------ .. _enum_HingeJoint_Param: .. rst-class:: classref-enumeration enum **Param**: .. _class_HingeJoint_constant_PARAM_BIAS: .. rst-class:: classref-enumeration-constant :ref:`Param` **PARAM_BIAS** = ``0`` The speed with which the two bodies get pulled together when they move in different directions. .. _class_HingeJoint_constant_PARAM_LIMIT_UPPER: .. rst-class:: classref-enumeration-constant :ref:`Param` **PARAM_LIMIT_UPPER** = ``1`` The maximum rotation. Only active if :ref:`angular_limit/enable` is ``true``. .. _class_HingeJoint_constant_PARAM_LIMIT_LOWER: .. rst-class:: classref-enumeration-constant :ref:`Param` **PARAM_LIMIT_LOWER** = ``2`` The minimum rotation. Only active if :ref:`angular_limit/enable` is ``true``. .. _class_HingeJoint_constant_PARAM_LIMIT_BIAS: .. rst-class:: classref-enumeration-constant :ref:`Param` **PARAM_LIMIT_BIAS** = ``3`` The speed with which the rotation across the axis perpendicular to the hinge gets corrected. .. _class_HingeJoint_constant_PARAM_LIMIT_SOFTNESS: .. rst-class:: classref-enumeration-constant :ref:`Param` **PARAM_LIMIT_SOFTNESS** = ``4`` .. _class_HingeJoint_constant_PARAM_LIMIT_RELAXATION: .. rst-class:: classref-enumeration-constant :ref:`Param` **PARAM_LIMIT_RELAXATION** = ``5`` The lower this value, the more the rotation gets slowed down. .. _class_HingeJoint_constant_PARAM_MOTOR_TARGET_VELOCITY: .. rst-class:: classref-enumeration-constant :ref:`Param` **PARAM_MOTOR_TARGET_VELOCITY** = ``6`` Target speed for the motor. .. _class_HingeJoint_constant_PARAM_MOTOR_MAX_IMPULSE: .. rst-class:: classref-enumeration-constant :ref:`Param` **PARAM_MOTOR_MAX_IMPULSE** = ``7`` Maximum acceleration for the motor. .. _class_HingeJoint_constant_PARAM_MAX: .. rst-class:: classref-enumeration-constant :ref:`Param` **PARAM_MAX** = ``8`` Represents the size of the :ref:`Param` enum. .. rst-class:: classref-item-separator ---- .. _enum_HingeJoint_Flag: .. rst-class:: classref-enumeration enum **Flag**: .. _class_HingeJoint_constant_FLAG_USE_LIMIT: .. rst-class:: classref-enumeration-constant :ref:`Flag` **FLAG_USE_LIMIT** = ``0`` If ``true``, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower` and :ref:`angular_limit/upper` has effects. .. _class_HingeJoint_constant_FLAG_ENABLE_MOTOR: .. rst-class:: classref-enumeration-constant :ref:`Flag` **FLAG_ENABLE_MOTOR** = ``1`` When activated, a motor turns the hinge. .. _class_HingeJoint_constant_FLAG_MAX: .. rst-class:: classref-enumeration-constant :ref:`Flag` **FLAG_MAX** = ``2`` Represents the size of the :ref:`Flag` enum. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Property Descriptions --------------------- .. _class_HingeJoint_property_angular_limit/bias: .. rst-class:: classref-property :ref:`float` **angular_limit/bias** = ``0.3`` .. rst-class:: classref-property-setget - void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** - :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| The speed with which the rotation across the axis perpendicular to the hinge gets corrected. .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_property_angular_limit/enable: .. rst-class:: classref-property :ref:`bool` **angular_limit/enable** = ``false`` .. rst-class:: classref-property-setget - void **set_flag** **(** :ref:`Flag` flag, :ref:`bool` enabled **)** - :ref:`bool` **get_flag** **(** :ref:`Flag` flag **)** |const| If ``true``, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower` and :ref:`angular_limit/upper` has effects. .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_property_angular_limit/lower: .. rst-class:: classref-property :ref:`float` **angular_limit/lower** = ``-90.0`` The minimum rotation. Only active if :ref:`angular_limit/enable` is ``true``. .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_property_angular_limit/relaxation: .. rst-class:: classref-property :ref:`float` **angular_limit/relaxation** = ``1.0`` .. rst-class:: classref-property-setget - void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** - :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| The lower this value, the more the rotation gets slowed down. .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_property_angular_limit/softness: .. rst-class:: classref-property :ref:`float` **angular_limit/softness** = ``0.9`` .. rst-class:: classref-property-setget - void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** - :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| .. container:: contribute There is currently no description for this property. Please help us by :ref:`contributing one `! .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_property_angular_limit/upper: .. rst-class:: classref-property :ref:`float` **angular_limit/upper** = ``90.0`` The maximum rotation. Only active if :ref:`angular_limit/enable` is ``true``. .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_property_motor/enable: .. rst-class:: classref-property :ref:`bool` **motor/enable** = ``false`` .. rst-class:: classref-property-setget - void **set_flag** **(** :ref:`Flag` flag, :ref:`bool` enabled **)** - :ref:`bool` **get_flag** **(** :ref:`Flag` flag **)** |const| When activated, a motor turns the hinge. .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_property_motor/max_impulse: .. rst-class:: classref-property :ref:`float` **motor/max_impulse** = ``1.0`` .. rst-class:: classref-property-setget - void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** - :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| Maximum acceleration for the motor. .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_property_motor/target_velocity: .. rst-class:: classref-property :ref:`float` **motor/target_velocity** = ``1.0`` .. rst-class:: classref-property-setget - void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** - :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| Target speed for the motor. .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_property_params/bias: .. rst-class:: classref-property :ref:`float` **params/bias** = ``0.3`` .. rst-class:: classref-property-setget - void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** - :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| The speed with which the two bodies get pulled together when they move in different directions. .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Method Descriptions ------------------- .. _class_HingeJoint_method_get_flag: .. rst-class:: classref-method :ref:`bool` **get_flag** **(** :ref:`Flag` flag **)** |const| Returns the value of the specified flag. .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_method_get_param: .. rst-class:: classref-method :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| Returns the value of the specified parameter. .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_method_set_flag: .. rst-class:: classref-method void **set_flag** **(** :ref:`Flag` flag, :ref:`bool` enabled **)** If ``true``, enables the specified flag. .. rst-class:: classref-item-separator ---- .. _class_HingeJoint_method_set_param: .. rst-class:: classref-method void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** Sets the value of the specified parameter. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`