[Solved]No collisions with btBvhTriangleMeshShape

Sorlaize
Posts: 18
Joined: Sun Mar 29, 2009 5:00 pm

[Solved]No collisions with btBvhTriangleMeshShape

Post by Sorlaize »

Edit: solved

Hi, I'm new here, I've been having problems with the btBvhTriangleMeshShape. I've been able to swap it out for a btBoxShape and that works as expected(see commented line) and the character controller works with it too, pushing boxes around. But I can't get anything to collide with the btBvhTriangleMeshShape, even though I've only been using example code.

Also I've used meshes from working demos, so I'm sure it's not the data I'm using.

Setting up my world:
<this was fine>

Adding rigid bodies:
<solved: I was able to work around this by using a btTriangleIndexVertexArray instead of btTriangleMeshShape->addTriangle().>

When I used a btGImpactMeshShape I was calling updateBound() with no luck. Also I've tried generating a heightmap because I thought the mesh might have been rotated incorrectly. I then tried a terrain mesh with all its polygons duplicated upside down, but still no collisions. I'm 100% sure irrlicht is using the same scale as bullet.

This is my code for adding a box:

<this was fine>

Please help :D
Last edited by Sorlaize on Sat Apr 04, 2009 8:45 pm, edited 2 times in total.
Sorlaize
Posts: 18
Joined: Sun Mar 29, 2009 5:00 pm

Re: No collisions with btBvhTriangleMeshShape

Post by Sorlaize »

Forgot to add- using the latest version of bullet from the svn.
Sorlaize
Posts: 18
Joined: Sun Mar 29, 2009 5:00 pm

Re: No collisions with btBvhTriangleMeshShape

Post by Sorlaize »

Tried adding these collision masks everywhere, but it didn't help: btCollisionObject::CF_STATIC_OBJECT | btCollisionObject::CF_KINEMATIC_OBJECT

I will try checking for the number of collisions to see if it changes.
LaceySnr
Posts: 11
Joined: Fri Mar 20, 2009 11:11 am

Re: No collisions with btBvhTriangleMeshShape

Post by LaceySnr »

See my previous self answered thread here:

http://www.bulletphysics.com/Bullet/php ... f=9&t=3381

Hope that helps
Sorlaize
Posts: 18
Joined: Sun Mar 29, 2009 5:00 pm

Re: No collisions with btBvhTriangleMeshShape

Post by Sorlaize »

http://www.bulletphysics.com/Bullet/php ... 137#p13137

I thought static objects were just ones with no mass, is that right?

I'm going to confirm the vertices I pass in are the same as with the other working demos.
Sorlaize
Posts: 18
Joined: Sun Mar 29, 2009 5:00 pm

Re: No collisions with btBvhTriangleMeshShape

Post by Sorlaize »

The vertex count was right and I was passing in triangles correctly as far as I can tell, but I haven't debugged it step-by-step so I can't be sure. I solved the issue by using the btTriangleIndexVertexArray to initialize the btBvhTriangleMeshShape instead, is this the recommended way?

Also- with some meshes the triangles that are culled are still used in collision detection, but not others. Is there anything I'd need to know about this when designing levels?

Thanks.
dolly004
Posts: 1
Joined: Mon May 18, 2009 5:18 pm

Re: [Solved]No collisions with btBvhTriangleMeshShape

Post by dolly004 »

this is an interesting discussion.. thank you for sharing :)
simulation rachat de credit