Very small objects

Post Reply
User avatar
tasora
Posts: 26
Joined: Mon Aug 15, 2005 8:57 am
Location: Italy
Contact:

Very small objects

Post by tasora »

hallo,
I am using Bullet collision detection in my physics simulation library. Today I was trying to simulate some thousands of pebbles interacting with an off-road vehicle, and I discovered that the performance of the collision was largely affected by the scale (measuring units). Basically: if I simulated 20'000 spheres each with 0.005 diameter, the RAM requirement was very high, whereas the same exact problem with rescaled sizing, say 0.5 diameter for spheres, was optimal.
This was not related to dynamics, it was related only to the broadphase collision: the broadphase created way too many manifolds. At the beginning I thought I was doing somthing wrong with collision margins, but the problem was different, and I want to tell it on this forum because it is not much documented:
in the btPersistentManifold.cpp there is an hardcoded threshold of 0.02:

Code: Select all

btScalar	gContactBreakingThreshold = btScalar(0.02);
..it must be scaled to a much lower value if you want to use small objects.
Of course, Bullet manuals tell to avoid small object sizes and to rescale the system, but in my case I had to work with small measures for many reasons, and now after this gContactBreakingThreshold modification I have no problems at all.

Alessandro Tasora

NOTE: here I am talking about how to tune Bullet for a system where all objects are equally small-sized; the case of mixed very small / very large objects is more complicated, also for tunneling & dynamical problems, as already pointed out in Bullet documentation.
SteveDH
Posts: 4
Joined: Thu Apr 29, 2010 2:12 pm

Re: Very small objects

Post by SteveDH »

easiest thing is just to scale everything up... I think there's some talk about adding a feature to bullet to do this internally but I don't think its there yet.
Post Reply