Box2D has b2Settings header file where you can tweak all the settings for the engine.
This wold be great if Bullet would be have such file.
Where all this hard coded limits like gContactBreakingThreshold, "epsilons" like btScalar(0.0001) could be tweaked.
I think "epsilon" like 0.0001 is not really well on both single and double precession , or I am wrong with this?
Good idea. Yeah, it would be convenient, but it is not recommended to change most settings by end users.
There would be at least 2 sets of settings, btCollisionSettings and btDynamicsSettings, because in Bullet those systems are separate: you can use the collision detection without the dynamics.
Warning: most of the epsilons and other values need a very long description.
I probably stick with just the header file, not the .cpp file, so leaving the variables in the original place. To avoids introducing dependencies to the btCollisionSettings file, the internal SDK won't need to included it.
We need to carefully check this on a case-by-case basis, not a global find and replace of course. Ideally, most epsilons use the predefined constant from LinearMath/btScalar.h:
SIMD_EPSILON
This is defined with different precision when double precision (BT_USE_DOUBLE_PRECISION) is used.
Unless there are good reasons, we should probably just stick with this SIMD_EPSILON in most cases. Note that it is better to use scaled epsilons. However also this is a more subtle. For example, in Bullet GJK, the collision checks are done in relative space (in the middle of both objects) to improve accuracy.
Another cleanup would be to replace all the hardcoded 1e30 by SIMD_INFINITY. Then the SIMD_EPSILON should be rename BT_EPSILON for more consistent naming conventions.
Do you have a specific file/line number of an epsilon that concerns you?
Thanks,
Erwin