Hinge joints attach two sprites together at a pivot point, constraining them to rotate around this point, like a hinge.
Also known as a revolute joint.
The Box2D joint ID. Don't change it!
The first sprite in the joint.
The second sprite in the joint.
The type of joint. Can be one of:
"glue", "distance", "wheel", "hinge", "slider", or "grabber".
Can't be changed after the joint is created.
Determines whether to draw the joint if spriteA or spriteB is drawn.
The joint's current angle of rotation.
Function that draws the joint. Can be overridden by the user.
The upper limit of rotation.
Maximum torque the motor can apply.
The lower limit of rotation.
The current torque being applied by the motor.
Accepts a number to set a symmetric range or an array with the lower and upper limits of rotation.
How much force the joint is applying to keep the two sprites together.
How much torque the joint is applying to keep the two sprites together.
Deletes the joint from the world and from each of the associated sprites' joints arrays.
This function is run when the joint's reaction force exceeds the force threshold or its reaction torque exceeds the torque threshold.
By default, the sprites' speed and rotation speed are set to 0 and the joint is deleted, simulating a break.
A Joint is used to constrain the movement of two sprites relative to each other, which can lead to nuanced physics interactions.