Distance joints are used to constrain the distance between two sprites.
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 current distance between the two joint anchors.
Function that draws the joint. Can be overridden by the user.
The target length of the joint between the two joint anchors.
It's set to the current distance between the two sprites when the joint is created.
The maximum length allowed when limits are enabled.
Maximum motor force the motor can apply.
The minimum length allowed when limits are enabled.
The current motor force being applied by the joint.
Accepts a number to set a symmetric range or an array with the minimum and maximum length limits.
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.