detecting collision between kinematic and static objects

gjaegy
Posts: 178
Joined: Fri Apr 18, 2008 2:20 pm

detecting collision between kinematic and static objects

Post by gjaegy »

Hi,

I am still having some issues with Bullet integration.

My application uses the following objects:

- an airport model, defined as a static mesh
- aircrafts, that can be either controlled by an external simulator or by Bullet. For each aircraft I create two bodies, built from a compound shape (convex decomposition): a standard one and a kinematic one. I switch between them by adding/removing them from the world.

I need to detect collision between aircrafts themselves or between the static mesh and an aircraft. For that purpose I have overriden the btCollisionDispatcher class, and detect collisionq trough the needsResponse() method.

When the aircrafts are controlled by the external simulator (and thus kinematic objects used) the needsResponse() doesn't get called. I have tried needsCollision() as well. It seems bullet discards collision between static and kinematic objects, and I am not sure at which level this happens.

Is there a way to detect when a collision occurs between kinematic and static objects (if possible without decreasing performance) ?

Thanks a lot for your help.
Gregory
gjaegy
Posts: 178
Joined: Fri Apr 18, 2008 2:20 pm

Re: detecting collision between kinematic and static objects

Post by gjaegy »

nobody ?

it seems collisions between static and kinematic bodies are filtered out, but I am not sure how to handle this... (actually, I have no idea :)
User avatar
detox
Posts: 12
Joined: Wed Nov 22, 2006 6:52 pm
Location: Ohio, USA

Re: detecting collision between kinematic and static objects

Post by detox »

Maybe you could do ray casts or convex sweeps to detect collisions manually?

I don't believe Bullet supports collisions between kinematic and static objects at all...
gjaegy
Posts: 178
Joined: Fri Apr 18, 2008 2:20 pm

Re: detecting collision between kinematic and static objects

Post by gjaegy »

thanks for your answer.

Not sure if that was clear: I don't need reaction, simply the information that the aircraft is in collision with the airport.

Anyway, now I am not sure what would be the most efficient way to solve my problem: how can I detect collisions between the airport model and aircrafts that are positioned by an external simulator ? I though kinematic objects would have been my solution, now I am not sure anymore...

Is there any bullet sample that does what you describe ? Which of the two solution do you think would be the most efficient ? I am not sure how many rays and in which direction I should cast my ray. Convex sweeps sounds better to me, how to use them ?

Any other ideas ?

Thanks for your support
User avatar
detox
Posts: 12
Joined: Wed Nov 22, 2006 6:52 pm
Location: Ohio, USA

Re: detecting collision between kinematic and static objects

Post by detox »

you might try looking at this post, I think it might be a good starting point
http://www.bulletphysics.com/Bullet/php ... f=9&t=2046

There is also a demo named ContinuousConvexCollision which might have something useful for you. I'm not sure, I haven't looked at it too closely.

It sounds like to me that you are in need of some sort of simple kinematic controller which signals when a collision occurs or is imminent? I believe the convexSweepTest() is what you are looking for.
gjaegy
Posts: 178
Joined: Fri Apr 18, 2008 2:20 pm

Re: detecting collision between kinematic and static objects

Post by gjaegy »

Hmmm, that might be what I need; it might be even better than using kinematic objects when aircrafts position are controlled by the external simulator.

I will give it a try, thanks a lot detox !