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:
Diffstat (limited to 'extern/bullet2/src/BulletSoftBody/btSoftBody.cpp')
-rw-r--r--extern/bullet2/src/BulletSoftBody/btSoftBody.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp b/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp
index 91b9d6f1bbd..7b7b2da910a 100644
--- a/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp
+++ b/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp
@@ -69,7 +69,7 @@ btSoftBody::btSoftBody(btSoftBodyWorldInfo* worldInfo,int node_count, const btV
pm->m_flags = fMaterial::Default;
/* Collision shape */
///for now, create a collision shape internally
- setCollisionShape(new btSoftBodyCollisionShape(this));
+ m_collisionShape = new btSoftBodyCollisionShape(this);
m_collisionShape->setMargin(0.25);
/* Nodes */
const btScalar margin=getCollisionShape()->getMargin();
@@ -384,6 +384,20 @@ void btSoftBody::addVelocity(const btVector3& velocity)
for(int i=0,ni=m_nodes.size();i<ni;++i) addVelocity(velocity,i);
}
+/* Set velocity for the entire body */
+void btSoftBody::setVelocity( const btVector3& velocity)
+{
+ for(int i=0,ni=m_nodes.size();i<ni;++i)
+ {
+ Node& n=m_nodes[i];
+ if(n.m_im>0)
+ {
+ n.m_v = velocity;
+ }
+ }
+}
+
+
//
void btSoftBody::addVelocity(const btVector3& velocity,int node)
{