Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergej Reich <sergej.reich@googlemail.com>2012-06-08 20:13:01 +0400
committerSergej Reich <sergej.reich@googlemail.com>2012-06-08 20:13:01 +0400
commit82d3d9f2ba47bbf2f868b5a970d1fe149eba13e2 (patch)
treee99d947080f8e787059d86500f01dd6c1ad616e4 /extern/bullet2/patches
parent221a7878223e983372ba830e4ca1a17067abf2ba (diff)
Update Bullet to version 2.80 (bullet svn revision 2537)
Remove Jamfiles and other unused files that stuck around during previous updates. Add patches for local changes to the patches directory. Update readme.txt, it had outdated infromation.
Diffstat (limited to 'extern/bullet2/patches')
-rw-r--r--extern/bullet2/patches/ghost_softbody.patch42
-rw-r--r--extern/bullet2/patches/pvs_warning_fixes.patch31
2 files changed, 73 insertions, 0 deletions
diff --git a/extern/bullet2/patches/ghost_softbody.patch b/extern/bullet2/patches/ghost_softbody.patch
new file mode 100644
index 00000000000..b150d57040d
--- /dev/null
+++ b/extern/bullet2/patches/ghost_softbody.patch
@@ -0,0 +1,42 @@
+Index: extern/bullet2/src/BulletSoftBody/btSoftBody.cpp
+===================================================================
+--- extern/bullet2/src/BulletSoftBody/btSoftBody.cpp (Revision 43904)
++++ extern/bullet2/src/BulletSoftBody/btSoftBody.cpp (Revision 43905)
+@@ -2780,21 +2780,23 @@
+ {
+ const RContact& c = psb->m_rcontacts[i];
+ const sCti& cti = c.m_cti;
+- btRigidBody* tmpRigid = btRigidBody::upcast(cti.m_colObj);
+
+- const btVector3 va = tmpRigid ? tmpRigid->getVelocityInLocalPoint(c.m_c1)*dt : btVector3(0,0,0);
+- const btVector3 vb = c.m_node->m_x-c.m_node->m_q;
+- const btVector3 vr = vb-va;
+- const btScalar dn = btDot(vr, cti.m_normal);
+- if(dn<=SIMD_EPSILON)
+- {
+- const btScalar dp = btMin( (btDot(c.m_node->m_x, cti.m_normal) + cti.m_offset), mrg );
+- const btVector3 fv = vr - (cti.m_normal * dn);
+- // c0 is the impulse matrix, c3 is 1 - the friction coefficient or 0, c4 is the contact hardness coefficient
+- const btVector3 impulse = c.m_c0 * ( (vr - (fv * c.m_c3) + (cti.m_normal * (dp * c.m_c4))) * kst );
+- c.m_node->m_x -= impulse * c.m_c2;
+- if (tmpRigid)
+- tmpRigid->applyImpulse(impulse,c.m_c1);
++ if (cti.m_colObj->hasContactResponse()) {
++ btRigidBody* tmpRigid = btRigidBody::upcast(cti.m_colObj);
++ const btVector3 va = tmpRigid ? tmpRigid->getVelocityInLocalPoint(c.m_c1)*dt : btVector3(0,0,0);
++ const btVector3 vb = c.m_node->m_x-c.m_node->m_q;
++ const btVector3 vr = vb-va;
++ const btScalar dn = btDot(vr, cti.m_normal);
++ if(dn<=SIMD_EPSILON)
++ {
++ const btScalar dp = btMin( (btDot(c.m_node->m_x, cti.m_normal) + cti.m_offset), mrg );
++ const btVector3 fv = vr - (cti.m_normal * dn);
++ // c0 is the impulse matrix, c3 is 1 - the friction coefficient or 0, c4 is the contact hardness coefficient
++ const btVector3 impulse = c.m_c0 * ( (vr - (fv * c.m_c3) + (cti.m_normal * (dp * c.m_c4))) * kst );
++ c.m_node->m_x -= impulse * c.m_c2;
++ if (tmpRigid)
++ tmpRigid->applyImpulse(impulse,c.m_c1);
++ }
+ }
+ }
+ }
diff --git a/extern/bullet2/patches/pvs_warning_fixes.patch b/extern/bullet2/patches/pvs_warning_fixes.patch
new file mode 100644
index 00000000000..5a3fe140454
--- /dev/null
+++ b/extern/bullet2/patches/pvs_warning_fixes.patch
@@ -0,0 +1,31 @@
+Index: extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h
+===================================================================
+--- extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h (Revision 45907)
++++ extern/bullet2/src/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.h (Revision 45908)
+@@ -45,7 +45,9 @@
+ int getTriangleIndex() const
+ {
+ // Get only the lower bits where the triangle index is stored
+- return (m_PartIdTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS)));
++ unsigned int x = 0;
++ unsigned int y = (~(x&0))<<(31-MAX_NUM_PARTS_IN_BITS);
++ return (m_PartIdTriangleIndex&~(y));
+ }
+ int getPartId() const
+ {
+Index: extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h
+===================================================================
+--- extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h (Revision 45907)
++++ extern/bullet2/src/BulletCollision/BroadphaseCollision/btQuantizedBvh.h (Revision 45908)
+@@ -78,8 +78,10 @@
+ int getTriangleIndex() const
+ {
+ btAssert(isLeafNode());
++ unsigned int x=0;
++ unsigned int y = (~(x&0))<<(31-MAX_NUM_PARTS_IN_BITS);
+ // Get only the lower bits where the triangle index is stored
+- return (m_escapeIndexOrTriangleIndex&~((~0)<<(31-MAX_NUM_PARTS_IN_BITS)));
++ return (m_escapeIndexOrTriangleIndex&~(y));
+ }
+ int getPartId() const
+ {