World:newCylinderCollider

Edit

Adds a Collider to the world and attaches a CylinderShape.



Arguments

NameTypeDefaultDescription
xnumber0 The x coordinate of the center of the cylinder, in meters.
ynumber0 The y coordinate of the center of the cylinder, in meters.
znumber0 The z coordinate of the center of the cylinder, in meters.
radiusnumber1 The radius of the cylinder, in meters.
lengthnumber1 The length of the cylinder, in meters.

Returns

NameTypeDescription
colliderCollider The new Collider.

Arguments

NameTypeDefaultDescription
positionVec3 The position of the center of the cylinder, in meters.
radiusnumber1 The radius of the cylinder, in meters.
lengthnumber1 The length of the cylinder, in meters.

Returns

NameTypeDescription
colliderCollider The new Collider.

Notes

This will throw an error if there are too many colliders in the world. The limit defaults to 16384 and can be changed in lovr.physics.newWorld.

The length of the cylinder goes along its local Z axis.

See also