reckfellENGINE

DampedSpringJoint2D

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

On this page
class DampedSpringJoint2DReckfellSharpInherits Joint2D

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

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.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

DampedSpringJoint2DConstructor
# DampedSpringJoint2D
C#
public DampedSpringJoint2D();

Properties4

DampingProperty
# Damping
C#
public float Damping { get; set; }

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

LengthProperty
# Length
C#
public float Length { get; set; }

The spring joint's maximum length. The two attached bodies cannot stretch it past this value.

RestLengthProperty
# RestLength
C#
public float RestLength { get; set; }

When the bodies attached to the spring joint move they stretch or squash it. The joint always tries to resize towards this length.

StiffnessProperty
# Stiffness
C#
public float Stiffness { get; set; }

The higher the value, the less the bodies attached to the joint will deform it. The joint applies an opposing force to the bodies, the product of the stiffness multiplied by the size difference from its resting length.

Methods8

GetDampingfloat
# GetDamping
C#
public float GetDamping();
Returns float
GetLengthfloat
# GetLength
C#
public float GetLength();
Returns float
GetRestLengthfloat
# GetRestLength
C#
public float GetRestLength();
Returns float
GetStiffnessfloat
# GetStiffness
C#
public float GetStiffness();
Returns float
SetDampingvoid
# SetDamping
C#
public void SetDamping(float damping);
Parameters
NameTypeDefault
dampingfloat—
SetLengthvoid
# SetLength
C#
public void SetLength(float length);
Parameters
NameTypeDefault
lengthfloat—
SetRestLengthvoid
# SetRestLength
C#
public void SetRestLength(float restLength);
Parameters
NameTypeDefault
restLengthfloat—
SetStiffnessvoid
# SetStiffness
C#
public void SetStiffness(float stiffness);
Parameters
NameTypeDefault
stiffnessfloat—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.