From: Mikko Rasa Date: Tue, 14 Nov 2017 08:47:32 +0000 (+0200) Subject: Use matrix column accessors rather than multiplication X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=a25a5932b80e7d1c11be6b09c5e00857b9238f60;p=libs%2Fgl.git Use matrix column accessors rather than multiplication --- diff --git a/source/environmentmap.cpp b/source/environmentmap.cpp index 9ca4d452..94ae5150 100644 --- a/source/environmentmap.cpp +++ b/source/environmentmap.cpp @@ -47,7 +47,7 @@ void EnvironmentMap::setup_frame(Renderer &renderer) Renderer::Exclude exclude1(renderer, renderable); Renderer::Exclude exclude2(renderer, *this); - camera.set_position(*matrix*Vector3()); + camera.set_position(matrix->column(3).slice<3>(0)); BindRestore bind_fbo(fbo[0]); for(unsigned i=0; i<6; ++i) diff --git a/source/scene.cpp b/source/scene.cpp index 3933599b..9d301fbf 100644 --- a/source/scene.cpp +++ b/source/scene.cpp @@ -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)