lovr.physics.newHingeJoint

Creates a new HingeJoint.

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

Arguments

NameTypeDescription
colliderAColliderThe first collider to attach the Joint to.
colliderBColliderThe second collider to attach the Joint to.
xnumberThe x position of the hinge anchor, in world coordinates.
ynumberThe y position of the hinge anchor, in world coordinates.
znumberThe z position of the hinge anchor, in world coordinates.
axnumberThe x component of the hinge axis.
aynumberThe y component of the hinge axis.
aznumberThe z component of the hinge axis.

Returns

NameTypeDescription
hingeHingeJointThe new HingeJoint.

Notes

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

See also