Bug in btCapsuleShape::getAabb

ryanjuckett
Posts: 13
Joined: Tue Mar 11, 2008 9:04 am

Bug in btCapsuleShape::getAabb

Post by ryanjuckett »

I'm running version 2.67 and noticed that the capsule shape was returning an AABB larger than the capsule. On btCapsuleShape.h line 51 you will see:

Code: Select all

halfExtents[m_upAxis] = getRadius()*btScalar(2.0) + btScalar(0.5)*getHalfHeight();
which is resulting in a value larger than the capsule half extent. I have changed it to:

Code: Select all

halfExtents[m_upAxis] = getRadius() + getHalfHeight();
and am now getting the expected behavior.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Bug in btCapsuleShape::getAabb

Post by Erwin Coumans »

That is a good catch. Note that it only degrades performance, a larger (more conservative) AABB should be fine.

It has been fixed in subversion, and uploaded in a bug-fix release, Bullet 2.67 new.
Thanks for the help,
Erwin