projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
adding mirror plane options other than auto
[laserbrain_demo]
/
src
/
app.cc
diff --git
a/src/app.cc
b/src/app.cc
index
63e7cd7
..
b61b0e7
100644
(file)
--- a/
src/app.cc
+++ b/
src/app.cc
@@
-84,6
+84,8
@@
static Renderer *rend;
static Ray last_pick_ray;
static Ray last_pick_ray;
+static bool post_scene_init_pending = true;
+
bool app_init(int argc, char **argv)
{
bool app_init(int argc, char **argv)
{
@@
-206,6
+208,14
@@
bool app_init(int argc, char **argv)
return true;
}
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) {
void app_cleanup()
{
if(mscn->music) {
@@
-257,6
+267,11
@@
static void update(float dt)
texman.update();
sceneman.update();
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);
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;
show_message("VR recenter\n");
break;
- case 'x':
- exman->load(mscn, "data/exhibits");
- break;
-
case KEY_UP:
exui_scroll(-1);
break;
case KEY_UP:
exui_scroll(-1);
break;