Using btBvhTriangleMeshShape with quantizedAabbCompression

slithEToves
Posts: 24
Joined: Mon Mar 12, 2007 9:55 pm

Using btBvhTriangleMeshShape with quantizedAabbCompression

Post by slithEToves »

Has anybody had any luck with using the quantized AABB compression of btBvhTriangleMeshShape? When I turn it on, I no longer get any collisions with my terrain, where previously I had collisions working.

I am using a btTriangleMesh (with many addTriangle calls) to feed to the constructor. I noticed that this causes the following assert at line 80 in btOptimizedBvh:

btAssert(partId==0)

so I wrote my own version of btTriangleMesh that uses 1 subpart but many tris per part. This also didn't work.

My terrain shape has just over 55000 tris.

I have tried this on Win32 as well as Xbox 360 with the same results.

Any advice?
slithEToves
Posts: 24
Joined: Mon Mar 12, 2007 9:55 pm

more info

Post by slithEToves »

Currently, nearly all of the collision calls are ray casts, including some that are straight down. This ends up creating an AABB that is of zero width and depth. I don't know if this matters or not.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

I just adjusted btTriangleMesh so it can use quantized aabb trees. Can you please check Bullet 2.46 and see if that helps?

How do you determine that the quantized aabb of the ray is 0?

Thanks for the feedback,
Erwin
slithEToves
Posts: 24
Joined: Mon Mar 12, 2007 9:55 pm

Post by slithEToves »

Thanks for the quick response! I just tested 2.46, and it fixed the problem.

When I saw a ray with AABB of zero depth, I was looking at the pre-quantized version. The raycast calls are returning collisions now, so it looks like it didn't matter.