World:overlaps
EditReturns an iterator that can be used to iterate over "overlaps", or potential collisions between pairs of shapes in the World. This should be called after using World:computeOverlaps
to compute the list of overlaps. Usually this is called automatically by World:update
.
iterator = World:overlaps()
Arguments
None
Returns
Name | Type | Description |
iterator | function | A Lua iterator, usable in a for loop. |
Example
world:computeOverlaps()
for shapeA, shapeB in world:overlaps() do
local areColliding = world:collide(shapeA, shapeB)
print(shapeA, shapeB, areColliding)
end
See also
World:computeOverlaps
World:collide
World:update
World