Obtaining body by point.
Posted: Thu Nov 19, 2015 6:31 pm
How can i obtain a body by a point? if there is a body of 100x100 in 250,300 how can i obtain it with the point 280,310 (for example)?
You mean the coordinates or what exactly?Fab1can wrote:How can i obtain a body by a point? if there is a body of 100x100 in 250,300 how can i obtain it with the point 280,310 (for example)?
Maybe this is what i want to do, but queryBoundingBox doesn't give me a list of fixtures.ivan wrote:First you do a query and this will give you a list of fixtures.
https://love2d.org/wiki/World:queryBoundingBox
Then you iterate the list and use "testPoint" on each fixture.
https://love2d.org/wiki/Fixture:testPoint
Last you get the associated body for each fixture.
https://love2d.org/wiki/Fixture:getBody