[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [20013] trunk/blender/source/gameengine/ Physics/Bullet/CcdPhysicsEnvironment.cpp: BGE bug fix: when a dynamic object is parented to a compound shape and then unparented, it jumps at the position it had before the parenting.

Benoit Bolsee benoit.bolsee at online.be
Thu Apr 30 22:02:22 CEST 2009


Revision: 20013
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=20013
Author:   ben2610
Date:     2009-04-30 22:02:22 +0200 (Thu, 30 Apr 2009)

Log Message:
-----------
BGE bug fix: when a dynamic object is parented to a compound shape and then unparented, it jumps at the position it had before the parenting.

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	2009-04-30 19:00:17 UTC (rev 20012)
+++ trunk/blender/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp	2009-04-30 20:02:22 UTC (rev 20013)
@@ -533,6 +533,12 @@
 	{
 		btCollisionObject* obj = ctrl->GetCollisionObject();
 		obj->setUserPointer(ctrl);
+		// update the position of the object from the user
+		if (ctrl->GetMotionState()) 
+		{
+			btTransform xform = CcdPhysicsController::GetTransformFromMotionState(ctrl->GetMotionState());
+			ctrl->SetCenterOfMassTransform(xform);
+		}
 		m_dynamicsWorld->addCollisionObject(obj, 
 			ctrl->GetCollisionFilterGroup(), ctrl->GetCollisionFilterMask());
 	}





More information about the Bf-blender-cvs mailing list