DampedSpringJoint2D

Hereda: Joint2D < Node2D < CanvasItem < Node < Object

A physics joint that connects two 2D physics bodies with a spring-like force.

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.

Propiedades

float

damping

1.0

float

length

50.0

float

rest_length

0.0

float

stiffness

20.0


Descripciones de Propiedades

float damping = 1.0 🔗

  • void set_damping(value: float)

  • 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 damping value forces the attached bodies to align faster.


float length = 50.0 🔗

  • void set_length(value: float)

  • 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.


float rest_length = 0.0 🔗

  • void set_rest_length(value: float)

  • 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.


float stiffness = 20.0 🔗

  • void set_stiffness(value: float)

  • 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.