.. Generated automatically by doc/tools/makerst.py in Godot's source tree. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead. .. _class_DampedSpringJoint2D: DampedSpringJoint2D =================== **Inherits:** :ref:`Joint2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` **Category:** Core Brief Description ----------------- Damped spring constraint for 2D physics. Member Functions ---------------- +----------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_damping` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_length` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_rest_length` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------------+ | :ref:`float` | :ref:`get_stiffness` **(** **)** const | +----------------------------+-----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_damping` **(** :ref:`float` damping **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_length` **(** :ref:`float` length **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_rest_length` **(** :ref:`float` rest_length **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------------+ | void | :ref:`set_stiffness` **(** :ref:`float` stiffness **)** | +----------------------------+-----------------------------------------------------------------------------------------------------------------------+ Member Variables ---------------- - :ref:`float` **damping** - :ref:`float` **length** - :ref:`float` **rest_length** - :ref:`float` **stiffness** Description ----------- Damped spring constraint for 2D physics. This resembles a spring joint that always wants to go back to a given length. Member Function Description --------------------------- .. _class_DampedSpringJoint2D_get_damping: - :ref:`float` **get_damping** **(** **)** const Return the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping). .. _class_DampedSpringJoint2D_get_length: - :ref:`float` **get_length** **(** **)** const Return the maximum length of the spring joint. .. _class_DampedSpringJoint2D_get_rest_length: - :ref:`float` **get_rest_length** **(** **)** const Return the resting length of the spring joint. The joint will always try to go to back this length when pulled apart. .. _class_DampedSpringJoint2D_get_stiffness: - :ref:`float` **get_stiffness** **(** **)** const Return the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length. .. _class_DampedSpringJoint2D_set_damping: - void **set_damping** **(** :ref:`float` damping **)** Set the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping). .. _class_DampedSpringJoint2D_set_length: - void **set_length** **(** :ref:`float` length **)** Set the maximum length of the spring joint. .. _class_DampedSpringJoint2D_set_rest_length: - void **set_rest_length** **(** :ref:`float` rest_length **)** Set the resting length of the spring joint. The joint will always try to go to back this length when pulled apart. .. _class_DampedSpringJoint2D_set_stiffness: - void **set_stiffness** **(** :ref:`float` stiffness **)** Set the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.