diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2008-09-29 21:46:25 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2008-09-29 21:46:25 +0400 |
commit | a1513a8c0f6953932d004b3bd85831d096ee095b (patch) | |
tree | bce3fca2931c1bb14e954d312c683d793417987a | |
parent | 2a331067cc52693aa903a0487be29c93298c4b8b (diff) |
BGE patch: fix force application on soft body. Force is applied on each node, it must be reduced by the same extend.
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsController.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp index 7196a1ae095..47329235517 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp @@ -962,8 +962,12 @@ void CcdPhysicsController::ApplyForce(float forceX,float forceY,float forceZ,bo body->applyCentralForce(force); btSoftBody* soft = GetSoftBody(); if (soft) + { + // the force is applied on each node, must reduce it in the same extend + if (soft->m_nodes.size() > 0) + force /= soft->m_nodes.size(); soft->addForce(force); - + } } } } |