code-google-com / bullet

Automatically exported from code.google.com/p/bullet
0 stars 0 forks source link

Creating a boxshape smaller than the margin (0.04) has issues #349

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

See
http://bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=9&t=4785

"These extents are automatically subtracted by the default margin that is 
set to 4 cm. That means that any box in the range of 0 .. 4 cm will cause 
inverted dimension which most likely is not what the user want in such a 
case. One would assume that in the case of a box with very small 
dimensions, the margin would be something in the range of 0..10% of the 
smallest dimension (based on the assumption that bullet behaves "best" at 1 
m objects with 4 cm radius). 

I know that Bullet is recommended not to run with shapes that are smaller 
than 0.1 units in any dimensions but isn't this kind of behavior quite 
dangerous as it potentially could lead to people having weird bugs ending 
up with them spending countless hours trying to track them? One would think 
that such a behavior would at least be expected to appear in the comments 
regarding the class that includes this type of dependency."

Improve this, for example add an assert, comments etc.

Original issue reported on code.google.com by erwin.coumans on 2 Mar 2010 at 8:14

GoogleCodeExporter commented 9 years ago
Finally fixed here: http://code.google.com/p/bullet/source/detail?r=2431

There is an heuristic to choose a 'safeMargin' using 0.1 times a minimum 
dimension.

Original comment by erwin.coumans on 15 Sep 2011 at 6:18

GoogleCodeExporter commented 9 years ago
Just a heads up that this fix doesn't work for the byCylinderShape constructor 
because calling setSafeMargin calls setMargin which uses 
m_implicitShapeDimensions internally and it hasn't been set yet.

Moving setSafeMargin(halfExtents) to the end of the constructor seems to work 
ok.

Original comment by tibor.kl...@gmail.com on 4 Oct 2012 at 10:13

GoogleCodeExporter commented 9 years ago
Forgot to say that the same goes for btBoxShape and btBox2dShape. 
Moving after m_implicitShapeDimensions is set just means that 
m_implicitShapeDimensions will be set with the default margin first and then 
updated with the safe margin.

Original comment by tibor.kl...@gmail.com on 4 Oct 2012 at 10:18