lovr.physics.newHingeJoint

Creates a new HingeJoint.

hinge = lovr.physics.newHingeJoint(colliderA, colliderB, x, y, z, ax, ay, az)

Arguments

NameTypeDescription
colliderACollider The first collider to attach the Joint to.
colliderBCollider The second collider to attach the Joint to.
xnumber The x position of the hinge anchor, in world coordinates.
ynumber The y position of the hinge anchor, in world coordinates.
znumber The z position of the hinge anchor, in world coordinates.
axnumber The x component of the hinge axis.
aynumber The y component of the hinge axis.
aznumber The z component of the hinge axis.

Returns

NameTypeDescription
hingeHingeJoint The new HingeJoint.

Notes

A hinge joint constrains two colliders to allow rotation only around the hinge's axis.

See also