From 0c4ddd58454437a8fec95eca64cdcf08085a0a5d Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 30 Dec 2020 17:09:15 +0200 Subject: [PATCH] Add multiplication operators between Matrix and float Newer gcc versions are complaining about an ambiguity between the vector multiplication operators in GL::Matrix and the scalar multiplication for LinAl::Matrix. --- source/matrix.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/matrix.h b/source/matrix.h index 971d2b36..cb61e292 100644 --- a/source/matrix.h +++ b/source/matrix.h @@ -38,6 +38,8 @@ public: Matrix operator*(const Matrix &m) const { return static_cast(*this)*static_cast(m); } Matrix &operator*=(const Matrix &m) { Base::operator*=(m); return *this; } + Matrix operator*(float s) const { return static_cast(*this)*s; } + Matrix &operator*=(float s) { Base::operator*=(s); return *this; } Vector4 operator*(const Vector4 &v) const { return static_cast(*this)*v; } Vector3 operator*(const Vector3 &v) const { return ((*this)*compose(v, 1.0f)).slice<3>(0); } float operator[](unsigned) const; -- 2.45.2