diff --git a/Userland/Libraries/LibGfx/Vector3.h b/Userland/Libraries/LibGfx/Vector3.h index fee55ce59c..8e2d928acf 100644 --- a/Userland/Libraries/LibGfx/Vector3.h +++ b/Userland/Libraries/LibGfx/Vector3.h @@ -54,6 +54,16 @@ public: return Vector3(m_x - other.m_x, m_y - other.m_y, m_z - other.m_z); } + constexpr Vector3 operator*(const Vector3& other) const + { + return Vector3(m_x * other.m_x, m_y * other.m_y, m_z * other.m_z); + } + + constexpr Vector3 operator/(const Vector3& other) const + { + return Vector3(m_x / other.m_x, m_y / other.m_y, m_z / other.m_z); + } + constexpr Vector3 operator*(T f) const { return Vector3(m_x * f, m_y * f, m_z * f); diff --git a/Userland/Libraries/LibGfx/Vector4.h b/Userland/Libraries/LibGfx/Vector4.h index 3b13c1678a..aacd0bf16c 100644 --- a/Userland/Libraries/LibGfx/Vector4.h +++ b/Userland/Libraries/LibGfx/Vector4.h @@ -59,6 +59,16 @@ public: return Vector4(m_x - other.m_x, m_y - other.m_y, m_z - other.m_z, m_w - other.m_w); } + constexpr Vector4 operator*(const Vector4& other) const + { + return Vector4(m_x * other.m_x, m_y * other.m_y, m_z * other.m_z, m_w * other.m_w); + } + + constexpr Vector4 operator/(const Vector4& other) const + { + return Vector4(m_x / other.m_x, m_y / other.m_y, m_z / other.m_z, m_w / other.m_w); + } + constexpr Vector4 operator*(T f) const { return Vector4(m_x * f, m_y * f, m_z * f, m_w * f);