intravenous
diff src/game.cc @ 2:472c28b8b875
I think I pretty much nailed the camera
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 21 Apr 2012 23:03:36 +0300 |
parents | 3ea290d35984 |
children | 94d4c60af435 |
line diff
1.1 --- a/src/game.cc Sat Apr 21 22:42:43 2012 +0300 1.2 +++ b/src/game.cc Sat Apr 21 23:03:36 2012 +0300 1.3 @@ -9,6 +9,7 @@ 1.4 static Ship ship; 1.5 1.6 static int keystate[256]; 1.7 +static int dbg_inside = false; 1.8 1.9 static OrbitCamera dbgcam; 1.10 1.11 @@ -61,10 +62,10 @@ 1.12 ship.turn(1.0 * dt, 0.0); 1.13 } 1.14 if(keystate['e'] || keystate['E']) { 1.15 - ship.turn(0.0, -1.0 * dt); 1.16 + ship.turn(0.0, 1.0 * dt); 1.17 } 1.18 if(keystate['c'] || keystate['C']) { 1.19 - ship.turn(0.0, 1.0 * dt); 1.20 + ship.turn(0.0, -1.0 * dt); 1.21 } 1.22 1.23 ship.update(dt); 1.24 @@ -77,8 +78,11 @@ 1.25 glMatrixMode(GL_MODELVIEW); 1.26 dbgcam.use(); 1.27 1.28 + if(dbg_inside) { 1.29 + load_gl_matrix(ship.get_matrix().inverse()); 1.30 + } 1.31 + 1.32 vein->draw(ship.get_position()); 1.33 - 1.34 ship.dbg_draw(); 1.35 } 1.36 1.37 @@ -90,6 +94,10 @@ 1.38 game_shutdown(); 1.39 break; 1.40 1.41 + case '\b': 1.42 + dbg_inside = !dbg_inside; 1.43 + break; 1.44 + 1.45 default: 1.46 break; 1.47 }