BGE: removing remaining reference to sce->world->gravity/physics/... (it's all in...
authorDalai Felinto <dfelinto@gmail.com>
Fri, 7 Aug 2009 03:06:32 +0000 (03:06 +0000)
committerDalai Felinto <dfelinto@gmail.com>
Fri, 7 Aug 2009 03:06:32 +0000 (03:06 +0000)
UI changes: splitting dome options for different dome modes (eg angle doesn't work for envmap mode)
if anyone wants to tweak that, feel free to do it.

* I put a remaining to bring setEyeSeparation + Focal Length to the Stereo GUI. I'm still not sure what would be the default parameters for that, and that will require other changes (eg remove the flag m_setfocallength and m_seteyesep). For so far only a label remind :)

release/ui/buttons_game.py
source/gameengine/Converter/KX_BlenderSceneConverter.cpp

index 2d29a45..ee62602 100644 (file)
@@ -176,21 +176,38 @@ class SCENE_PT_game_stereo(SceneButtonsPanel):
                # stereo:
                if stereo_mode == 'STEREO':
                        layout.itemR(gs, "stereo_mode")
+                       layout.itemL(text="To do: Focal Length")
+                       layout.itemL(text="To do: Eye Separation")
 
                # dome:
-               if stereo_mode == 'DOME':
+               elif stereo_mode == 'DOME':
                        layout.itemR(gs, "dome_mode", text="Dome Type")
 
+                       dome_type = gs.dome_mode
+
                        split=layout.split()
-                       
-                       col=split.column()
-                       col.itemR(gs, "dome_angle", slider=True)
-                       col.itemR(gs, "dome_tesselation", text="Tesselation")
-                       
-                       col=split.column()
-                       col.itemR(gs, "dome_tilt")
-                       col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
-                       
+
+                       if dome_type == 'FISHEYE' or \
+                          dome_type == 'TRUNCATED_REAR' or \
+                          dome_type == 'TRUNCATED_FRONT':
+                               
+                               col=split.column()
+                               col.itemR(gs, "dome_angle", slider=True)
+                               col.itemR(gs, "dome_tilt")
+
+                               col=split.column()
+                               col.itemR(gs, "dome_tesselation", text="Tesselation")
+                               col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+
+                       elif dome_type == 'PANORAM_SPH':
+                               col=split.column()
+                               col.itemR(gs, "dome_tesselation", text="Tesselation")
+                               col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+
+                       else: # cube map
+                               col=split.column()
+                               col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+               
                        layout.itemR(gs, "dome_text")
 
 bpy.types.register(SCENE_PT_game)
@@ -246,30 +263,6 @@ class WORLD_PT_game_world(WorldButtonsPanel):
                row.itemR(world.mist, "start")
                row.itemR(world.mist, "depth")
 
-
-"""
-class WORLD_PT_game(WorldButtonsPanel):
-       __space_type__ = "LOGIC_EDITOR"
-       __region_type__ = "UI"
-       __label__ = "Game Settings"
-
-       def draw(self, context):
-               layout = self.layout
-               world = context.world
-               
-               flow = layout.column_flow()
-               flow.itemR(world, "physics_engine")
-               flow.itemR(world, "physics_gravity")
-               
-               flow.itemR(world, "game_fps")
-               flow.itemR(world, "game_logic_step_max")
-               flow.itemR(world, "game_physics_substep")
-               flow.itemR(world, "game_physics_step_max")
-               
-               flow.itemR(world, "game_use_occlusion_culling", text="Enable Occlusion Culling")
-               flow.itemR(world, "game_occlusion_culling_resolution")
-"""
-
 class WORLD_PT_game_physics(WorldButtonsPanel):
        __label__ = "Physics"
  
index 4df9df7..85d1783 100644 (file)
@@ -260,38 +260,34 @@ void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene,
        if (blenderscene)
        {
        
-               if (blenderscene->world)
+               switch (blenderscene->gm.physicsEngine)
                {
-                       switch (blenderscene->world->physicsEngine)
+               case WOPHY_BULLET:
                        {
-                       case WOPHY_BULLET:
-                               {
-                                       physics_engine = UseBullet;
-                                       useDbvtCulling = (blenderscene->world->mode & WO_DBVT_CULLING) != 0;
-                                       break;
-                               }
-                                
-                               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;
-                               }
+                               physics_engine = UseBullet;
+                               useDbvtCulling = (blenderscene->gm.mode & WO_DBVT_CULLING) != 0;
+                               break;
+                       }
+                                                       
+                       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;
                        }
-                 
                }
        }