adding mirror plane options other than auto
[laserbrain_demo] / src / app.cc
index 63e7cd7..b61b0e7 100644 (file)
@@ -84,6 +84,8 @@ static Renderer *rend;
 
 static Ray last_pick_ray;
 
+static bool post_scene_init_pending = true;
+
 
 bool app_init(int argc, char **argv)
 {
@@ -206,6 +208,14 @@ bool app_init(int argc, char **argv)
        return true;
 }
 
+static void post_scene_init()
+{
+       int num_mir = mscn->calc_mirror_planes();
+       info_log("found %d mirror planes\n", num_mir);
+
+       exman->load(mscn, "data/exhibits");
+}
+
 void app_cleanup()
 {
        if(mscn->music) {
@@ -257,6 +267,11 @@ static void update(float dt)
        texman.update();
        sceneman.update();
 
+       if(post_scene_init_pending && !sceneman.pending()) {
+               post_scene_init_pending = false;
+               post_scene_init();
+       }
+
        mscn->update(dt);
        exman->update(dt);
        exui_update(dt);
@@ -629,10 +644,6 @@ void app_keyboard(int key, bool pressed)
                        show_message("VR recenter\n");
                        break;
 
-               case 'x':
-                       exman->load(mscn, "data/exhibits");
-                       break;
-
                case KEY_UP:
                        exui_scroll(-1);
                        break;