Merging r49362 through r49385 from trunk into soc-2011-tomato
[blender.git] / extern / bullet2 / patches / ghost_character.patch
1 Index: extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp
2 ===================================================================
3 --- extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp      (revision 49183)
4 +++ extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp      (working copy)
5 @@ -77,6 +77,9 @@
6                 if (convexResult.m_hitCollisionObject == m_me)
7                         return btScalar(1.0);
8  
9 +               if (!convexResult.m_hitCollisionObject->hasContactResponse())
10 +                       return btScalar(1.0);
11 +
12                 btVector3 hitNormalWorld;
13                 if (normalInWorldSpace)
14                 {
15 @@ -173,7 +176,12 @@
16                 m_manifoldArray.resize(0);
17  
18                 btBroadphasePair* collisionPair = &m_ghostObject->getOverlappingPairCache()->getOverlappingPairArray()[i];
19 -               
20 +               btCollisionObject* obj0 = static_cast<btCollisionObject*>(collisionPair->m_pProxy0->m_clientObject);
21 +               btCollisionObject* obj1 = static_cast<btCollisionObject*>(collisionPair->m_pProxy1->m_clientObject);
22 +
23 +               if ((obj0 && !obj0->hasContactResponse()) || (obj1 && !obj1->hasContactResponse()))
24 +                       continue;
25 +
26                 if (collisionPair->m_algorithm)
27                         collisionPair->m_algorithm->getAllContactManifolds(m_manifoldArray);
28