diff options
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.h | 1 | ||||
-rw-r--r-- | source/gameengine/Physics/Bullet/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp | 13 | ||||
-rw-r--r-- | source/gameengine/Physics/Bullet/SConscript | 1 |
4 files changed, 14 insertions, 2 deletions
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index 45d594e21dc..2bc5bad6daf 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -223,6 +223,7 @@ public: PyObject* GetPyProfileDict(); #endif void SetSceneConverter(KX_ISceneConverter* sceneconverter); + KX_ISceneConverter* GetSceneConverter() { return m_sceneconverter; } void SetAnimRecordMode(bool animation_record, int startFrame); RAS_IRasterizer* GetRasterizer() { return m_rasterizer; } diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt index 87d851016dd..fbaa7bb59ba 100644 --- a/source/gameengine/Physics/Bullet/CMakeLists.txt +++ b/source/gameengine/Physics/Bullet/CMakeLists.txt @@ -29,6 +29,7 @@ remove_strict_flags() set(INC . ../common + ../../Converter ../../Expressions ../../GameLogic ../../Ketsji diff --git a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp index f34311d70a0..3e0b99eb7e2 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp @@ -42,6 +42,7 @@ subject to the following restrictions: #include "PHY_Pro.h" #include "KX_GameObject.h" #include "KX_PythonInit.h" // for KX_RasterizerDrawDebugLine +#include "KX_BlenderSceneConverter.h" #include "RAS_MeshObject.h" #include "RAS_Polygon.h" #include "RAS_TexVert.h" @@ -3044,9 +3045,17 @@ void CcdPhysicsEnvironment::ConvertObject(KX_GameObject *gameobj, RAS_MeshObject CcdConstructionInfo ci; class CcdShapeConstructionInfo *shapeInfo = new CcdShapeConstructionInfo(); - KX_GameObject *parent = gameobj->GetParent(); - if (parent) + // get Root Parent of blenderobject + Object *blenderparent = blenderobject->parent; + while (blenderparent && blenderparent->parent) { + blenderparent = blenderparent->parent; + } + + KX_GameObject *parent = NULL; + if (blenderparent) { + KX_BlenderSceneConverter *converter = (KX_BlenderSceneConverter*)KX_GetActiveEngine()->GetSceneConverter(); + parent = converter->FindGameObject(blenderparent); isbulletdyna = false; isbulletsoftbody = false; shapeprops->m_mass = 0.f; diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index 2700997ccd4..2a8249b9558 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -39,6 +39,7 @@ incs = [ '#source/blender/blenkernel', '#source/blender/blenlib', '#source/blender/makesdna', + '#source/gameengine/Converter', '#source/gameengine/Expressions', '#source/gameengine/GameLogic', '#source/gameengine/Ketsji', |