From bb379bd84c69b058b21d83762320730817ad7d74 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Tue, 10 Sep 2013 23:34:23 +0000 Subject: [PATCH] fix one of the btCompoundShape scaling issues, this fix breaks the API (need to add warning at the next release) fixes https://code.google.com/p/bullet/issues/detail?id=374 and https://code.google.com/p/bullet/issues/detail?id=444 --- src/BulletCollision/CollisionShapes/btCompoundShape.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/BulletCollision/CollisionShapes/btCompoundShape.cpp b/src/BulletCollision/CollisionShapes/btCompoundShape.cpp index 12f422f19..0aa75f2bf 100644 --- a/src/BulletCollision/CollisionShapes/btCompoundShape.cpp +++ b/src/BulletCollision/CollisionShapes/btCompoundShape.cpp @@ -273,6 +273,8 @@ void btCompoundShape::calculatePrincipalAxisTransform(btScalar* masses, btTransf + + void btCompoundShape::setLocalScaling(const btVector3& scaling) { @@ -283,7 +285,7 @@ void btCompoundShape::setLocalScaling(const btVector3& scaling) // childScale = childScale * (childTrans.getBasis() * scaling); childScale = childScale * scaling / m_localScaling; m_children[i].m_childShape->setLocalScaling(childScale); - childTrans.setOrigin((childTrans.getOrigin())*scaling); + childTrans.setOrigin((childTrans.getOrigin()) * scaling / m_localScaling); updateChildTransform(i, childTrans,false); }