[Bf-blender-cvs] [0f91d2c] master: Fix T39458: Switching physics type from Character to Dynamic enables ghost flag silently

Mitchell Stokes noreply at git.blender.org
Wed Apr 23 01:42:31 CEST 2014


Commit: 0f91d2cec9fce85c5557c5669da6685180b756cb
Author: Mitchell Stokes
Date:   Tue Apr 22 16:38:34 2014 -0700
https://developer.blender.org/rB0f91d2cec9fce85c5557c5669da6685180b756cb

Fix T39458: Switching physics type from Character to Dynamic enables ghost flag silently

Enabling ghost for Sensors and Characters is now done in conversion
rather than when setting the RNA.

===================================================================

M	source/blender/makesrna/intern/rna_object.c
M	source/gameengine/Converter/BL_BlenderDataConversion.cpp

===================================================================

diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index 4a81780..3807329 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -987,7 +987,7 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
 
 	switch (ob->body_type) {
 		case OB_BODY_TYPE_SENSOR:
-			ob->gameflag |= OB_SENSOR | OB_COLLISION | OB_GHOST;
+			ob->gameflag |= OB_SENSOR | OB_COLLISION;
 			ob->gameflag &= ~(OB_OCCLUDER | OB_CHARACTER | OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_ACTOR |
 			                  OB_ANISOTROPIC_FRICTION | OB_DO_FH | OB_ROT_FH | OB_COLLISION_RESPONSE | OB_NAVMESH);
 			break;
@@ -1009,7 +1009,7 @@ static void rna_GameObjectSettings_physics_type_set(PointerRNA *ptr, int value)
 			ob->gameflag &= ~(OB_SENSOR | OB_RIGID_BODY | OB_SOFT_BODY | OB_COLLISION | OB_CHARACTER | OB_OCCLUDER | OB_DYNAMIC | OB_NAVMESH);
 			break;
 		case OB_BODY_TYPE_CHARACTER:
-			ob->gameflag |= OB_COLLISION | OB_GHOST | OB_CHARACTER;
+			ob->gameflag |= OB_COLLISION | OB_CHARACTER;
 			ob->gameflag &= ~(OB_SENSOR | OB_OCCLUDER | OB_DYNAMIC | OB_RIGID_BODY | OB_SOFT_BODY | OB_ACTOR |
 			                  OB_ANISOTROPIC_FRICTION | OB_DO_FH | OB_ROT_FH | OB_COLLISION_RESPONSE | OB_NAVMESH);
 			break;
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
index f03f4a9..041dde2 100644
--- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp
+++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp
@@ -1645,7 +1645,7 @@ static void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj,
 		}
 	}
 
-	objprop.m_ghost = (blenderobject->gameflag & OB_GHOST) != 0;
+	objprop.m_ghost = (blenderobject->gameflag & (OB_GHOST | OB_SENSOR | OB_CHARACTER)) != 0;
 	objprop.m_disableSleeping = (blenderobject->gameflag & OB_COLLISION_RESPONSE) != 0;//abuse the OB_COLLISION_RESPONSE flag
 	//mmm, for now, taks this for the size of the dynamicobject
 	// Blender uses inertia for radius of dynamic object




More information about the Bf-blender-cvs mailing list