Inconsistent/inaccurate AABB calculation for small shapes
Posted: Sun Sep 27, 2015 2:48 pm
Hi,
Yesterday I posted about scaling my simulation down to allow for larger masses ( http://www.bulletphysics.org/Bullet/php ... =9&t=10836 ).
I noticed that as the scale factor went down, the simulation behaved differently, which is to be expected. However, if the scale factor is 1e-3 or lower, then one of my objects (let's call it the ship) hits an invisible wall, which I presume is an inaccurate placement of another object's mesh (let's call it the planet).
Indeed, once I enabled debug drawing, I noticed that this "wall" was very close to the border of the planet's AABB, which was far from being a "decent" AABB for the planet's mesh, since it was much larger than the mesh. The ship's AABB was nowhere to be seen.
I made the scale factor 1 again and saw that everything was back to normal, and as I turned it back down (by negative powers of 10), it seemed that the "inaccuracy" of the AABBs was climbing as the scale factor was dropping.
This is especially interesting considering that the wireframe drawn by my Bullet debug drawer was exactly how it should be.
I also get the "Overflow in AABB, object removed from simulation" error once in a while, seemingly randomly, but I'm not sure if that's related.
Here is a video of the ship getting stuck on the AABB wall with a scale factor of 1e-3: http://f.cxx.ninja/Videos/space_201509271805.webm
Here is what it should look like, with a scale factor of 1e-2: http://f.cxx.ninja/Videos/space_201509271809.webm
Here is a labelled photo album of the different AABBs at different scale factors: http://imgur.com/a/Dx0ZT
Scaling is done by multiplying the vertex data (and mass etc) by the scale factor.
Is there a way to fix this? Is this expected behavior?
Any help is greatly appreciated,
Cheers
EDIT: This still happens with a double-precision build of Bullet.
Yesterday I posted about scaling my simulation down to allow for larger masses ( http://www.bulletphysics.org/Bullet/php ... =9&t=10836 ).
I noticed that as the scale factor went down, the simulation behaved differently, which is to be expected. However, if the scale factor is 1e-3 or lower, then one of my objects (let's call it the ship) hits an invisible wall, which I presume is an inaccurate placement of another object's mesh (let's call it the planet).
Indeed, once I enabled debug drawing, I noticed that this "wall" was very close to the border of the planet's AABB, which was far from being a "decent" AABB for the planet's mesh, since it was much larger than the mesh. The ship's AABB was nowhere to be seen.
I made the scale factor 1 again and saw that everything was back to normal, and as I turned it back down (by negative powers of 10), it seemed that the "inaccuracy" of the AABBs was climbing as the scale factor was dropping.
This is especially interesting considering that the wireframe drawn by my Bullet debug drawer was exactly how it should be.
I also get the "Overflow in AABB, object removed from simulation" error once in a while, seemingly randomly, but I'm not sure if that's related.
Here is a video of the ship getting stuck on the AABB wall with a scale factor of 1e-3: http://f.cxx.ninja/Videos/space_201509271805.webm
Here is what it should look like, with a scale factor of 1e-2: http://f.cxx.ninja/Videos/space_201509271809.webm
Here is a labelled photo album of the different AABBs at different scale factors: http://imgur.com/a/Dx0ZT
Scaling is done by multiplying the vertex data (and mass etc) by the scale factor.
Is there a way to fix this? Is this expected behavior?
Any help is greatly appreciated,
Cheers
EDIT: This still happens with a double-precision build of Bullet.