lovr.physics.newBallJoint

Creates a new BallJoint.

ball = lovr.physics.newBallJoint(colliderA, colliderB, x, y, z)

Arguments

NameTypeDescription
colliderAColliderThe first collider to attach the Joint to.
colliderBColliderThe second collider to attach the Joint to.
xnumberThe x position of the joint anchor point, in world coordinates.
ynumberThe y position of the joint anchor point, in world coordinates.
znumberThe z position of the joint anchor point, in world coordinates.

Returns

NameTypeDescription
ballBallJointThe new BallJoint.

Notes

A ball joint is like a ball and socket between the two colliders. It tries to keep the distance between the colliders and the anchor position the same, but does not constrain the angle between them.

See also