Page 1 of 1

shape:testSegment() and shape:testPoint() suggetstions

Posted: Sun Nov 16, 2008 2:33 am
by MHD
In the current implementation of theese two functions I think that it is awkward to cycle through all of the objects I want to test for.

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
This would make finding objects much, much, much easier.

Re: shape:testSegment() and shape:testPoint() suggetstions

Posted: Tue Nov 18, 2008 7:57 pm
by subrime
With your awesome lua skills, these should be a snap to implement.