diff options
-rw-r--r-- | source/blender/makesdna/DNA_world_types.h | 7 | ||||
-rw-r--r-- | source/blender/src/buttons_shading.c | 4 | ||||
-rw-r--r-- | source/gameengine/Converter/KX_BlenderSceneConverter.cpp | 136 |
3 files changed, 76 insertions, 71 deletions
diff --git a/source/blender/makesdna/DNA_world_types.h b/source/blender/makesdna/DNA_world_types.h index 47ac0d337c3..efa17af4996 100644 --- a/source/blender/makesdna/DNA_world_types.h +++ b/source/blender/makesdna/DNA_world_types.h @@ -124,5 +124,12 @@ typedef struct World { #define WOMAP_ZENUP 4 #define WOMAP_ZENDOWN 8 +/* physicsEngine */ +#define WOPHY_NONE 0 +#define WOPHY_ENJI 1 +#define WOPHY_SUMO 2 +#define WOPHY_DYNAMO 3 +#define WOPHY_ODE 4 + #endif diff --git a/source/blender/src/buttons_shading.c b/source/blender/src/buttons_shading.c index 1ddecaa5832..8f4ced19085 100644 --- a/source/blender/src/buttons_shading.c +++ b/source/blender/src/buttons_shading.c @@ -1526,13 +1526,13 @@ static void world_panel_mistaph(World *wrld) uiBlock *block; block= uiNewBlock(&curarea->uiblocks, "world_panel_mistaph", UI_EMBOSS, UI_HELV, curarea->win); - if(uiNewPanel(curarea, block, "Mist Stars Physics", "World", 640, 0, 318, 204)==0) return; + if(uiNewPanel(curarea, block, "Mist / Stars / Physics", "World", 640, 0, 318, 204)==0) return; uiSetButLock(wrld->id.lib!=0, "Can't edit library data"); #if GAMEBLENDER == 1 uiDefButI(block, MENU, 1, - "Physics %t|None %x1|Sumo %x2|ODE %x3 |Dynamo %x4|", + "Physics %t|None %x0|Sumo %x2", 10,180,140,19, &wrld->physicsEngine, 0, 0, 0, 0, "Physics Engine"); diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 4f5804da9b6..ff22e003d75 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -170,92 +170,90 @@ void KX_BlenderSceneConverter::ConvertScene(const STR_String& scenename, class RAS_IRenderTools* rendertools, class RAS_ICanvas* canvas) { -//find out which physics engine - Scene *blenderscene = GetSceneForName2(m_maggie, scenename); + //find out which physics engine + Scene *blenderscene = GetSceneForName2(m_maggie, scenename); - e_PhysicsEngine physics_engine = UseSumo; + e_PhysicsEngine physics_engine = UseSumo; - /* FIXME: Force physics engine = sumo. - This isn't really a problem - no other physics engines are available. - if (blenderscene) + /* FIXME: Force physics engine = sumo. + This isn't really a problem - no other physics engines are available. + if (blenderscene) { - int i=0; - - if (blenderscene->world) + int i=0; + + if (blenderscene->world) { - switch (blenderscene->world->physicsEngine) + switch (blenderscene->world->physicsEngine) { - case 4: - { - physics_engine = UseODE; - break; - } - case 3: - { - physics_engine = UseDynamo; - break; - } - case 2: - { - physics_engine = UseSumo; - break; - }; - case 0: - { - physics_engine = UseNone; - } + case WOPHY_ODE: + { + physics_engine = UseODE; + break; + } + case WOPHY_DYNAMO: + { + physics_engine = UseDynamo; + break; + } + case WOPHY_SUMO: + { + physics_engine = UseSumo; + break; + } + case WOPHY_NONE: + { + physics_engine = UseNone; + } } } } -*/ - switch (physics_engine) + */ + switch (physics_engine) { - + #ifdef USE_SUMO_SOLID - case UseSumo: - destinationscene ->SetPhysicsEnvironment(new SumoPhysicsEnvironment()); - break; + case UseSumo: + destinationscene ->SetPhysicsEnvironment(new SumoPhysicsEnvironment()); + break; #endif #ifdef USE_ODE - case UseODE: - destinationscene ->SetPhysicsEnvironment(new ODEPhysicsEnvironment()); - break; + case UseODE: + destinationscene ->SetPhysicsEnvironment(new ODEPhysicsEnvironment()); + break; #endif //USE_ODE - - case UseDynamo: - { - } - - case UseNone: - { - } - default: - physics_engine = UseNone; - destinationscene ->SetPhysicsEnvironment(new DummyPhysicsEnvironment()); - break; + + case UseDynamo: + { + } + + default: + case UseNone: + physics_engine = UseNone; + destinationscene ->SetPhysicsEnvironment(new DummyPhysicsEnvironment()); + break; } - BL_ConvertBlenderObjects(m_maggie, - scenename, - destinationscene, - m_ketsjiEngine, - physics_engine, - dictobj, - keyinputdev, - rendertools, - canvas, - this, - m_alwaysUseExpandFraming - ); - - m_map_blender_to_gameactuator.clear(); - m_map_blender_to_gamecontroller.clear(); - - m_map_blender_to_gameobject.clear(); - m_map_mesh_to_gamemesh.clear(); - m_map_gameobject_to_blender.clear(); + BL_ConvertBlenderObjects(m_maggie, + scenename, + destinationscene, + m_ketsjiEngine, + physics_engine, + dictobj, + keyinputdev, + rendertools, + canvas, + this, + m_alwaysUseExpandFraming + ); + + m_map_blender_to_gameactuator.clear(); + m_map_blender_to_gamecontroller.clear(); + + m_map_blender_to_gameobject.clear(); + m_map_mesh_to_gamemesh.clear(); + m_map_gameobject_to_blender.clear(); } |