Switching Modes

Digini
Posts: 2
Joined: Sat Jul 14, 2007 1:14 am

Switching Modes

Post by Digini »

Hi,

I'm having some problem with collision between a box shape and a plane. The plane is static with 0 mass and deactivation is disabled.

In general when I create my bodies they are all Kinematic/NoResponse but then I switch them to Dynamic and turn off NoResponse to begin simulation. When the user wants to drag one of the bodies I switch it back to being Kinematic/NoResponse again for the period of the drag operation.

In my scene I have a groundplane defined and what I see is that when I drop my box shape sometimes it collides and other times it just sails on through. However I have another body that is never switched, (it's always marked as dynamic) and this body never fails to hit the ground plane.

So I was wondering if there are any gotchas that I should know about when dynamically switching a between various collision modes?

By the way I'm actually using BulletX

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

Re: Switching Modes

Post by Erwin Coumans »

Digini wrote:Hi,

I'm having some problem with collision between a box shape and a plane. The plane is static with 0 mass and deactivation is disabled.

In general when I create my bodies they are all Kinematic/NoResponse but then I switch them to Dynamic and turn off NoResponse to begin simulation. When the user wants to drag one of the bodies I switch it back to being Kinematic/NoResponse again for the period of the drag operation.

In my scene I have a groundplane defined and what I see is that when I drop my box shape sometimes it collides and other times it just sails on through. However I have another body that is never switched, (it's always marked as dynamic) and this body never fails to hit the ground plane.

So I was wondering if there are any gotchas that I should know about when dynamically switching a between various collision modes?

By the way I'm actually using BulletX

thanks!
It is probably best to remove the rigidbody from the dynamics world, then make the change, and add it back to the dynamics world.

Hope this helps,
Erwin