:github_url: hide .. _class_DampedSpringJoint2D: DampedSpringJoint2D =================== **Hereda:** :ref:`Joint2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` A physics joint that connects two 2D physics bodies with a spring-like force. .. rst-class:: classref-introduction-group Descripción ---------------------- A physics joint that connects two 2D physics bodies with a spring-like force. This behaves like a spring that always wants to stretch to a given length. .. rst-class:: classref-reftable-group Propiedades ---------------------- .. table:: :widths: auto +---------------------------+--------------------------------------------------------------------+----------+ | :ref:`float` | :ref:`damping` | ``1.0`` | +---------------------------+--------------------------------------------------------------------+----------+ | :ref:`float` | :ref:`length` | ``50.0`` | +---------------------------+--------------------------------------------------------------------+----------+ | :ref:`float` | :ref:`rest_length` | ``0.0`` | +---------------------------+--------------------------------------------------------------------+----------+ | :ref:`float` | :ref:`stiffness` | ``20.0`` | +---------------------------+--------------------------------------------------------------------+----------+ .. rst-class:: classref-section-separator ---- .. rst-class:: classref-descriptions-group Descripciones de Propiedades -------------------------------------------------------- .. _class_DampedSpringJoint2D_property_damping: .. rst-class:: classref-property :ref:`float` **damping** = ``1.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_damping**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_damping**\ (\ ) The spring joint's damping ratio. A value between ``0`` and ``1``. When the two bodies move into different directions the system tries to align them to the spring axis again. A high :ref:`damping` value forces the attached bodies to align faster. .. rst-class:: classref-item-separator ---- .. _class_DampedSpringJoint2D_property_length: .. rst-class:: classref-property :ref:`float` **length** = ``50.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_length**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_length**\ (\ ) La longitud máxima de la articulación del resorte. Los dos cuerpos unidos no pueden estirarse más allá de este valor. .. rst-class:: classref-item-separator ---- .. _class_DampedSpringJoint2D_property_rest_length: .. rst-class:: classref-property :ref:`float` **rest_length** = ``0.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_rest_length**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_rest_length**\ (\ ) Cuando los cuerpos unidos a la articulación de resorte se mueven, se estiran o se aplastan. La articulación siempre trata de redimensionarse hacia esta longitud. .. rst-class:: classref-item-separator ---- .. _class_DampedSpringJoint2D_property_stiffness: .. rst-class:: classref-property :ref:`float` **stiffness** = ``20.0`` :ref:`🔗` .. rst-class:: classref-property-setget - |void| **set_stiffness**\ (\ value\: :ref:`float`\ ) - :ref:`float` **get_stiffness**\ (\ ) Cuanto más alto sea el valor, menos los cuerpos adheridos a la articulación la deformarán. La articulación aplica una fuerza opuesta a los cuerpos, producto de la rigidez multiplicada por la diferencia de tamaño de su longitud en reposo. .. |virtual| replace:: :abbr:`virtual (Normalmente, este método debería ser sobreescrito por el usuario para que tenga algún efecto.)` .. |required| replace:: :abbr:`required (This method is required to be overridden when extending its base class.)` .. |const| replace:: :abbr:`const (Este método no tiene efectos secundarios. No modifica ninguna de las variables miembro de la instancia.)` .. |vararg| replace:: :abbr:`vararg (Este método permite agregar cualquier número de argumentos después de los descritos aquí.)` .. |constructor| replace:: :abbr:`constructor (Este método se utiliza para construir un tipo.)` .. |static| replace:: :abbr:`static (Este método no necesita una instancia para ser llamado, por lo que puede llamarse directamente utilizando el nombre de la clase.)` .. |operator| replace:: :abbr:`operator (Este método describe un operador válido para usar con este tipo como operando izquierdo.)` .. |bitfield| replace:: :abbr:`BitField (Este valor es un entero compuesto como una máscara de bits de las siguientes banderas.)` .. |void| replace:: :abbr:`void (Sin valor de retorno.)`