X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fapp.cc;h=665ded4ce6b41c65ea3daed6e882bc54da2deaee;hb=12e70d8b9c2d5c81500d7631b9db5d17a34fe918;hp=f92899dc290eab531616fe1eb4ed77841d540669;hpb=84f1549d8146ac54574256ae0243747199e51151;p=laserbrain_demo diff --git a/src/app.cc b/src/app.cc index f92899d..665ded4 100644 --- a/src/app.cc +++ b/src/app.cc @@ -26,10 +26,13 @@ float win_aspect; bool fb_srgb; bool opt_gear_wireframe; +TextureSet texman; +SceneSet sceneman; + unsigned int sdr_ltmap, sdr_ltmap_notex; static float cam_dist = 0.0; -static float cam_theta, cam_phi = 20; +static float cam_theta, cam_phi; static Vec3 cam_pos; static float floor_y; // last floor height static float user_eye_height = 165; @@ -48,8 +51,6 @@ static Vec2 joy_move, joy_look; static float joy_deadzone = 0.01; static Mat4 view_matrix, mouse_view_matrix, proj_matrix; -static TextureSet texman; -static SceneSet sceneman; static MetaScene *mscn; static unsigned int sdr_post_gamma; @@ -98,13 +99,15 @@ bool app_init(int argc, char **argv) glClearColor(0.2, 0.2, 0.2, 1.0); - mscn = new MetaScene(&sceneman, &texman); + mscn = new MetaScene; if(!mscn->load(opt.scenefile ? opt.scenefile : "data/museum.scene")) { return false; } cam_pos = mscn->start_pos; - // TODO use start_rot + Vec3 dir = rotate(Vec3(0, 0, 1), mscn->start_rot); + dir.y = 0; + cam_theta = rad_to_deg(acos(dot(dir, Vec3(0, 0, 1)))); if(!(sdr_ltmap_notex = create_program_load("sdr/lightmap.v.glsl", "sdr/lightmap-notex.p.glsl"))) { return false;