bug:
Create btBvhTriangleMeshShape with useQuantizedAabbCompression = true, we found incrrect collision detection result frequently. If useQuantizedAabbCompression = false, everything is just perfect. But it costs much more memory!
fix:
btQuantizedBvh.h
Code: Select all
int getTriangleIndex() const
{
btAssert(isLeafNode()); // Get only the lower bits where the triangle index is stored
return (m_escapeIndexOrTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS)));
}
(~0) is recognized as negative value in gcc probaly.
Shift operators for negative value is implementation-defined and gcc compiler implements defferent shift operation against visual studio c++(vs9) compiler