lianlab / bullet

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

btMinkowskiSumShape #194

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I think that btMinkowskiSumShape::localGetSupportingVertexWithoutMargin is
not evaluated correctly.

// Current:
btVector3 btMinkowskiSumShape::localGetSupportingVertexWithoutMargin(const
btVector3& vec)const
{
    btVector3 supVertexA =
m_transA(m_shapeA->localGetSupportingVertexWithoutMargin(-vec*m_transA.getBasis(
)));
    btVector3 supVertexB =
m_transB(m_shapeB->localGetSupportingVertexWithoutMargin(vec*m_transB.getBasis()
));
    return  supVertexA - supVertexB;
}

// Should be:
btVector3 btMinkowskiSumShape::localGetSupportingVertexWithoutMargin(const
btVector3& vec)const
{
    btVector3 supVertexA =
m_transA(m_shapeA->localGetSupportingVertexWithoutMargin(vec*m_transA.getBasis()
));
    btVector3 supVertexB =
m_transB(m_shapeB->localGetSupportingVertexWithoutMargin(-vec*m_transB.getBasis(
)));
    return  supVertexA - supVertexB;
}

What is the expected output? What do you see instead?

Using the example of:
    btSphereShape mysphere(1);
    btBoxShape mybox(btVector3(1,1,1));
    btMinkowskiSumShape* shape = new btMinkowskiSumShape(&mybox,&mysphere);

Should give a box with rounded corners.

What version of the product are you using? On what operating system?

Bullet 2.74-sp1 on Win32/Wii/PS3/Xbox360

Please provide any additional information below.

I've attached a modified copy of the Raytracer example that creates a
Minkowski sum shape and renders it.

Original issue reported on code.google.com by kester.m...@gmail.com on 10 Feb 2009 at 9:55

Attachments:

GoogleCodeExporter commented 9 years ago
Good point, it has been fixed in latest trunk:
http://code.google.com/p/bullet/source/detail?r=1622

Thanks for report and the fix,

Original comment by erwin.coumans on 11 Feb 2009 at 12:12