Scripting API

Scripting API

SpringJoint2D

Struct in Abyss.Physics2D, from Abyss.Physics2D.

Two bodies pulled toward SpringJoint2D.Distance apart by a spring of SpringJoint2D.Frequency and SpringJoint2D.DampingRatio: the body this is on and SpringJoint2D.ConnectedBody, or a point in the world where that is none.

public struct SpringJoint2D

Remarks

A frequency of 0 is a spring as stiff as there is: a rod. Distance as DistanceJoint2D's; anchors and breaking as HingeJoint2D's.

Fields

ConnectedBody

public EntityRef ConnectedBody

The other body: an entity with a Rigidbody 2D, or under one; none for a point in the world.

EnableCollision

public bool EnableCollision

Whether the two bodies still meet each other.

AutoConfigureConnectedAnchor

public bool AutoConfigureConnectedAnchor

Whether the connected anchor is made where the anchor is as the joint is made.

Anchor

public Vector2 Anchor

Where it holds this body, in its entity's own units.

ConnectedAnchor

public Vector2 ConnectedAnchor

Where it holds the other, in its entity's own units, or in the world's where there is none.

AutoConfigureDistance

public bool AutoConfigureDistance

Whether the distance is how far apart the anchors are as the joint is made.

Distance

public float Distance

How far apart the spring pulls the anchors, in meters.

DampingRatio

public float DampingRatio

How the spring is slowed: 0 not at all, 1 at once.

Frequency

public float Frequency

How stiff the spring is, in times a second it bounces; 0 as stiff as there is.

BreakForce

public float BreakForce

The force it breaks at, in newtons; infinity never.

BreakTorque

public float BreakTorque

The torque it breaks at, in newton meters; infinity never.