favreau / bullet

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

btCapsuleShape doesn't deal with the margin consistently #446

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Some portions of the capsule code treat m_implicitShapeDimensions as including 
the margin (btCapsuleShape::setMargin for example) while others do not.

Calling setMargin(0.0f) on a capsule shape for example, will not remove the 
margin. This can be fixed by changing the constructor:

btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height) : 
btConvexInternalShape ()
{
    m_shapeType = CAPSULE_SHAPE_PROXYTYPE;
    m_upAxis = 1;
    m_implicitShapeDimensions.setValue(radius,0.5f*height,radius);
    btVector3 margin(getMargin(),getMargin(),getMargin());
    m_implicitShapeDimensions -= margin;
}

It appears that other parts of the code (like getRadius) assume that 
m_implicitShapeDimensions doesn't include the radius, so a more comprehensive 
fix may be necessary.

Original issue reported on code.google.com by mcguire....@gmail.com on 28 Oct 2010 at 9:41

GoogleCodeExporter commented 9 years ago
Issue 447 has been merged into this issue.

Original comment by erwin.coumans on 28 Oct 2010 at 11:36

GoogleCodeExporter commented 9 years ago
I vote for btCapsuleShape to be completely changed to behave like 
btSphereShape, where its entire radius is the collision margin.  If this 
presents an issue for someone, please let us know.  Thanks.

Original comment by markri...@hotmail.com on 25 Mar 2012 at 12:41

GoogleCodeExporter commented 9 years ago
We don't make such changes to Bullet 2.x anymore, as we focus on Bullet 3.x. 
We'll make sure this issue doesn't happen in Bullet 3.x.

Original comment by erwin.coumans on 10 Sep 2013 at 10:01