]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/view.cpp
Adapt to changes in vector slicing and composing API
[r2c2.git] / source / 3d / view.cpp
index 69049e0b3e8e2232277ad4d0ee0f93e374424075..2050f587ec08eebc143bfe6eae38204bb1cfe13c 100644 (file)
@@ -25,6 +25,7 @@ View3D::View3D(Layout3D &l, unsigned w, unsigned h):
        pipeline.add_renderable_for_pass(layout.get_scene(), "translucent");
 
        GL::Pipeline::Pass *pass = &pipeline.add_pass("sky");
+       pass->set_lighting(&layout.get_lighting());
 
        pass = &pipeline.add_pass(0);
        pass->set_lighting(&layout.get_lighting());
@@ -59,7 +60,7 @@ 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));
-       return Ray(start, Vector(ray));
+       return Ray(start, ray.slice<3>(0));
 }
 
 void View3D::compute_bounds(Vector &minp, Vector &maxp)