diff options
Diffstat (limited to 'source/gameengine/Physics/Bullet')
4 files changed, 24 insertions, 4 deletions
diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt index e295b701b36..e52dc1ba052 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 69e190c79db..e17d4402556 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" @@ -83,7 +84,7 @@ void DrawRasterizerLine(const float* from,const float* to,int color); // This was copied from the old KX_ConvertPhysicsObjects #ifdef WIN32 -#if defined(_MSC_VER) && (_MSC_VER >= 1310) +#ifdef _MSC_VER //only use SIMD Hull code under Win32 //#define TEST_HULL 1 #ifdef TEST_HULL @@ -877,6 +878,14 @@ void CcdPhysicsEnvironment::ProcessFhSprings(double curTime,float interval) } } +int CcdPhysicsEnvironment::GetDebugMode() const +{ + if (m_debugDrawer) { + return m_debugDrawer->getDebugMode(); + } + return 0; +} + void CcdPhysicsEnvironment::SetDebugMode(int debugMode) { if (m_debugDrawer) { @@ -2085,7 +2094,7 @@ void CcdPhysicsEnvironment::SetConstraintParam(int constraintId,int param,float case 12: case 13: case 14: case 15: case 16: case 17: { - //param 13-17 are for motorized springs on each of the degrees of freedom + //param 12-17 are for motorized springs on each of the degrees of freedom btGeneric6DofSpringConstraint* genCons = (btGeneric6DofSpringConstraint*)typedConstraint; int springIndex = param-12; if (value0!=0.f) @@ -3036,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/CcdPhysicsEnvironment.h b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h index a94e205b160..ff8a3f4f9f9 100644 --- a/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h +++ b/source/gameengine/Physics/Bullet/CcdPhysicsEnvironment.h @@ -139,6 +139,7 @@ protected: virtual float GetFixedTimeStep() { return 0.f; } virtual void SetDebugMode(int debugMode); + virtual int GetDebugMode()const; virtual void SetGravity(float x,float y,float z); virtual void GetGravity(MT_Vector3& grav); 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', |