]> git.tdb.fi Git - libs/gl.git/blobdiff - source/scene.cpp
Use an explicit material slot name in RenderPass
[libs/gl.git] / source / scene.cpp
index 3933599ba5c63f13307d1c755ba0cd9323842a1b..fbde0cd34dff6c0960238c6d5384cef1a99fcff5 100644 (file)
@@ -40,7 +40,7 @@ bool Scene::setup_frustum(const Renderer &renderer) const
                frustum_edges[0] = Vector4(0, 1/s, y/s, 0);
                frustum_edges[1] = Vector4(0, -1/s, y/s, 0);
 
-               float x = y*camera->get_aspect();
+               float x = y*camera->get_aspect_ratio();
                s = sqrt(x*x+1);
                frustum_edges[2] = Vector4(1/s, 0, x/s, 0);
                frustum_edges[3] = Vector4(-1/s, 0, x/s, 0);
@@ -60,7 +60,7 @@ bool Scene::frustum_cull(const Renderable &renderable) const
                return false;
 
        Vector4 center = culling_matrix*(*matrix*compose(bsphere->get_center(), 1.0f));
-       Vector4 x_axis = *matrix*Vector4(bsphere->get_radius(), 0.0f, 0.0f, 0.0f);
+       Vector3 x_axis = (matrix->column(0)*bsphere->get_radius()).slice<3>(0);
        float radius_sq = inner_product(x_axis, x_axis);
 
        for(unsigned i=0; i<6; ++i)