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 SliderJoint2DRemarks
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 ConnectedBodyThe other body: an entity with a Rigidbody 2D, or under one; none for the world.
EnableCollision
public bool EnableCollisionWhether the two bodies still meet each other.
AutoConfigureConnectedAnchor
public bool AutoConfigureConnectedAnchorWhether the connected anchor is made where the anchor is as the joint is made.
Anchor
public Vector2 AnchorWhere it holds this body, in its entity's own units.
ConnectedAnchor
public Vector2 ConnectedAnchorWhere it holds the other, in its entity's own units, or in the world's where there is none.
Angle
public float AngleWhich way it slides, in degrees anticlockwise from the world's X as it is made.
UseMotor
public bool UseMotorWhether the motor drives it.
MotorSpeed
public float MotorSpeedHow fast the motor drives it, in meters a second.
MaxMotorForce
public float MaxMotorForceThe most force the motor drives it with, in newtons.
UseLimits
public bool UseLimitsWhether it stops at SliderJoint2D.LowerTranslation and SliderJoint2D.UpperTranslation.
LowerTranslation
public float LowerTranslationThe least it slides, in meters from where it was made.
UpperTranslation
public float UpperTranslationThe most it slides, in meters from where it was made.
BreakForce
public float BreakForceThe force it breaks at, in newtons; infinity never.
BreakTorque
public float BreakTorqueThe torque it breaks at, in newton meters; infinity never.
