X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=laserbrain_demo;a=blobdiff_plain;f=src%2Fapp.cc;h=0ac331bec6ef2b68cdf3c24fc0471b91bee195d7;hp=7fc5c13a581151b9acc7f0cc764724378e133f08;hb=d97ea0009ec59bdbf0c438b2d1e015936b20fd85;hpb=92e1b315a32da123b2f8d7bb633375033a10c66d diff --git a/src/app.cc b/src/app.cc index 7fc5c13..0ac331b 100644 --- a/src/app.cc +++ b/src/app.cc @@ -147,8 +147,6 @@ bool app_init(int argc, char **argv) float ambient[] = {0.0, 0.0, 0.0, 0.0}; glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient); - glClearColor(1, 1, 1, 1); - init_audio(); if(!init_vrhands()) { @@ -364,8 +362,9 @@ static void update(float dt) if(have_handtracking) { update_vrhands(&avatar); } else { + // TODO do this properly // set the position of the left hand at a suitable position for the exhibit UI - Vec3 dir = transpose(mouse_view_matrix.upper3x3()) * Vec3(0, 0, -1); + dir = rotate(Vec3(-0.46, -0.1, -1), Vec3(0, 1, 0), deg_to_rad(-avatar.body_rot)); exslot_left.node.set_position(avatar.pos + dir * 30); // magic: distance in front } @@ -386,6 +385,8 @@ void app_display() ImGui::ShowTestWindow(); } + glClearColor(1, 1, 1, 1); + if(opt.vr) { // VR mode goatvr_draw_start(); @@ -616,6 +617,22 @@ void app_keyboard(int key, bool pressed) case 'x': exman->load(mscn, "data/exhibits"); break; + + case KEY_UP: + exui_scroll(-1); + break; + + case KEY_DOWN: + exui_scroll(1); + break; + + case KEY_LEFT: + exui_change_tab(-1); + break; + + case KEY_RIGHT: + exui_change_tab(1); + break; } }