Kinematic and static bodies collisions

MaxMart
Posts: 2
Joined: Fri Oct 12, 2007 1:18 am

Kinematic and static bodies collisions

Post by MaxMart »

I'm using bullet in a game project for simulation and collision detection. The game characters are kinematic bodies, the map is static, and there are dynamic bodies around. I want to get all collisions from Bullet, even kinematic-kinematic and kinematic-static. In order to do this I changed the collisions group and mask of kinematic objects to be the same as the ones for dynamic objects. I list the collisions using btCollisionDispatcher::getManifoldByIndexInternal.

I have two problems with this approach. The first one is that bullet prints a warning about static-static collisions to the console, I commented out the code that prints this from Bullet but I would like to know if there is a better way to solve this. The second problem is that kinematic-kinematic and static-kinematic collisions are not working right. When one of this collisions occurs I can see it in the manifold list, but when the objects stop colliding the collision is still in the manifold list. The collision disappears when the AABBs of the objects get separated.

Succintly, my question is: what is the correct way to enable and list kinematic-kinematic and kinematic-static collisions?

Thanks, Máximo Martínez
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Kinematic and static bodies collisions

Post by Erwin Coumans »

MaxMart wrote: I have two problems with this approach. The first one is that bullet prints a warning about static-static collisions to the console, I commented out the code that prints this from Bullet but I would like to know if there is a better way to solve this.
This warning will be removed, it was just to notify developers something is potentially wrong (usually you don't want static-static collision detection). A new type would probably better.
The second problem is that kinematic-kinematic and static-kinematic collisions are not working right. When one of this collisions occurs I can see it in the manifold list, but when the objects stop colliding the collision is still in the manifold list. The collision disappears when the AABBs of the objects get separated.
This should be fixed in Bullet 2.63: the refresh of contact points was done inside the constraint solver. It has been moved into the collision detector. Can you try out the new Bullet-2.63-RC1 release candidate?
Succintly, my question is: what is the correct way to enable and list kinematic-kinematic and kinematic-static collisions?
Once some work on the character control demo will happen, this will automatically pop up as an issue, I suppose.
If you have any suggestions, please let me know, ok?
Thanks,
Erwin
MaxMart
Posts: 2
Joined: Fri Oct 12, 2007 1:18 am

Re: Kinematic and static bodies collisions

Post by MaxMart »

Erwin Coumans wrote:This should be fixed in Bullet 2.63: the refresh of contact points was done inside the constraint solver. It has been moved into the collision detector. Can you try out the new Bullet-2.63-RC1 release candidate?
I tried Bullet-2.63-RC1 and it works great. I let you know if I find any bugs or have any suggestion.

Thanks, Máximo
smjones
Posts: 5
Joined: Mon Oct 15, 2007 2:37 pm

Re: Kinematic and static bodies collisions

Post by smjones »

MaxMart,
Your question is pretty timely for me as well. Recently I used another SDK <sorry> :? and attempted to get kinematic to kinematic objects to collide and be detected. If a dynamic object was colliding into a kinematic one, the collision was detected but the reverse was not the case if I was manually moving the kinematic one.
I'd like to try this again using Bullet. I will re-read your suggestion with flags and collision groups once I get to understand the sdk a bit more.

Steve