Page 1 of 1

How to volume/thick ray test? ,ClosestRayResultCallback?

Posted: Wed Mar 30, 2016 12:59 pm
by hyyou
Bullet has point ray test functions :-

Code: Select all

btCollisionWorld::ClosestRayResultCallback RayCallback(Start, End); 
But in a situation where a bazooka shoot a very fast big rocket (e.g. rigidBody), does BulletPhysic has any function to ray test that volume?

If not, alternative approaches that come to my mind are :-
  • 1. create a lot of rays (brute force and not always correct)
    2. create a new RigidBody that has a long shape like prism (hard to calculate the mesh manually)
Are there any other solutions?

Edit1: 2 days without answers ... so it can be assumed that my question is not clear, bad luck, or no one have ever do this before.

Re: How to volume/thick ray test? ,ClosestRayResultCallback?

Posted: Mon Apr 11, 2016 6:27 am
by Evan407
you could put a really long cylinder ghost object in the world and find out what it collides with
with its transform you are able to rotate it however you like
I can see this along with a distance test might work great. You could calculate the distance the rocket has traveled and the distance the collisions are and do a little collision detection yourself.

unfortunately bullet's collision detection doesn't work so well with smaller fast moving objects (for example a bullet)
if you're willing to slow down the rocket enough you could use a rigid body and make its collision shape a lot longer than the actual rocket so that the collision would at least still be detected

Re: How to volume/thick ray test? ,ClosestRayResultCallback?

Posted: Mon Apr 11, 2016 12:21 pm
by Flix
hyyou wrote:Bullet has point ray test functions :-
Code:
btCollisionWorld::ClosestRayResultCallback RayCallback(Start, End);

But in a situation where a bazooka shoot a very fast big rocket (e.g. rigidBody), does BulletPhysic has any function to ray test that volume?
A convex cast instead of a ray cast ?