lovr.physics.newDistanceJoint
Creates a new DistanceJoint.
joint = lovr.physics.newDistanceJoint(colliderA, colliderB, x1, y1, z1, x2, y2, z2)
Arguments
Name | Type | Description |
colliderA | Collider | The first collider to attach the Joint to. |
colliderB | Collider | The second collider to attach the Joint to. |
x1 | number | The x position of the first anchor point, in world coordinates. |
y1 | number | The y position of the first anchor point, in world coordinates. |
z1 | number | The z position of the first anchor point, in world coordinates. |
x2 | number | The x position of the second anchor point, in world coordinates. |
y2 | number | The y position of the second anchor point, in world coordinates. |
z2 | number | The z position of the second anchor point, in world coordinates. |
Returns
Name | Type | Description |
joint | DistanceJoint | The new DistanceJoint. |
Notes
A distance joint tries to keep the two colliders a fixed distance apart. The distance is determined by the initial distance between the anchor points. The joint allows for rotation on the anchor points.
See also
lovr.physics.newBallJoint
lovr.physics.newHingeJoint
lovr.physics.newSliderJoint
lovr.physics