Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Stokes <mogurijin@gmail.com>2014-07-16 04:52:01 +0400
committerMitchell Stokes <mogurijin@gmail.com>2014-07-16 04:52:46 +0400
commitdfe1b9b7a727d5d4cf998a89153aad9f3f6fde55 (patch)
treeadf866aa0ba516f9607b956948c5dbebb8562b8b /source/gameengine
parent490da48d78aec89f4196908476430096089082e9 (diff)
Fix T40146: BGE Compound parent crash
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.h1
-rw-r--r--source/gameengine/Physics/Bullet/CMakeLists.txt1
-rw-r--r--source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.cpp13
-rw-r--r--source/gameengine/Physics/Bullet/SConscript1
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',