Raycasting - Getting sequential collision objects

sipickles
Posts: 44
Joined: Thu Aug 07, 2008 6:57 am

Raycasting - Getting sequential collision objects

Post by sipickles »

Hello

I am using raycasting for mouse picking and its working well.

However, the result points to the first object that the ray collided with. Makes sense as I am using btCollisionWorld::ClosestRayResultCallback to retrieve the collision object.

So what if I want to find the next collision object, ie, the collision object BEHIND the first one hit, as if the ray had carried on.

Is this possible? Can I do it with a single ray? Or perhaps a second ray test from the first collision location, with the same direction vector?

Thanks

Simon