]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/view.cpp
Move members after type declarations
[r2c2.git] / source / 3d / view.cpp
index 5779616f6ce88ea2b82da9982298e169fca79777..b833605c87227951e798de68983bbaac46eead27 100644 (file)
@@ -13,13 +13,17 @@ View3D::View3D(Layout3D &l, unsigned w, unsigned h):
        layout(l),
        width(w),
        height(h),
-       pipeline(w, h)
+       pipeline(w, h),
+       sky(layout.get_catalogue())
 {
        pipeline.set_camera(&camera);
+       pipeline.add_renderable(sky);
        pipeline.add_renderable_for_pass(layout.get_scene(), 0);
        pipeline.add_renderable_for_pass(layout.get_scene(), "translucent");
 
-       GL::Pipeline::Pass *pass = &pipeline.add_pass(0);
+       GL::Pipeline::Pass *pass = &pipeline.add_pass("sky");
+
+       pass = &pipeline.add_pass(0);
        pass->set_lighting(&layout.get_lighting());
        pass->set_depth_test(&GL::DepthTest::lequal());
 
@@ -36,12 +40,12 @@ View3D::View3D(Layout3D &l, unsigned w, unsigned h):
        view_all();
 }
 
-Ray View3D::create_ray(int x, int y)
+Ray View3D::create_ray(int x, int y) const
 {
        return create_ray(x*2.0f/width-1.0f, y*2.0f/height-1.0f);
 }
 
-Ray View3D::create_ray(float x, float y)
+Ray View3D::create_ray(float x, float y) const
 {
        const GL::Vector3 &start = camera.get_position();
        GL::Vector4 ray = camera.unproject(GL::Vector4(x, y, 0, 0));