attaching PointDef to body and calling getShapestInContact

hi there!


I want to make quick tests around my shapes (they need to be fast so I guess point tests are the way to go) to try and get them to detect collisions beforehand and steer away, check out the steering behaviours here: http://www.red3d.com/cwr/steer/, a cool guide!

Code:
PointDef pd = new PointDef();
pd.localPosition = new Vec2(0, 1f);
pd.filter.categoryBits = 1;
pd.filter.maskBits = 0xFF;
pd.isSensor = true;
pd.mass = 1f;
pd.density = 1f;
testShape = body.createShape(pd);

testing against the shape:
Code:
        Set<Shape> set = testShape.getShapesInContact();
       System.out.println(testShape + " touching " + set);
        for( Shape shape : set) {
           Vec2 pos = shape.getBody().getWorldCenter();
           System.out.println("userdata " + shape.getUserData());
            ToolGL.point(gl, pos);
        }


so what I did was add a PointDef on my steering body. Then I call getShapesInContact to see if there is an overlap on the point. However, the getShapesInContact does not return correct information - it seems to be returning shapes as if ignoring the body's world position.

So I guess either, this isn't implemented, not ported, or I am using PointDef wrong? When I replace PointDef with PolygonDef and modify to make a small box, it works.

I apologize if this is not a JBox2D issue and I am posting under the wrong category.
Thanks! Kris
I would try using sensors, and then look for the shape (as a sensor) in your contact listener to check for contact

Original thread: https://box2d.org/forum/viewtopic.php?t=3793