1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 20:17:44 +00:00

LibGfx: Add some missing operators to Vector3 Vector4 and Matrix4x4

This commit is contained in:
Stephan Unverwerth 2021-04-18 16:25:25 +02:00 committed by Andreas Kling
parent 0c5d61ae88
commit 09f850728a
3 changed files with 53 additions and 0 deletions

View file

@ -28,6 +28,22 @@ public:
void set_y(T value) { m_y = value; }
void set_z(T value) { m_z = value; }
Vector3& operator+=(const Vector3& other)
{
m_x += other.m_x;
m_y += other.m_y;
m_z += other.m_z;
return *this;
}
Vector3& operator-=(const Vector3& other)
{
m_x -= other.m_x;
m_y -= other.m_y;
m_z -= other.m_z;
return *this;
}
Vector3 operator+(const Vector3& other) const
{
return Vector3(m_x + other.m_x, m_y + other.m_y, m_z + other.m_z);