[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16828] trunk/blender/source/gameengine/ Physics/Bullet/CcdPhysicsController.cpp: BGE patch: fix force application on soft body.

Benoit Bolsee benoit.bolsee at online.be
Mon Sep 29 19:46:27 CEST 2008


Revision: 16828
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16828
Author:   ben2610
Date:     2008-09-29 19:46:25 +0200 (Mon, 29 Sep 2008)

Log Message:
-----------
BGE patch: fix force application on soft body. Force is applied on each node, it must be reduced by the same extend.

Modified Paths:
--------------
    trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp

Modified: trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp
===================================================================
--- trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp	2008-09-29 17:08:11 UTC (rev 16827)
+++ trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsController.cpp	2008-09-29 17:46:25 UTC (rev 16828)
@@ -962,8 +962,12 @@
 				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);
-
+			}
 		}
 	}
 }





More information about the Bf-blender-cvs mailing list