World:getContacts

Edit

Computes collision information between two shapes and returns a list of contacts where the shapes intersect. Each contact point consists of a position, a normal vector, and a penetration depth.

contacts = World:getContacts(shapeA, shapeB)

Arguments

NameTypeDescription
shapeAShape The first shape.
shapeBShape The second shape.

Returns

NameTypeDescription
contactstable A list of contacts. Each contact consists of 7 numbers: the contact position, the normal vector, and a depth value indicating how far the shapes intersect each other at the contact point ({ x, y, z, nx, ny, nz, depth }).

Notes

This only detects collision information, it does not cause the shapes to collide with each other. Use World:collide for that.

This function ignores collision tags.

See also