Commit: 05eebf49d3c3af47bf157207b82cf559ac1fe274
Author: Sergej Reich
Date:   Thu Dec 26 12:41:52 2013 +0100
https://developer.blender.org/rB05eebf49d3c3af47bf157207b82cf559ac1fe274

Bullet: Update to svn r2719

Fixes part of T37905, fixed constraint didn't work correctly.

===================================================================

M       
extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
M       
extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
M       
extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
M       
extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp
M       
extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.h
M       extern/bullet2/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h
M       extern/bullet2/src/BulletDynamics/ConstraintSolver/btFixedConstraint.cpp
M       extern/bullet2/src/BulletDynamics/ConstraintSolver/btFixedConstraint.h
M       
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp
M       
extern/bullet2/src/BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.h
M       extern/bullet2/src/BulletDynamics/MLCPSolvers/btMLCPSolver.cpp
M       extern/bullet2/src/BulletDynamics/MLCPSolvers/btMLCPSolver.h
M       
extern/bullet2/src/BulletDynamics/MLCPSolvers/btSolveProjectedGaussSeidel.h
M       extern/bullet2/src/BulletSoftBody/btSoftBody.cpp
M       extern/bullet2/src/LinearMath/btMatrixX.h
M       extern/bullet2/src/LinearMath/btScalar.h
M       extern/bullet2/src/LinearMath/btVector3.cpp
M       extern/bullet2/src/LinearMath/btVector3.h

===================================================================

diff --git 
a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp 
b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
index 093c6f9..d739a2a 100644
--- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
+++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionWorld.cpp
@@ -770,7 +770,7 @@ void        
btCollisionWorld::objectQuerySingleInternal(const btConvexShape* castShape,
                                                                        
hitPointLocal,
                                                                        
hitFraction);
 
-                                                               bool    
normalInWorldSpace = false;
+                                                               bool    
normalInWorldSpace = true;
 
                                                                return 
m_resultCallback->addSingleResult(convexResult,normalInWorldSpace);
                                                        }
diff --git 
a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
 
b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
index 991841e..286e6c3 100644
--- 
a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
+++ 
b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp
@@ -229,6 +229,7 @@ void btCompoundCollisionAlgorithm::processCollision (const 
btCollisionObjectWrap
                removeChildAlgorithms();
                
                preallocateChildAlgorithms(body0Wrap,body1Wrap);
+               m_compoundShapeRevision = compoundShape->getUpdateRevision();
        }
 
 
diff --git 
a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
 
b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
index 5367514..7d792c1 100644
--- 
a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
+++ 
b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.h
@@ -36,6 +36,7 @@ extern btShapePairCallback gCompoundChildShapePairCallback;
 /// btCompoundCollisionAlgorithm  supports collision between 
