diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2008-09-26 06:27:59 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2008-09-26 06:27:59 +0400 |
commit | a1bef84ea859cf85487d4cac8664402dd86f4465 (patch) | |
tree | aab43249487d338e39e9df721a5675536ffb65ff /extern/bullet2/src/BulletSoftBody | |
parent | 6732718ef1b7f212e2368cf237c08d72f13d06ab (diff) |
Allow Bullet soft bodies to be created using a AddObject actuator. Added a fake world coordinate system to game soft bodies, although the vertices are already in world space.
Added Bullet/Gimpact concave collision detection to Blender. If your build system isn't updated yet, please add extern/bullet2/src/BulletCollision/Gimpact/*
This allows moving/dynamic concave triangle meshes (decomposing meshes into compound convex shapes, and using 'compound' shapes is still preferred)
Diffstat (limited to 'extern/bullet2/src/BulletSoftBody')
-rw-r--r-- | extern/bullet2/src/BulletSoftBody/btSoftBody.cpp | 14 | ||||
-rw-r--r-- | extern/bullet2/src/BulletSoftBody/btSoftBody.h | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp b/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp index e42a613343b..7b7b2da910a 100644 --- a/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp +++ b/extern/bullet2/src/BulletSoftBody/btSoftBody.cpp @@ -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) { diff --git a/extern/bullet2/src/BulletSoftBody/btSoftBody.h b/extern/bullet2/src/BulletSoftBody/btSoftBody.h index e89bbcc4fa8..7a6bfd53205 100644 --- a/extern/bullet2/src/BulletSoftBody/btSoftBody.h +++ b/extern/bullet2/src/BulletSoftBody/btSoftBody.h @@ -677,6 +677,10 @@ public: int node); /* Add velocity to the entire body */ void addVelocity( const btVector3& velocity); + + /* Set velocity for the entire body */ + void setVelocity( const btVector3& velocity); + /* Add velocity to a node of the body */ void addVelocity( const btVector3& velocity, int node); |