Static/Kinematic"Collision"

thePoet
Posts: 17
Joined: Tue Apr 15, 2008 4:14 pm

Static/Kinematic"Collision"

Post by thePoet »

I currently have a custom collision dispatcher that uses needsResponse and needsCollision to detect when objects overlapping with other items (but that won't get response because they need to pass through each other). I now have a case where we need to do something similar with out kinematic objects. I need to know when one of our kinematic objects overlaps a static object. However, the broadphase has already culled these out before we get to custom dispatcher, so I can't seem to do this. Is there a way I can override the broadphase to allow these kinematic objects through to the dispatcher, or should I rework these kinematic objects to be dynamic (and cull them out of response).
Mowan259
Posts: 5
Joined: Sat Jun 21, 2008 8:42 am

Re: Static/Kinematic"Collision"

Post by Mowan259 »

I am also interested in an answer to this, please. I need to be able to detect collisions between kinematic/static objects, or find a workaround.

Thanks!
Mowan259
Posts: 5
Joined: Sat Jun 21, 2008 8:42 am

Re: Static/Kinematic"Collision"

Post by Mowan259 »

Anyone? Pretty please?

Even a "expecting to be able to detect collisions between kinematic and static objects is crazy talk" would be a good start. I just need to know if either a) it should work (and I'm doing something wrong), or b) it shouldn't work and I need to refactor all my kinematic objects into dynamics. Surely someone must know?

Thanks in advance...!
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Static/Kinematic"Collision"

Post by Erwin Coumans »

By default, there is no collision detection between static, kinematic objects indeed, and it is a bit complicated to enable them:

Those collisions are disabled/filtered out in the broadphase, using the collision group/mask. You can try to overcome this, by writing your custom collision filter, search for setOverlapFilterCallback (broadphase). Additionally, derive your class from btCollisionDispatcher and override btCollisionDispatcher::needsCollision, so it doesn't print a warning.

Also, the collision filter (mask/group) can be overriden when adding the collision object/rigid body to the world. See btCollisionWorld::addCollisionObject and btDiscreteDynamicsWorld::addRigidBody.

We should provide a sample to show how to deal with this in an easier way, in the future...
Hope this helps,
Erwin