diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2009-01-14 01:21:04 +0300 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2009-01-14 01:21:04 +0300 |
commit | 7f5073729f5fafe4118edb18ac10abbab66bf0c7 (patch) | |
tree | c12a2f59f556de7bb96b761eccf264d709342639 | |
parent | b71bc3a2f31234583a78cbd0ee06ba084f158ed7 (diff) |
Bullet bug fix: bad pointer in btCompoundShape::addChildShape() - patch submited to Bullet forum. This bug fix is needed in preparation of the setparent coumpound shape patch.
-rw-r--r-- | extern/bullet2/src/BulletCollision/CollisionShapes/btCompoundShape.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btCompoundShape.cpp b/extern/bullet2/src/BulletCollision/CollisionShapes/btCompoundShape.cpp index f08b810eadb..997361a5069 100644 --- a/extern/bullet2/src/BulletCollision/CollisionShapes/btCompoundShape.cpp +++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btCompoundShape.cpp @@ -49,8 +49,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; shape->getAabb(localTransform,localAabbMin,localAabbMax); @@ -69,10 +67,11 @@ 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::removeChildShapeByIndex(int childShapeIndex) |