favreau / bullet

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

btTransformAabb validity? #549

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I just wanted to draw attention to the btAabbUtil2.h: btTransformAabb() 
computations... if the transform involves a rotation, then the resulting aabb 
will not include the same volume as the original aabb.  As a particularly 
degenerate case, consider if the rotation brings the extent vector into 
alignment with one of the coordinate axes: then the aabb will have zero 
dimension on the other two axes.

If the rotations are strictly multiples of 90° rotations about the axes, then 
the current implementation is OK, but in general it should really be growing 
the resulting aabb by taking the max of each of the aabb corners' rotation. (in 
practice, if taking the max of abs of the points, it's enough to do half of the 
corners, i.e. one face, due to symmetry)

Original issue reported on code.google.com by ejtt...@gmail.com on 18 Sep 2011 at 3:21

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
The whole point of the btTransformAabb computations are to take rotation into 
account.

This method is being used by several collision shapes, including btBoxShape:

void btBoxShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& 
aabbMax) const
{
    btTransformAabb(getHalfExtentsWithoutMargin(),getMargin(),t,aabbMin,aabbMax);
}

If there would be a failure in the btTransformAabb, the broadphase collision 
would fail and collisions would be missed, which would be very obvious. See 
attached demo to visualize the aabb generated by btTransformAabb for arbitrary 
rotations (not just 90 degrees).

Can you explain more in detail why you think there is a problem, and create a 
reproduction case that shows the issue?

Original comment by erwin.coumans on 19 Sep 2011 at 7:27

Attachments:

GoogleCodeExporter commented 9 years ago
Ohhh, I missed the absolute() call on the basis matrix.  That's a cute trick, 
will have to remember that!

Nevermind! :)

Original comment by ejtt...@gmail.com on 19 Sep 2011 at 7:55

GoogleCodeExporter commented 9 years ago
no prob, I got the idea from Gino van den Bergen ( http://dtecta.com )

Original comment by erwin.coumans on 19 Sep 2011 at 10:08