lovr.physics.newDistanceJoint

Creates a new DistanceJoint.

joint = lovr.physics.newDistanceJoint(colliderA, colliderB, x1, y1, z1, x2, y2, z2)

Arguments

NameTypeDescription
colliderAColliderThe first collider to attach the Joint to.
colliderBColliderThe second collider to attach the Joint to.
x1numberThe x position of the first anchor point, in world coordinates.
y1numberThe y position of the first anchor point, in world coordinates.
z1numberThe z position of the first anchor point, in world coordinates.
x2numberThe x position of the second anchor point, in world coordinates.
y2numberThe y position of the second anchor point, in world coordinates.
z2numberThe z position of the second anchor point, in world coordinates.

Returns

NameTypeDescription
jointDistanceJointThe 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