Box2D body selection

BlitzMax Forums/Brucey's Modules/Box2D body selection

Snixx(Posted 2010) [#1]
I am having trouble finding out if x, y is inside of a body. I have tried taking the mousedown function etc that is used in the examples but it never returns a true.


Volker(Posted 2010) [#2]
You can test if a point is inside a shape with b2shape.TestPoint(),
but never used it myself.


Snixx(Posted 2010) [#3]
Got it working... kinda, however if I create a triangle body it does not work correctly, boxes, rects, circles are fine, but with triangles it seems to be confused as to if it is inside of the body or not.


Volker(Posted 2010) [#4]
Perhaps you can add some code especially for triangles:
http://www.blackpawn.com/texts/pointinpoly/default.html


Snixx(Posted 2010) [#5]
Doh my fault, placed an exit where one shouldnt have been by mistake, it work fine... thanks for the link thou.