Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.