From ede1203ff70b79d5f68b4bd0c31089bb8b87ae73 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Tue, 16 Dec 2014 15:28:40 +1100 Subject: [PATCH] matrix: add affine scale implementation --- matrix.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/matrix.cpp b/matrix.cpp index 4f6403f9..07897f40 100644 --- a/matrix.cpp +++ b/matrix.cpp @@ -515,6 +515,20 @@ matrix::translate (util::vector<3,T> v) } +//----------------------------------------------------------------------------- +template +matrix +matrix::scale (util::vector<3,T> v) +{ + return { { + { v.x, 0.f, 0.f, 0.f }, + { 0.f, v.y, 0.f, 0.f }, + { 0.f, 0.f, v.z, 0.f }, + { 0.f, 0.f, 0.f, 1.f } + } }; +} + + //----------------------------------------------------------------------------- template const matrix