lovr.physics.newHingeJoint

Edit

Creates a new HingeJoint.



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 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 direction.
aynumber The y component of the hinge axis direction.
aznumber The z component of the hinge axis direction.

Returns

NameTypeDescription
hingeHingeJoint The new HingeJoint.

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 anchor point, in world coordinates.
axisVec3 The hinge axis direction.

Returns

NameTypeDescription
hingeHingeJoint The new HingeJoint.

Notes

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

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

If the axis is nil, it defaults to the direction between the anchor and the second Collider.

See also