class_dampedspringjoint2d.rst 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the doc/base/classes.xml source instead.
  3. .. _class_DampedSpringJoint2D:
  4. DampedSpringJoint2D
  5. ===================
  6. **Inherits:** :ref:`Joint2D<class_joint2d>` **<** :ref:`Node2D<class_node2d>` **<** :ref:`CanvasItem<class_canvasitem>` **<** :ref:`Node<class_node>` **<** :ref:`Object<class_object>`
  7. **Category:** Core
  8. Brief Description
  9. -----------------
  10. Damped spring constraint for 2D physics.
  11. Member Functions
  12. ----------------
  13. +----------------------------+-----------------------------------------------------------------------------------------------------------------------+
  14. | :ref:`float<class_float>` | :ref:`get_damping<class_DampedSpringJoint2D_get_damping>` **(** **)** const |
  15. +----------------------------+-----------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`float<class_float>` | :ref:`get_length<class_DampedSpringJoint2D_get_length>` **(** **)** const |
  17. +----------------------------+-----------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`float<class_float>` | :ref:`get_rest_length<class_DampedSpringJoint2D_get_rest_length>` **(** **)** const |
  19. +----------------------------+-----------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`get_stiffness<class_DampedSpringJoint2D_get_stiffness>` **(** **)** const |
  21. +----------------------------+-----------------------------------------------------------------------------------------------------------------------+
  22. | void | :ref:`set_damping<class_DampedSpringJoint2D_set_damping>` **(** :ref:`float<class_float>` damping **)** |
  23. +----------------------------+-----------------------------------------------------------------------------------------------------------------------+
  24. | void | :ref:`set_length<class_DampedSpringJoint2D_set_length>` **(** :ref:`float<class_float>` length **)** |
  25. +----------------------------+-----------------------------------------------------------------------------------------------------------------------+
  26. | void | :ref:`set_rest_length<class_DampedSpringJoint2D_set_rest_length>` **(** :ref:`float<class_float>` rest_length **)** |
  27. +----------------------------+-----------------------------------------------------------------------------------------------------------------------+
  28. | void | :ref:`set_stiffness<class_DampedSpringJoint2D_set_stiffness>` **(** :ref:`float<class_float>` stiffness **)** |
  29. +----------------------------+-----------------------------------------------------------------------------------------------------------------------+
  30. Member Variables
  31. ----------------
  32. - :ref:`float<class_float>` **damping**
  33. - :ref:`float<class_float>` **length**
  34. - :ref:`float<class_float>` **rest_length**
  35. - :ref:`float<class_float>` **stiffness**
  36. Description
  37. -----------
  38. Damped spring constraint for 2D physics. This resembles a spring joint that always wants to go back to a given length.
  39. Member Function Description
  40. ---------------------------
  41. .. _class_DampedSpringJoint2D_get_damping:
  42. - :ref:`float<class_float>` **get_damping** **(** **)** const
  43. 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).
  44. .. _class_DampedSpringJoint2D_get_length:
  45. - :ref:`float<class_float>` **get_length** **(** **)** const
  46. Return the maximum length of the spring joint.
  47. .. _class_DampedSpringJoint2D_get_rest_length:
  48. - :ref:`float<class_float>` **get_rest_length** **(** **)** const
  49. Return the resting length of the spring joint. The joint will always try to go to back this length when pulled apart.
  50. .. _class_DampedSpringJoint2D_get_stiffness:
  51. - :ref:`float<class_float>` **get_stiffness** **(** **)** const
  52. Return the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.
  53. .. _class_DampedSpringJoint2D_set_damping:
  54. - void **set_damping** **(** :ref:`float<class_float>` damping **)**
  55. 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).
  56. .. _class_DampedSpringJoint2D_set_length:
  57. - void **set_length** **(** :ref:`float<class_float>` length **)**
  58. Set the maximum length of the spring joint.
  59. .. _class_DampedSpringJoint2D_set_rest_length:
  60. - void **set_rest_length** **(** :ref:`float<class_float>` rest_length **)**
  61. Set the resting length of the spring joint. The joint will always try to go to back this length when pulled apart.
  62. .. _class_DampedSpringJoint2D_set_stiffness:
  63. - void **set_stiffness** **(** :ref:`float<class_float>` stiffness **)**
  64. Set the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length.