Small objects and bad fitting AABB...

jimali
Posts: 7
Joined: Thu Feb 07, 2008 8:06 am

Small objects and bad fitting AABB...

Post by jimali »

I've had some trouble getting Bullet to run efficiently with smaller objects ~ (0.1,0.1,0.05). I found the gContactBreakingThreshold and set it to 0.002 so that my objects would not dance around. But now i try to put in a couple of hundred objects such that they are relatively close ~(0.02) to each other but not colliding and the performance drops to 0.1 frame a sec...

I tried enlarging all objects 20 times and every thing went smoothly. I then tried comparing the AABB's using the debug drawer and it seems that i could roughly stack 20 objects into a bounding AABB of one object. I played around with the collision margin but i could never get the AABB smaller. (collision margin = 0.001)

My objects are composed of trimeshes and i use btGImpactConvexDecompositionShape, since the btGImpactMeshShape seemed to be quite unstable (lots of interpenetration). Perhaps that is my problem?

I know i read somewhere here in the forum that bullet was designet for a specific range of object sizes. But my hope was that some tuning of parameters could spare me for the pain of wrapping all my code with scaling wrappers or the likes.

I would apreciate any suggestions on my newbie troubles...
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Small objects and bad fitting AABB...

Post by Erwin Coumans »

The AABB increase could be caused by the quantization in the btAxisSweep3 broadphase. Can you try to use the new btDbvtBroadphase instead?

Currenty, there is no easy down/up scaling, and object sizes should be larger than say 0.2 units in any direction, but perhaps your work can help toward support for scaling. This issue has been reported and is on the todo, but we are quite busy with other things:
http://code.google.com/p/bullet/issues/detail?id=45

Thanks,
Erwin
jimali
Posts: 7
Joined: Thu Feb 07, 2008 8:06 am

Re: Small objects and bad fitting AABB...

Post by jimali »

Thanx for the fast reply
The AABB increase could be caused by the quantization in the btAxisSweep3 broadphase. Can you try to use the new btDbvtBroadphase instead?
I played around with my code and got btGImpactMeshShape to work. I also discovered that my collision margin was not updated in the correct order so that explains alot..
Using btGImpactConvexDecompositionShape still produce quite large AABB's which has a huge performance hit even when no collision exist. I guess that the broadphase will detect many "collision" because of the not so tight bounds and that the narrowphase to btGImpactConvexDecompositionShape is relatively more expensive than that of say btGImpactMeshShape when no real collision exist. But what do i know... I'll try out btDbvtBroadphase.
Currenty, there is no easy down/up scaling, and object sizes should be larger than say 0.2 units in any direction, but perhaps your work can help toward support for scaling. This issue has been reported and is on the todo, but we are quite busy with other things:
http://code.google.com/p/bullet/issues/detail?id=45
Ok, i will post whatever solution i come up with. The down/up scaling method seem a bit messy. I think i'll try using per object specific parameters instead of global parameters such as gContactBreakingThreshold. If thats even possible?

Cheers,
Jimmy