Creates a new DistanceJoint.
joint = lovr.physics.newDistanceJoint(colliderA, colliderB, x1, y1, z1, x2, y2, z2)
joint = lovr.physics.newDistanceJoint(colliderA, colliderB, first, second)
Arguments Name Type Description colliderA Collider
The first collider to attach the Joint to, or nil
to attach the joint to a fixed position in the World.
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 Arguments Name Type Description colliderA Collider
The first collider to attach the Joint to, or nil
to attach the joint to a fixed position in the World.
colliderB Collider
The second collider to attach the Joint to.
first Vec3
The first anchor point, in world coordinates.
second Vec3
The second anchor point, in world coordinates.
Returns
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.
If no anchors are given, they default to the positions of the Colliders.
See also