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:
authorMitchell Stokes <mogurijin@gmail.com>2012-07-30 07:45:15 +0400
committerMitchell Stokes <mogurijin@gmail.com>2012-07-30 07:45:15 +0400
commit977188e3736db9442bc0c31aa1844d92c5119da0 (patch)
treeceb09b272a10a392293744d6ce115ec62bc027fe /extern/bullet2
parentae483e0cd2e9cafac08b26c917687b74c6d4a661 (diff)
Fixing [#32210] "Character physics type colliding with sensor type" reported by Daniel Stokes (kupoman) by applying a patch found in this Bullet bug report: https://code.google.com/p/bullet/issues/detail?id=525
Diffstat (limited to 'extern/bullet2')
-rw-r--r--extern/bullet2/patches/ghost_character.patch28
-rw-r--r--extern/bullet2/readme.txt4
-rw-r--r--extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp10
3 files changed, 41 insertions, 1 deletions
diff --git a/extern/bullet2/patches/ghost_character.patch b/extern/bullet2/patches/ghost_character.patch
new file mode 100644
index 00000000000..d4098cb8bc2
--- /dev/null
+++ b/extern/bullet2/patches/ghost_character.patch
@@ -0,0 +1,28 @@
+Index: extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp
+===================================================================
+--- extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp (revision 49183)
++++ extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp (working copy)
+@@ -77,6 +77,9 @@
+ if (convexResult.m_hitCollisionObject == m_me)
+ return btScalar(1.0);
+
++ if (!convexResult.m_hitCollisionObject->hasContactResponse())
++ return btScalar(1.0);
++
+ btVector3 hitNormalWorld;
+ if (normalInWorldSpace)
+ {
+@@ -173,7 +176,12 @@
+ m_manifoldArray.resize(0);
+
+ btBroadphasePair* collisionPair = &m_ghostObject->getOverlappingPairCache()->getOverlappingPairArray()[i];
+-
++ btCollisionObject* obj0 = static_cast<btCollisionObject*>(collisionPair->m_pProxy0->m_clientObject);
++ btCollisionObject* obj1 = static_cast<btCollisionObject*>(collisionPair->m_pProxy1->m_clientObject);
++
++ if ((obj0 && !obj0->hasContactResponse()) || (obj1 && !obj1->hasContactResponse()))
++ continue;
++
+ if (collisionPair->m_algorithm)
+ collisionPair->m_algorithm->getAllContactManifolds(m_manifoldArray);
+
diff --git a/extern/bullet2/readme.txt b/extern/bullet2/readme.txt
index e537ac26189..343cb104c4d 100644
--- a/extern/bullet2/readme.txt
+++ b/extern/bullet2/readme.txt
@@ -13,3 +13,7 @@ Originally committed in blender svn revision: 45908.
Apply patches/make_id.patch to prevent duplicated define of MAKE_ID macro in blender
side and bullet side.
Sergey
+
+Apply patches/ghost_character.path to prevent characters from colliding with ghost objects.
+Mitchell
+
diff --git a/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp b/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp
index f733dc0cd22..5fd4ee28511 100644
--- a/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp
+++ b/extern/bullet2/src/BulletDynamics/Character/btKinematicCharacterController.cpp
@@ -77,6 +77,9 @@ public:
if (convexResult.m_hitCollisionObject == m_me)
return btScalar(1.0);
+ if (!convexResult.m_hitCollisionObject->hasContactResponse())
+ return btScalar(1.0);
+
btVector3 hitNormalWorld;
if (normalInWorldSpace)
{
@@ -173,7 +176,12 @@ bool btKinematicCharacterController::recoverFromPenetration ( btCollisionWorld*
m_manifoldArray.resize(0);
btBroadphasePair* collisionPair = &m_ghostObject->getOverlappingPairCache()->getOverlappingPairArray()[i];
-
+ btCollisionObject* obj0 = static_cast<btCollisionObject*>(collisionPair->m_pProxy0->m_clientObject);
+ btCollisionObject* obj1 = static_cast<btCollisionObject*>(collisionPair->m_pProxy1->m_clientObject);
+
+ if ((obj0 && !obj0->hasContactResponse()) || (obj1 && !obj1->hasContactResponse()))
+ continue;
+
if (collisionPair->m_algorithm)
collisionPair->m_algorithm->getAllContactManifolds(m_manifoldArray);