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
path: root/extern
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2008-10-12 00:19:04 +0400
committerErwin Coumans <blender@erwincoumans.com>2008-10-12 00:19:04 +0400
commit3cac11a3a2e61555c48c559f9caa61b1787e9ddb (patch)
treefb6d296fcfb5a43796b3e3ac7bf55bac6092dd73 /extern
parentb79063bd572df28aa91a4079cc736b3a83e52363 (diff)
Last (hopefully) soft body fixes:
Enable soft body collision clusters by default. Add option to 'disable collision' button between soft body and rigid body connected by constraint (option was already available between two rigid bodies)
Diffstat (limited to 'extern')
-rw-r--r--extern/bullet2/src/BulletSoftBody/btSoftBody.cpp10
-rw-r--r--extern/bullet2/src/BulletSoftBody/btSoftBody.h4
-rw-r--r--extern/bullet2/src/BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp5
3 files changed, 16 insertions, 3 deletions
diff --git a/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp b/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp
index 1604167b6ef..1ec668c9c78 100644
--- a/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp
+++ b/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp
@@ -306,8 +306,16 @@ void btSoftBody::appendFace(int node0,int node1,int node2,Material* mat)
}
//
-void btSoftBody::appendAnchor(int node,btRigidBody* body)
+void btSoftBody::appendAnchor(int node,btRigidBody* body,bool disableCollisionWithBody=false)
{
+ if (disableCollisionWithBody)
+ {
+ if (m_collisionDisabledObjects.findLinearSearch(body)==m_collisionDisabledObjects.size())
+ {
+ m_collisionDisabledObjects.push_back(body);
+ }
+ }
+
Anchor a;
a.m_node = &m_nodes[node];
a.m_body = body;
diff --git a/extern/bullet2/src/BulletSoftBody/btSoftBody.h b/extern/bullet2/src/BulletSoftBody/btSoftBody.h
index 79d272765e0..743462d259a 100644
--- a/extern/bullet2/src/BulletSoftBody/btSoftBody.h
+++ b/extern/bullet2/src/BulletSoftBody/btSoftBody.h
@@ -49,6 +49,8 @@ struct btSoftBodyWorldInfo
class btSoftBody : public btCollisionObject
{
public:
+ btAlignedObjectArray<class btCollisionObject*> m_collisionDisabledObjects;
+
//
// Enumerations
//
@@ -667,7 +669,7 @@ public:
Material* mat=0);
/* Append anchor */
void appendAnchor( int node,
- btRigidBody* body);
+ btRigidBody* body,bool disableCollision);
/* Append linear joint */
void appendLinearJoint(const LJoint::Specs& specs,Cluster* body0,Body body1);
void appendLinearJoint(const LJoint::Specs& specs,Body body=Body());
diff --git a/extern/bullet2/src/BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp b/extern/bullet2/src/BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp
index 835a03b8e3c..e5feb5ef749 100644
--- a/extern/bullet2/src/BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp
+++ b/extern/bullet2/src/BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp
@@ -59,7 +59,10 @@ void btSoftRigidCollisionAlgorithm::processCollision (btCollisionObject* body0,b
btSoftBody* softBody = m_isSwapped? (btSoftBody*)body1 : (btSoftBody*)body0;
btCollisionObject* rigidCollisionObject = m_isSwapped? body0 : body1;
- softBody->defaultCollisionHandler(rigidCollisionObject);
+ if (softBody->m_collisionDisabledObjects.findLinearSearch(rigidCollisionObject)==softBody->m_collisionDisabledObjects.size())
+ {
+ softBody->defaultCollisionHandler(rigidCollisionObject);
+ }
}