lovr.physics.newBallJoint

Edit

Creates a new BallJoint.



Arguments

NameTypeDescription
colliderACollider The first collider to attach the Joint to, or nil to attach the joint to a fixed position in the World.
colliderBCollider The second collider to attach the Joint to.
xnumber The x position of the joint anchor point, in world coordinates.
ynumber The y position of the joint anchor point, in world coordinates.
znumber The z position of the joint anchor point, in world coordinates.

Returns

NameTypeDescription
ballBallJoint The new BallJoint.

Arguments

NameTypeDescription
colliderACollider The first collider to attach the Joint to, or nil to attach the joint to a fixed position in the World.
colliderBCollider The second collider to attach the Joint to.
anchorVec3 The joint anchor point, in world coordinates.

Returns

NameTypeDescription
ballBallJoint The 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.

If the anchor is nil, the position of the first Collider is the anchor. If the first collider is nil, then the position of the second Collider is the anchor.

See also