Rigid Body Vs Collision Shape Collision Detection

Murphy
Posts: 32
Joined: Fri Aug 31, 2007 6:36 am

Rigid Body Vs Collision Shape Collision Detection

Post by Murphy »

I have wrappers for bullet rigid bodies made out of shapes such as btBoxShape and btSphereShape. I have functions in these wrappers such as SetKinematic, SetStatic, and SetContactResponse.

I am successfully using SetStatic(true) and SetContactResponse(false) on a Box to turn it into a box sensor basically. When my vehicle collides with the Box I get a collision event which I can use in gameplay code. Running into the box does not cause the vehicle to stop, it goes right through as if it wasn't there.

However, if the Box is in the air and I use a ramp to get to it, I don't get the collision event and hitting the box causes the vehicle to act as if contact response was enabled (it hits the box and flips around wildly).

I can't imagine what could be causing this when the same code works fine for boxes that the vehicle collides with while on the ground but causes problems when the vehicle is not on the ground.

Any ideas? Should I just use the collision shapes without the rigid bodies (I would like to be able to switch between the two at any point however)?