Jittery collision detection with BVH on Bullet 2.73

lvella
Posts: 16
Joined: Thu Oct 30, 2008 4:28 pm

Jittery collision detection with BVH on Bullet 2.73

Post by lvella »

I was using Bullet 2.72 until I find that objects with motion clamping CCD were getting stuck on the surface of objects they should not collide with (because of bit mask filtering). So I updated to Bullet 2.73, to find that this bug was corrected, but I found another one...

The ground of my scene is a far from ideal BVH mesh, but it is all I have at the moment. With version 2.72, I was getting some jitter while walking with the game's character over some specially bad shaped parts of the mesh, but was stable on overall. Now, with version 2.73, I am getting jittery even on parts that previously were stable, and the things get very bad at the faulty places, with the character flying of ground.

Do you know what have changed between versions that might have caused this problem? Is there some compillation option to switch back to the old behavior?

EDIT: Sorry, how could I miss this one?
http://www.bulletphysics.com/Bullet/php ... f=9&t=3052
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Jittery collision detection with BVH on Bullet 2.73

Post by sparkprime »

Heh

I wasn't aware that anything had changed between Bullet versions though...
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Jittery collision detection with BVH on Bullet 2.73

Post by Erwin Coumans »

Now, with version 2.73, I am getting jittery even on parts that previously were stable, and the things get very bad at the faulty places, with the character flying of ground.
I'm not aware of any deterioration or introduced jitter going from 2.72 to 2.73. The main thing that changed is the friction model, and we just reverted that change in the latest trunk. Could you try to use the very latest SVN trunk?

If that doesn't help, do you have a reproduction case?

What kind of collision shapes do you use, and what is their size? Do you use local scaling? How big are the triangles? What parameters do you pass into 'stepSimulation' exactly?

Thanks,
Erwin
lvella
Posts: 16
Joined: Thu Oct 30, 2008 4:28 pm

Re: Jittery collision detection with BVH on Bullet 2.73

Post by lvella »

With the solution from the other topic, updating the normals at gContactAddedCallback, I see no improvement. Same thing with lasted SVN trunk.

For the ground I use btBvhTriangleMeshShape, with "shape->setLocalScaling(btVector3(1.0f, 1.0f, 1.0f));".
For the character I use btCapsuleShapeZ, with sizes "mShape(0.17f, 1.061f)", no kinematic, angular factor set to 0, using motion clamping CCD:
m_pRigidBody->setCcdMotionThreshold(0.169f);
m_pRigidBody->setCcdSweptSphereRadius(0.03f);

There is one ground mesh for each "zone" in the scene manager, the one that was stable have triangles ranging from 25 units each side to 5 units each size, none of them too degenerated.
The bad ground mesh have many almost degenerated triangles with 0.5 units at one side and 10 in another.
The meshes themselves have size at about 100x100 units.
Oh, by the way, after the upgrade, the transition between ground meshes became bumpy, too.

Here is my stepSimulation:
m_pWorld->stepSimulation(1.0f/30.0f, 3);

What exactly do you mean by reprodution case?
sparkprime
Posts: 508
Joined: Fri May 30, 2008 2:51 am
Location: Ossining, New York

Re: Jittery collision detection with BVH on Bullet 2.73

Post by sparkprime »

Usually what people do is modify one of the Bullet examples to demonstrate the problem that they are experiencing. This is important because it's very often specific to the particular scales, velocities, shapes, etc that you are using. You could try modifying the character example to use your own ground mesh.
lvella
Posts: 16
Joined: Thu Oct 30, 2008 4:28 pm

Re: Jittery collision detection with BVH on Bullet 2.73

Post by lvella »

Ok, I finally made that reproduction case, based on CcdPhysicsDemo. It consists in a capsule, simulating my character, that walks back and forward over two different grounds. The left one is the bad shaped one (as you can see by pressing 'w'), the right one is the good shaped. The program shows perfectly my problem.

If I compile and link against bullet 2.72, the capsule movement is smooth over all the ground. If I use bullet 2.73 or 2.74beta1, the capsule movement is bumpy, mainly on left side.

It seems to be a regression. What do you think?
You do not have the required permissions to view the files attached to this post.
lvella
Posts: 16
Joined: Thu Oct 30, 2008 4:28 pm

Re: Jittery collision detection with BVH on Bullet 2.73

Post by lvella »

Should I post it to the issue tracker?
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Jittery collision detection with BVH on Bullet 2.73

Post by Erwin Coumans »

Should I post it to the issue tracker?
Yes, please do so. This makes sure your issue will be addressed and not get lost among all other forum traffic.

Thanks for the help,
Erwin