Scripting API
Scripting API
HingeJoint2D
Struct in Abyss.Physics2D, from Abyss.Physics2D.
Two bodies held turning about one point, as a door on its hinge or a wheel on its axle: the body this is on — the nearest Rigidbody 2D at or above its entity — and HingeJoint2D.ConnectedBody, or a point in the world where that is none. Its motor turns it; its limits stop it turning past two angles.
public struct HingeJoint2DRemarks
Where the two are held is HingeJoint2D.Anchor on this body, in its entity's own units, and HingeJoint2D.ConnectedAnchor on the other, in that entity's, or in the world's where there is none; with HingeJoint2D.AutoConfigureConnectedAnchor the joint is made with the connected anchor where the anchor is, and says where that was.
Its angle is this body's turn from the connected one's, from the angle they were at as it was made; HingeJoint2D.LowerAngle and HingeJoint2D.UpperAngle are from there, in degrees, each within 178 either way, as Box2D measures a hinge's angle no further than a half turn. It breaks — taken off its entity, and said in Physics2D.JointsBroken — when it holds harder than HingeJoint2D.BreakForce or HingeJoint2D.BreakTorque.
Fields
ConnectedBody
public EntityRef ConnectedBodyThe other body: an entity with a Rigidbody 2D, or under one; none for a point in 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.
UseMotor
public bool UseMotorWhether the motor turns it.
MotorSpeed
public float MotorSpeedHow fast the motor turns this body against the other, in degrees a second, anticlockwise.
MaxMotorTorque
public float MaxMotorTorqueThe most torque the motor turns it with, in newton meters.
UseLimits
public bool UseLimitsWhether it stops turning at HingeJoint2D.LowerAngle and HingeJoint2D.UpperAngle.
LowerAngle
public float LowerAngleThe least it turns, in degrees from where it was made: no further than a half turn either way, as Box2D measures a hinge's angle.
UpperAngle
public float UpperAngleThe most it turns, in degrees from where it was made: no further than a half turn either way.
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.
