Class DampedSpring
Definition
- Assembly:
- Tizen.NUI.Physics2D.dll
DampedSpring is a damped spring. The spring allows you to define the rest length, stiffness and damping.
public class DampedSpring : Constraint
- Inheritance
Constructors
View SourceDampedSpring(Body, Body, Vect, Vect, double, double, double)
Defined much like a slide joint.
Declaration
public DampedSpring(Body bodyA, Body bodyB, Vect anchorA, Vect anchorB, double restLength, double stiffness, double damping)
Parameters
Type | Name | Description |
---|---|---|
Body | bodyA | The first connected body. |
Body | bodyB | The second connected body. |
Vect | anchorA | Anchor point a, relative to body a. |
Vect | anchorB | Anchor point b, relative to body b. |
double | restLength | The distance the spring wants to be. |
double | stiffness | The spring constant (Young’s modulus). |
double | damping | How soft to make the damping of the spring. |
Properties
View SourceAnchorA
The location of the first anchor relative to the first body.
Declaration
public Vect AnchorA { get; set; }
Property Value
Type | Description |
---|---|
Vect |
AnchorB
The location of the second anchor relative to the second body.
Declaration
public Vect AnchorB { get; set; }
Property Value
Type | Description |
---|---|
Vect |
Damping
The damping of the spring.
Declaration
public double Damping { get; set; }
Property Value
Type | Description |
---|---|
double |
ForceFunction
Damped spring force custom function callback.
Declaration
public Func<DampedSpring, double, double> ForceFunction { get; set; }
Property Value
Type | Description |
---|---|
Func<, , ><DampedSpring, double, double> |
RestLength
The rest length of the spring.
Declaration
public double RestLength { get; set; }
Property Value
Type | Description |
---|---|
double |
Stiffness
The stiffness of the spring in force/distance.
Declaration
public double Stiffness { get; set; }
Property Value
Type | Description |
---|---|
double |
Methods
View SourceIsDampedSpring(Constraint)
Check if a constraint is a DampedSpring.
Declaration
public static bool IsDampedSpring(Constraint constraint)
Parameters
Type | Name | Description |
---|---|---|
Constraint | constraint |
Returns
Type | Description |
---|---|
bool |