Cannot slide correctly against btBvhTriangleMeshShape

Post Reply
Eric_A
Posts: 6
Joined: Wed May 06, 2009 4:42 am

Cannot slide correctly against btBvhTriangleMeshShape

Post by Eric_A » Wed Apr 07, 2010 11:19 pm

So we're having this annoying problem where our character's cannot slide smoothly against a btBvhTriangleMeshShape. Our characters constantly get hung up or entirely stuck when pressing up against a wall while trying to move forward along it, and often cannot move forward unless they directly pull away from the wall. This makes navigating around tight spaces an almost impossible task. Also, it appears that this is not just the internal edge problem that has plagued so many others. This behavior will happen in the middle of triangles, not just the edges between triangles; though it is worst on triangle edges.

Our character's are a compound shape made out of two capsules (one for the character and one for their gun). We are not using the Bullet character controller, but rather just applying forces to the capsule to move it around. We've tried futzing with a lot of the object parameters to get better behavior (set contact processing threshold to 0, set friction to 0, etc...), but nothing seems to fix the problem. As a note, our characters can slide just fine along other shapes such as btBoxShape, so it seems it's just an issue with btBvhTriangleMeshShape.

Any help with this would be greatly appreciated!

ola
Posts: 169
Joined: Sun Jan 14, 2007 7:56 pm
Location: Norway
Contact:

Re: Cannot slide correctly against btBvhTriangleMeshShape

Post by ola » Thu Apr 08, 2010 8:44 am

I have made a similar character controller, pushing a capsule around. I almost only use the btBvhTriangleMeshShape for the environment but haven't had any of the problems you describe. Maybe we can figure out what we are doing differently... here are some quick ideas:

- I have set friction and restitution to zero, and disabled rotations (angular factors are zero).
- I've got no gun, it's just a single capsule inside a compound shape.
- I'm applying impulses to the rigidbody to move it around, not forces.
- What happens if you let your rigidbody just slide around without applying forces, does it still get stuck?
- Have you tried to visualize the force vector you are applying, to make sure there isn't any bugs in the code creating the forces?
- Try to use Bullet's default configuration settings (that's what I'm using), and make sure there isn't some tweak somewhere left in the code that sets a wrong parameter.
- Also try to visualize the bounding box of your compound shape, to be sure there isn't something wrong going on there (maybe unlikely, but still..)
- Make sure your rigidbody isn't going to sleep (ok, again, not very likely..)
- What's the size of your capsule? Mine is human-sized (1.8 meters tall, radius 0.4, my units are in meters).
- Tried removing the gun capsule?

Cheers,
Ola

Post Reply