btBvhTriangleMesh not colliding

Cetra
Posts: 8
Joined: Fri Dec 17, 2010 3:24 am

btBvhTriangleMesh not colliding

Post by Cetra »

Hey guys,

I've got probably a simple problem but can't seem to find out where it lies.

I have an array of btBvhTriangleMeshShapes but they don't appear to be colliding/rebounding off one another. Gravity seems to work fine, they just don't want to run into eachother on the way down. Any pointers?
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: btBvhTriangleMesh not colliding

Post by Flix »

AFAIK btBvhTriangleMeshShapes are designed for static/kinematic objects.
If you need to detect collisions between two concave meshes you should probably try using dynamic bodies and btGImpactMeshShapes or btCompoundShapes.
Cetra
Posts: 8
Joined: Fri Dec 17, 2010 3:24 am

Re: btBvhTriangleMesh not colliding

Post by Cetra »

They are static shapes but they're in a 2d plane, which is the only reason I could see they're not rebounding into one another.
Cetra
Posts: 8
Joined: Fri Dec 17, 2010 3:24 am

Re: btBvhTriangleMesh not colliding

Post by Cetra »

Any suggestions?

Can I use btBvhTriangleMeshShapes on purely 2d objects?
Flix
Posts: 456
Joined: Tue Dec 25, 2007 1:06 pm

Re: btBvhTriangleMesh not colliding

Post by Flix »

Well, if you're going to make a pure 2d simulation, maybe using other libraries would help (e.g.http://www.box2d.org/).

As far as Bullet is concerned:
Cetra wrote:Can I use btBvhTriangleMeshShapes on purely 2d objects?
They are static shapes but they're in a 2d plane, which is the only reason I could see they're not rebounding into one another.
Well the main problem of completely flat shapes if that tunnelling is very easy (but I guess your 2d simulation won't allow objects to go in that direction...).

Aside from this, static objects in Bullet can't collide with each other, so you should use them only for "background" and use GImpactMeshShapes or btCompoundShapes for the (concave) moving ones (as far as I know in Bullet there is no btBvhTriangleMeshShape vs btBvhTriangleMeshShape collision algorithm, but I may be wrong).

I don't think that btBvhTriangleMeshShapes can't be used in 2d (they should work at the triangle level, so the only problem should only be easy tunnelling).

That's all I know about it.
Cetra
Posts: 8
Joined: Fri Dec 17, 2010 3:24 am

Re: btBvhTriangleMesh not colliding

Post by Cetra »

Flix wrote:Well, if you're going to make a pure 2d simulation, maybe using other libraries would help (e.g.http://www.box2d.org/).
I've tried the other libraries, but It's eventually going to be a hybrid 2d/3d environment (2.5d ish type).
Flix wrote:Aside from this, static objects in Bullet can't collide with each other, so you should use them only for "background" and use GImpactMeshShapes or btCompoundShapes for the (concave) moving ones (as far as I know in Bullet there is no btBvhTriangleMeshShape vs btBvhTriangleMeshShape collision algorithm, but I may be wrong).
I should have looked through the FAQ, I feel silly, as I knew this problem was. Thanks for your help :)