#define some constants for physics engines in DNA world types.
authorKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Sat, 3 Apr 2004 00:04:44 +0000 (00:04 +0000)
committerKester Maddock <Christopher.Maddock.1@uni.massey.ac.nz>
Sat, 3 Apr 2004 00:04:44 +0000 (00:04 +0000)
source/blender/makesdna/DNA_world_types.h
source/blender/src/buttons_shading.c
source/gameengine/Converter/KX_BlenderSceneConverter.cpp

index 47ac0d337c314cc498c940888e1733fe8652ee8a..efa17af49969a90a469bbe89a04397ac5ebf9f07 100644 (file)
@@ -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
 
index 1ddecaa5832bbc21b2c2d93e1869c57c98ce5b11..8f4ced1908534445f96d61c0a42002970006b649 100644 (file)
@@ -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");
        
index 4f5804da9b629497124c99f379ddb3e959481569..ff22e003d75dfcaf01ea18c2f2b8301a0ddc6155 100644 (file)
@@ -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();
 }