My suggestion is: How about making a function that tests a point and returns object? something like:
Code: Select all
love.physics.testPoint(x,y,world) --Returns single shape(multiple if clipped together)
love.physics.testSegment(x,y,x2,y2,first,world) --Returns if first, first shape, else all shapes
love.physics.testCircle(x,y,radius,world) --Returns all shapes in a circle
love.physics.testRectangle(x,y,w,h,angle,world) --Same, just a rectangle
love.physics.testPolygon(world, ...) --Same, just a polygon