diff options
author | Julian Eisel <julian@blender.org> | 2020-08-07 14:04:31 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-08-07 14:04:31 +0300 |
commit | 0d2d4a6d4a75ac38c41f872c88255eab70e88ab7 (patch) | |
tree | b7a7518af86dddba48e05a98b3c2be55e8804721 /extern/bullet2/patches/btPolyhedralConvexShape_Inertia_fix.patch | |
parent | 9b416c66fb714bdfd15a481489dbf650d0f389ea (diff) | |
parent | cfc6f9eb18e701f5be601b95c45004e8cf7fbc81 (diff) |
Merge branch 'master' into temp-ui-button-type-refactortemp-ui-button-type-refactor
Diffstat (limited to 'extern/bullet2/patches/btPolyhedralConvexShape_Inertia_fix.patch')
-rw-r--r-- | extern/bullet2/patches/btPolyhedralConvexShape_Inertia_fix.patch | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/extern/bullet2/patches/btPolyhedralConvexShape_Inertia_fix.patch b/extern/bullet2/patches/btPolyhedralConvexShape_Inertia_fix.patch new file mode 100644 index 00000000000..abafb5855dd --- /dev/null +++ b/extern/bullet2/patches/btPolyhedralConvexShape_Inertia_fix.patch @@ -0,0 +1,41 @@ +diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp b/extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp +index 9095c592d87..b831e20c2f9 100644 +--- a/extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp ++++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp +@@ -406,17 +406,17 @@ void btPolyhedralConvexShape::calculateLocalInertia(btScalar mass,btVector3& ine + #ifndef __SPU__ + //not yet, return box inertia + +- btScalar margin = getMargin(); ++ //btScalar margin = getMargin(); + + btTransform ident; + ident.setIdentity(); + btVector3 aabbMin,aabbMax; +- getAabb(ident,aabbMin,aabbMax); ++ getAabb(ident,aabbMin,aabbMax); // This already contains the margin + btVector3 halfExtents = (aabbMax-aabbMin)*btScalar(0.5); + +- btScalar lx=btScalar(2.)*(halfExtents.x()+margin); +- btScalar ly=btScalar(2.)*(halfExtents.y()+margin); +- btScalar lz=btScalar(2.)*(halfExtents.z()+margin); ++ btScalar lx=btScalar(2.)*(halfExtents.x()); ++ btScalar ly=btScalar(2.)*(halfExtents.y()); ++ btScalar lz=btScalar(2.)*(halfExtents.z()); + const btScalar x2 = lx*lx; + const btScalar y2 = ly*ly; + const btScalar z2 = lz*lz; +@@ -476,10 +476,10 @@ void btPolyhedralConvexAabbCachingShape::recalcLocalAabb() + + for ( int i = 0; i < 3; ++i ) + { +- m_localAabbMax[i] = _supporting[i][i] + m_collisionMargin; +- m_localAabbMin[i] = _supporting[i + 3][i] - m_collisionMargin; ++ m_localAabbMax[i] = _supporting[i][i]; ++ m_localAabbMin[i] = _supporting[i + 3][i]; + } +- ++ + #else + + for (int i=0;i<3;i++) |