World:newBoxCollider

Edit

Adds a Collider to the world and attaches a BoxShape.



Arguments

NameTypeDefaultDescription
xnumber0 The x coordinate of the center of the box, in meters.
ynumber0 The y coordinate of the center of the box, in meters.
znumber0 The z coordinate of the center of the box, in meters.
widthnumber1 The width of the box, in meters.
heightnumberwidth The height of the box, in meters.
depthnumberwidth The depth of the box, in meters.

Returns

NameTypeDescription
colliderCollider The new Collider.

Arguments

NameTypeDescription
positionVec3 The position of the center of the box, in meters.
sizeVec3 The size of the box, 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.

See also