From 5c7b1a0eb20077674bddaf8a91d6610c3e1edb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Sat, 15 Oct 2016 15:35:27 +0200 Subject: [PATCH] Math: simplify Matrix4::lookAt(). --- src/Magnum/Math/Matrix4.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Magnum/Math/Matrix4.h b/src/Magnum/Math/Matrix4.h index c7dc88f91..8313aa081 100644 --- a/src/Magnum/Math/Matrix4.h +++ b/src/Magnum/Math/Matrix4.h @@ -680,11 +680,7 @@ template Matrix4 Matrix4::lookAt(const Vector3& eye, const Vec const Vector3 backward = (eye - target).normalized(); const Vector3 right = cross(up, backward).normalized(); const Vector3 realUp = cross(backward, right); - - return {{ right, T(0)}, - { realUp, T(0)}, - {backward, T(0)}, - { eye, T(1)}}; + return from({right, realUp, backward}, eye); } template inline Matrix3x3 Matrix4::rotation() const {