Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to picking some object with rayTest method of BulletPhysics. The problem is my stage is surrounded with walls (btStaticPlane) and the target objects (btSphereShape) are in there. And I'm trying to pick with a line from the outside of the surrounding box.

So I have to exclude the planes from rayTest. How can I do this?

share|improve this question
up vote 1 down vote accepted

when you call raytest function from btCollisionWorld class it returns all the object your ray hits (according to this page). so you just need to iterator over all the collisions and then just pick the ones you want.

you can also create a new instance of btCollisionWorld and call raytest from that instance.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.