0

In another question of mine I had asked about raycasting with bullet and libgdx and someone actually gave me a nice response but then when i went to implement it I've spent all day attempting it it never collides with objects anyone have any idea how to fix this

Reply im refering to: RayCasting in Libgdx 3d My code is pretty much what you see in that reply but if you need any more information ill provide it.

Community
  • 1
  • 1
  • Do your collision objects collide at all? I mean, with each other for example? You might need to set up the collision flags/filters/groups/callback flags etc correctly. – noone Jul 29 '14 at 05:06
  • Yeah my other objects successfully collide the ray for some reason.... doesn't 0.0 *Really confused –  Jul 29 '14 at 05:26

1 Answers1

1

(This would be a comment, but I am below 50pt)

Is the function from the reply you refering to return null or does the object not react?

If an object is returned, you may try to activate it:

btCollisionObject body = BulletUtil.rayTest(collisionWorld, pickRay);
if (body != null) {
    body.activate(); //activate because it may sleep
    //... then do whatever you want with this body now
    return true;
}

In the other post (you reply to), there were also two lines which didn't work for me (see my comment in the other post).

Jankapunkt
  • 8,128
  • 4
  • 30
  • 59