Dynamic and static rigid bodies not colliding

Post Reply
adrianp
Posts: 3
Joined: Tue May 19, 2015 11:11 am

Dynamic and static rigid bodies not colliding

Post by adrianp »

Hi all,
this is the first time I'm using Bullet so I apologize if I've missed anything important and please let me know if that's the case.

Now to the issue. I can't get dynamic rigid bodies and static rigid bodies to collide. Only dynamic rigid bodies will collide however.

I’ve setup a btConvexHullShape for each of the bodies and I’m using a custom motionstate.

When gravity is simulated the dynamic bodies simply fall through the static ones. Why aren’t they colliding?

Thank you very much.

Here's (some of) the code:
PhysicsComponent
PhysicsSystem
Motionstate
Sceneimporter (buildCollisionShape)
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: Dynamic and static rigid bodies not colliding

Post by xexuxjy »

It's possible that the static objects have reached a sleeping state , you can try disabling sleeping on them in your PhysicsComponent as below. The default debug draw class also shades objects by activation state which may help show up errors.

if(mass == 0.0f)
{
body_->setActivationState(DISABLE_DEACTIVATION);
}
adrianp
Posts: 3
Joined: Tue May 19, 2015 11:11 am

Re: Dynamic and static rigid bodies not colliding

Post by adrianp »

Unfortunately not, already tried that. Thanks though.
xexuxjy
Posts: 225
Joined: Wed Jan 07, 2009 11:43 am
Location: London

Re: Dynamic and static rigid bodies not colliding

Post by xexuxjy »

Have you tried the very simple case of one dynamic body and one static body and breakpointing the broadphase collision?
aviator
Posts: 13
Joined: Thu Apr 02, 2015 5:15 pm

Re: Dynamic and static rigid bodies not colliding

Post by aviator »

adrianp wrote:Hi all,
this is the first time I'm using Bullet so I apologize if I've missed anything important and please let me know if that's the case.

Now to the issue. I can't get dynamic rigid bodies and static rigid bodies to collide. Only dynamic rigid bodies will collide however.

I’ve setup a btConvexHullShape for each of the bodies and I’m using a custom motionstate.

When gravity is simulated the dynamic bodies simply fall through the static ones. Why aren’t they colliding?

Thank you very much.

Here's (some of) the code:
PhysicsComponent
PhysicsSystem
Motionstate
Sceneimporter (buildCollisionShape)
Looks like a problem with btConvexHullShape set-up, can you test standard - simple dynamic rigid-bodies like box, sphere ?
adrianp
Posts: 3
Joined: Tue May 19, 2015 11:11 am

Re: Dynamic and static rigid bodies not colliding

Post by adrianp »

After many hours I realized it was "just" a scaling issue with the imported meshes. :x
Thanks for your suggestions though.
Post Reply