[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16815] trunk/blender/source/gameengine/ Physics/Bullet/CcdPhysicsEnvironment.cpp: don' t crash when trying to make a soft body 'fh' object

Erwin Coumans blender at erwincoumans.com
Mon Sep 29 10:00:46 CEST 2008


Revision: 16815
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16815
Author:   erwin
Date:     2008-09-29 10:00:38 +0200 (Mon, 29 Sep 2008)

Log Message:
-----------
don't crash when trying to make a soft body 'fh' object

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

Modified: trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp
===================================================================
--- trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp	2008-09-29 07:56:41 UTC (rev 16814)
+++ trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp	2008-09-29 08:00:38 UTC (rev 16815)
@@ -626,13 +626,15 @@
 	for (it=m_controllers.begin(); it!=m_controllers.end(); it++)
 	{
 		CcdPhysicsController* ctrl = (*it);
-		if (ctrl->GetRigidBody() && ctrl->getConstructionInfo().m_do_fh || ctrl->getConstructionInfo().m_do_rot_fh)
+		btRigidBody* body = ctrl->GetRigidBody();
+
+		if (body && (ctrl->getConstructionInfo().m_do_fh || ctrl->getConstructionInfo().m_do_rot_fh))
 		{
 			//printf("has Fh or RotFh\n");
 			//re-implement SM_FhObject.cpp using btCollisionWorld::rayTest and info from ctrl->getConstructionInfo()
 			//send a ray from {0.0, 0.0, 0.0} towards {0.0, 0.0, -10.0}, in local coordinates
 
-			btRigidBody* body = ctrl->GetRigidBody();
+			
 			CcdPhysicsController* parentCtrl = ctrl->getParentCtrl();
 			btRigidBody* parentBody = parentCtrl?parentCtrl->GetRigidBody() : 0;
 			btRigidBody* cl_object = parentBody ? parentBody : body;





More information about the Bf-blender-cvs mailing list