CompoundCollisionShapes and other collision shapes
 class btCompoundCollisionAlgorithm  : public btActivatingCollisionAlgorithm
 {
+protected:
        btAlignedObjectArray<btCollisionAlgorithm*> m_childCollisionAlgorithms;
        bool m_isSwapped;
 
diff --git 
a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp
 
b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp
index a52dd34..95780fb 100644
--- 
a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp
+++ 
b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp
@@ -27,10 +27,8 @@ subject to the following restrictions:
 btShapePairCallback gCompoundCompoundChildShapePairCallback = 0;
 
 btCompoundCompoundCollisionAlgorithm::btCompoundCompoundCollisionAlgorithm( 
const btCollisionAlgorithmConstructionInfo& ci,const btCollisionObjectWrapper* 
body0Wrap,const btCollisionObjectWrapper* body1Wrap,bool isSwapped)
-:btActivatingCollisionAlgorithm(ci,body0Wrap,body1Wrap),
-m_sharedManifold(ci.m_manifold)
+:btCompoundCollisionAlgorithm(ci,body0Wrap,body1Wrap,isSwapped)
 {
-       m_ownsManifold = false;
 
        void* ptr = btAlignedAlloc(sizeof(btHashedSimplePairCache),16);
        m_childCollisionAlgorithmCache= new(ptr) btHashedSimplePairCache();
@@ -292,12 +290,21 @@ void 
btCompoundCompoundCollisionAlgorithm::processCollision (const btCollisionOb
        const btCompoundShape* compoundShape0 = static_cast<const 
btCompoundShape*>(col0ObjWrap->getCollisionShape());
        const btCompoundShape* compoundShape1 = static_cast<const 
btCompoundShape*>(col1ObjWrap->getCollisionShape());
 
+       const btDbvt* tree0 = compoundShape0->getDynamicAabbTree();
+       const btDbvt* tree1 = compoundShape1->getDynamicAabbTree();
+       if (!tree0 || !tree1)
+       {
+               return 
btCompoundCollisionAlgorithm::processCollision(body0Wrap,body1Wrap,dispatchInfo,resultOut);
+       }
        ///btCompoundShape might have changed:
        ////make sure the internal child collision algorithm caches are still 
valid
        if ((compoundShape0->getUpdateRevision() != m_compoundShapeRevision0) 
|| (compoundShape1->getUpdateRevision() != m_compoundShapeRevision1))
        {
                ///clear all
                removeChildAlgorithms();
+               m_compoundShapeRevision0 = compoundShape0->getUpdateRevision();
+               m_compoundShapeRevision1 = compoundShape1->getUpdateRevision();
+
        }
 
 
@@ -329,8 +336,7 @@ void btCompoundCompoundCollisionAlgorithm::processCollision 
(const btCollisionOb
        }
 
 
-       const btDbvt* tree0 = compoundShape0->getDynamicAabbTree();
-       const btDbvt* tree1 = compoundShape1->getDynamicAabbTree();
+       
 
        btCompoundCompoundLeafCallback 
callback(col0ObjWrap,col1ObjWrap,this->m_dispatcher,dispatchInfo,resultOut,this->m_childCollisionAlgorithmCache,m_sharedManifold);
 
diff --git 
a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.h
 
b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.h
index 7e2d7ad..06a762f 100644
--- 
a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.h
+++ 
b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.h
@@ -17,6 +17,8 @@ subject to the following restrictions:
 #ifndef BT_COMPOUND_COMPOUND_COLLISION_ALGORITHM_H
 #define BT_COMPOUND_COMPOUND_COLLISION_ALGORITHM_H
 
+#include "btCompoundCollisionAlgorithm.h"
+
 #include "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.h"
 #include "BulletCollision/BroadphaseCollision/btDispatcher.h"
 #include "BulletCollision/BroadphaseCollision/btBroadphaseInterface.h"
@@ -35,15 +37,12 @@ typedef bool (*btShapePairCallback)(const btCollisionShape* 
pShape0, const btCol
 extern btShapePairCallback gCompoundCompoundChildShapePairCallback;
 
 /// btCompoundCompoundCollisionAlgorithm  supports collision between two 
btCompoundCollisionShape shapes
-class btCompoundCompoundCollisionAlgorithm  : public 
btActivatingCollisionAlgorithm
+class btCompoundCompoundCollisionAlgorithm  : public 
btCompoundCollisionAlgorithm
 {
 
        class btHashedSimplePairCache*  m_childCollisionAlgorithmCache;
        btSimplePairArray m_removePairs;
 
-       class btPersistentManifold*     m_sharedManifold;
-       bool                                    m_ownsManifold;
-
 
        int     m_compoundShapeRevision0;//to keep track of changes, so that 
childAlgorithm array can be updated
        int     m_compoundShapeRevision1;
diff --git 
a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h 
b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h
index 1ba1cd1..890afe6 100644
--- a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h
+++ b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btConstraintSolver.h
@@ -33,7 +33,8 @@ class btDispatcher;
 enum btConstraintSolverType
 {
        BT_SEQUENTIAL_IMPULSE_SOLVER=1,
-       BT_MLCP_SOLVER=2
+       BT_MLCP_SOLVER=2,
+       BT_NNCG_SOLVER=4
 };
 
 class btConstraintSolver
diff --git 
a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btFixedConstraint.cpp 
b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btFixedConstraint.cpp
index f93a328..3428e0b 100644
--- a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btFixedConstraint.cpp
+++ b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btFixedConstraint.cpp
@@ -23,9 +23,8 @@ subject to the following restrictions:
 btFixedConstraint::btFixedConstraint(btRigidBody& rbA,btRigidBody& rbB, const 
btTransform& frameInA,const btTransform& frameInB)
 :btTypedConstraint(FIXED_CONSTRAINT_TYPE,rbA,rbB)
 {
-       m_pivotInA = frameInA.getOrigin();
-       m_pivotInB = frameInB.getOrigin();
-       m_relTargetAB = frameInA.getRotation()*frameInB.getRotation().inverse();
+       m_frameInA = frameInA;
+       m_frameInB = frameInB;
 
 }
 
@@ -37,14 +36,16 @@ btFixedConstraint::~btFixedConstraint ()
 void btFixedConstraint::getInfo1 (btConstraintInfo1* info)
 {
        info->m_numConstraintRows = 6;
-       info->nub = 6;
+       info->nub = 0;
 }
 
 void btFixedConstraint::getInfo2 (btConstraintInfo2* info)
 {
        //fix the 3 linear degrees of freedom
 
-       
+       const btTransform& transA = m_rbA.getCenterOfMassTransform();
+       const btTransform& transB = m_rbB.getCenterOfMassTransform();
+
        const btVector3& worldPosA = 
m_rbA.getCenterOfMassTransform().getOrigin();
        const btMatrix3x3& worldOrnA = 
m_rbA.getCenterOfMassTransform().getBasis();
        const btVector3& worldPosB= 
m_rbB.getCenterOfMassTransform().getOrigin();
@@ -55,15 +56,15 @@ void btFixedConstraint::getInfo2 (btConstraintInfo2* info)
        info->m_J1linearAxis[info->rowskip+1] = 1;
        info->m_J1linearAxis[2*info->rowskip+2] = 1;
 
-       btVector3 a1 = worldOrnA*m_pivotInA;
-       {
+       btVector3 a1 = worldOrnA * m_frameInA.getOrigin();
+    {
                btVector3* angular0 = (btVector3*)(info->m_J1angularAxis);
                btVector3* angular1 = 
(btVector3*)(info->m_J1angularAxis+info->rowskip);
                btVector3* angular2 = 
(btVector3*)(info->m_J1angularAxis+2*info->rowskip);
                btVector3 a1neg = -a1;
                a1neg.getSkewSymmetricMatrix(angular0,angular1,angular2);
        }
-    
+
        if (info->m_J2linearAxis)
        {
                info->m_J2linearAxis[0] = -1;
@@ -71,10 +72,8 @@ void btFixedConstraint::getInfo2 (btConstraintInfo2* info)
                info->m_J2linearAxis[2*info->rowskip+2] = -1;
        }
        
-       btVector3 a2 = worldOrnB*m_pivotInB;
-   
-       {
-       //      btVector3 a2n = -a2;
+       btVector3 a2 = worldOrnB*m_frameInB.getOrigin();
+   {
                btVector3* angular0 = (btVector3*)(info->m_J2angularAxis);
                btVector3* angular1 = 
(btVector3*)(info->m_J2angularAxis+info->rowskip);
                btVector3* angular2 = 
(btVector3*)(info->m_J2angularAxis+2*info->rowskip);
@@ -88,42 +87,100 @@ void btFixedConstraint::getInfo2 (btConstraintInfo2* info)
     int j;
        for (j=0; j<3; j++)
     {
-
-
-
         info->m_constraintError[j*info->rowskip] = linearError[j];
                
//printf("info->m_constraintError[%d]=%f\n",j,info->m_constraintError[j]);
     }
 
-               //fix the 3 angular degrees of freedom
-
-       int start_row = 3;
-       int s = info->rowskip;
-    int start_index = start_row * s;
-
-    // 3 rows to make body rotations equal
-       info->m_J1angularAxis[start_index] = 1;
-    info->m_J1angularAxis[start_index + s + 1] = 1;
-    info->m_J1angularAxis[start_index + s*2+2] = 1;
-    if ( info->m_J2angularAxis)
-    {
-        info->m_J2angularAxis[start_index] = -1;
-        info->m_J2angularAxis[start_index + s+1] = -1;
-        info->m_J2angularAxis[start_index + s*2+2] = -1;
-    }
-
-    

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to