diff --git a/math/vec3.hpp b/math/vec3.hpp index 98240aa..92ee3df 100644 --- a/math/vec3.hpp +++ b/math/vec3.hpp @@ -26,6 +26,7 @@ struct vec<3, T> inline constexpr vec<3, T>& operator=(vec<3, T> const& v); inline constexpr vec<3, T>& operator+=(vec<3, T> const& v); inline constexpr vec<3, T>& operator-=(vec<3, T> const& v); + inline constexpr vec<3, T>& operator*=(T const& scalar); }; template @@ -84,6 +85,13 @@ inline constexpr vec<3, T>& vec<3, T>::operator-=(vec<3, T> const& v) return *this; } +template +inline constexpr vec<3, T>& vec<3, T>::operator*=(T const& scalar) +{ + *this = *this * scalar; + return *this; +} + template inline constexpr vec<3, T> operator+(vec<3, T> const& v1, vec<3, T> const& v2) {