lovr.physics.newConeJoint

Edit

Creates a new ConeJoint.



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 space.
ynumber The y position of the joint anchor point, in world space.
znumber The z position of the joint anchor point, in world space.
axnumber The x component of the cone axis, in world space.
aynumber The y component of the cone axis, in world space.
aznumber The z component of the cone axis, in world space.

Returns

NameTypeDescription
coneConeJoint The new ConeJoint.

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 space.
axisVec3 The cone axis, in world space.

Returns

NameTypeDescription
coneConeJoint The new ConeJoint.

Notes

A ConeJoint is similar to a BallJoint, where the relative position between the colliders will be constrained to a single point. However, the ConeJoint also limits the rotation away from the cone axis. This can be useful for limb joints, ropes, etc.

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