Fix in btCompoundShape that can cause removeChildShapeByIndex to crash.
Thanks to Benoit for the report and proposed fix: http://code.google.com/p/bullet/issues/detail?id=171
This commit is contained in:
@@ -56,7 +56,6 @@ void btCompoundShape::addChildShape(const btTransform& localTransform,btCollisio
|
||||
child.m_childShapeType = shape->getShapeType();
|
||||
child.m_childMargin = shape->getMargin();
|
||||
|
||||
m_children.push_back(child);
|
||||
|
||||
//extend the local aabbMin/aabbMax
|
||||
btVector3 localAabbMin,localAabbMax;
|
||||
@@ -76,10 +75,12 @@ void btCompoundShape::addChildShape(const btTransform& localTransform,btCollisio
|
||||
if (m_dynamicAabbTree)
|
||||
{
|
||||
const btDbvtVolume bounds=btDbvtVolume::FromMM(localAabbMin,localAabbMax);
|
||||
int index = m_children.size()-1;
|
||||
int index = m_children.size();
|
||||
child.m_node = m_dynamicAabbTree->insert(bounds,(void*)index);
|
||||
}
|
||||
|
||||
m_children.push_back(child);
|
||||
|
||||
}
|
||||
|
||||
void btCompoundShape::updateChildTransform(int childIndex, const btTransform& newChildTransform)
|
||||
|
||||
Reference in New Issue
Block a user