class_dampedspringjoint2d.rst 5.3 KB

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