Kinematic-Kinematic Collision

cobolt_dink
Posts: 72
Joined: Fri Apr 04, 2008 6:07 pm

Kinematic-Kinematic Collision

Post by cobolt_dink »

Trying to get two Kinematic objects to collide. I've got both CF_CUSTOM_MATERIAL_CALLBACK and CF_KINEMATIC_OBJECT flags set, disabling deactivation on both, and set and a custom callback setup. But the callback doesn't seem to get called when they collide.
AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Re: Kinematic-Kinematic Collision

Post by AlexSilverman »

I would think this is due to the fact that kinematic objects must be static, and collision is disabled between static objects.

- Alex
Oogst
Posts: 25
Joined: Thu Apr 10, 2008 11:19 am
Location: Utrecht, Netherlands

Re: Kinematic-Kinematic Collision

Post by Oogst »

Aren't static and kinematic two different groups? Kinematic objects are animated objects that are not influenced by physics, but do influence the physics themselves.

It seems sensible that Bullet would not detect collisions between kinematic objects, as they are not influenced by the physics anyway, but I do not know how to override this behaviour.
AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Re: Kinematic-Kinematic Collision

Post by AlexSilverman »

Here's my understanding of the relationship. Static objects are not influenced by anything, but do influence the other dynamic bodies in the simulation. Kinematic objects are the same as static object, but with some extra properties layered on top, so to speak. I believe this is so it is able to calculate forces when movement is applied between simulation updates. This allows for a kinematic moving platform to have objects resting on top of it move along with it, instead of staying stationary and the platform moving out from underneath them.

- Alex
eddybox
Posts: 25
Joined: Thu Nov 29, 2007 7:08 pm

Re: Kinematic-Kinematic Collision

Post by eddybox »

While we're on the subject of kinematic bodies, anyone know what the recommended/safe way is to switch a body between dynamic and kinematic/static mode?

Thanks,
Eddy
User avatar
Dragonlord
Posts: 198
Joined: Mon Sep 04, 2006 5:31 pm
Location: Switzerland

Re: Kinematic-Kinematic Collision

Post by Dragonlord »

I'm not an expert on this but I destroy the rigid body upon changing this state and then fully recreated ( and re-add ) it. This way it's clean. Usually you won't change this state often anyways so it should not matter.
Oogst
Posts: 25
Joined: Thu Apr 10, 2008 11:19 am
Location: Utrecht, Netherlands

Re: Kinematic-Kinematic Collision

Post by Oogst »

I my code I just switch the state and so far I did not get any problems with that.