Scripting API

Scripting API

SliderJoint2D

Struct in Abyss.Physics2D, from Abyss.Physics2D.

Two bodies held sliding along a line, as a drawer or a lift: the body this is on and SliderJoint2D.ConnectedBody, or the world where that is none, kept at the angle they were made at. Its motor drives it along; its limits stop it past two places.

public struct SliderJoint2D

Remarks

The line is at SliderJoint2D.Angle degrees in the world as the joint is made, through SliderJoint2D.Anchor, and turns with the connected body after. Its translation is how far this body has slid along it from where it was made, which SliderJoint2D.LowerTranslation and SliderJoint2D.UpperTranslation bound. 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 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.

Angle

public float Angle

Which way it slides, in degrees anticlockwise from the world's X as it is made.

UseMotor

public bool UseMotor

Whether the motor drives it.

MotorSpeed

public float MotorSpeed

How fast the motor drives it, in meters a second.

MaxMotorForce

public float MaxMotorForce

The most force the motor drives it with, in newtons.

UseLimits

public bool UseLimits

Whether it stops at SliderJoint2D.LowerTranslation and SliderJoint2D.UpperTranslation.

LowerTranslation

public float LowerTranslation

The least it slides, in meters from where it was made.

UpperTranslation

public float UpperTranslation

The most it slides, in meters from where it was made.

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.