diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-11-13 00:05:10 +0300 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-11-13 00:05:10 +0300 |
commit | 3a1b7ece402001f2f93669a7b36c32f5e7827bab (patch) | |
tree | a91e600407b0709922b7df3fa2a53f380cf7eb76 /extern/bullet2/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp | |
parent | 22d97b2e346e3cb3fc38704a0460e2dd4d9a0abb (diff) |
updating Bullet 2.x with latest changes. The integration + C-API will follow at some stage.
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp')
-rw-r--r-- | extern/bullet2/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp b/extern/bullet2/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp index aaadb82eb4b..fde4d95da14 100644 --- a/extern/bullet2/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp +++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btMultiSphereShape.cpp @@ -20,17 +20,17 @@ subject to the following restrictions: btMultiSphereShape::btMultiSphereShape (const btVector3& inertiaHalfExtents,const btVector3* positions,const btScalar* radi,int numSpheres) :m_inertiaHalfExtents(inertiaHalfExtents) { - m_minRadius = 1e30f; + float startMargin = 1e30f; m_numSpheres = numSpheres; for (int i=0;i<m_numSpheres;i++) { m_localPositions[i] = positions[i]; m_radi[i] = radi[i]; - if (radi[i] < m_minRadius) - m_minRadius = radi[i]; + if (radi[i] < startMargin) + startMargin = radi[i]; } - setMargin(m_minRadius); + setMargin(startMargin); } @@ -64,7 +64,7 @@ btMultiSphereShape::btMultiSphereShape (const btVector3& inertiaHalfExtents,cons for (i=0;i<m_numSpheres;i++) { - vtx = (*pos) +vec*((*rad)-m_minRadius); + vtx = (*pos) +vec*m_localScaling*(*rad) - vec * getMargin(); pos++; rad++; newDot = vec.dot(vtx); @@ -96,7 +96,7 @@ btMultiSphereShape::btMultiSphereShape (const btVector3& inertiaHalfExtents,cons for (int i=0;i<m_numSpheres;i++) { - vtx = (*pos) +vec*((*rad)-m_minRadius); + vtx = (*pos) +vec*m_localScaling*(*rad) - vec * getMargin(); pos++; rad++; newDot = vec.dot(vtx); |