From ab4bc4ae3067aa038cdb20e4fff0542addaac564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Wed, 21 May 2014 19:23:20 +0200 Subject: [PATCH] add vec2 * mat4 multiplication --- include/llmr/util/vec.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/llmr/util/vec.hpp b/include/llmr/util/vec.hpp index 770776160..828a6a5fb 100644 --- a/include/llmr/util/vec.hpp +++ b/include/llmr/util/vec.hpp @@ -5,6 +5,7 @@ #include #include #include +#include namespace llmr { @@ -47,6 +48,10 @@ struct vec2 { y *= o; } + inline vec2 operator *(const std::array& matrix) { + return { x * matrix[0] + y * matrix[4] + matrix[12], x * matrix[1] + y * matrix[5] + matrix[13] }; + } + template inline typename std::enable_if::value, vec2>::type operator-(O o) const {