-
-
Notifications
You must be signed in to change notification settings - Fork 22k
/
Copy pathDampedSpringJoint2D.xml
27 lines (27 loc) · 1.99 KB
/
DampedSpringJoint2D.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?xml version="1.0" encoding="UTF-8" ?>
<class name="DampedSpringJoint2D" inherits="Joint2D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
A physics joint that connects two 2D physics bodies with a spring-like force.
</brief_description>
<description>
A physics joint that connects two 2D physics bodies with a spring-like force. This resembles a spring that always wants to stretch to a given length.
</description>
<tutorials>
</tutorials>
<members>
<member name="damping" type="float" setter="set_damping" getter="get_damping" default="1.0">
The amount of damping applied to by the spring joint. It is measured in kg/s.
Higher linear damping results in a more gradual reduction in linear velocity, creating smoother, gentler behavior as the spring returns to its equilibrium rest length, preventing oscillations or rapid movement. Lower values make the spring more elastic or bouncy.
</member>
<member name="length" type="float" setter="set_length" getter="get_length" default="50.0">
The spring joint's maximum length. The two attached bodies cannot stretch it past this value.
</member>
<member name="rest_length" type="float" setter="set_rest_length" getter="get_rest_length" default="0.0">
When the bodies attached to the spring joint move they stretch or squash it. The joint always tries to resize towards this length, known as the equilibrium length or rest length.
</member>
<member name="stiffness" type="float" setter="set_stiffness" getter="get_stiffness" default="20.0">
The stiffness of the spring joint. It is measured in kg/s². The joint applies an opposing force to the bodies, the product of the stiffness multiplied by the size difference from its resting length.
Higher linear stiffness results in a more rigid spring, which more strongly resists being compressed or stretched away from its equilibrium rest length. Lower values make the spring more elastic or bouncy.
</member>
</members>
</class>