mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:37:35 +00:00
LibGfx: Add some missing operators to Vector3 Vector4 and Matrix4x4
This commit is contained in:
parent
0c5d61ae88
commit
09f850728a
3 changed files with 53 additions and 0 deletions
|
@ -31,6 +31,24 @@ public:
|
|||
void set_z(T value) { m_z = value; }
|
||||
void set_w(T value) { m_w = value; }
|
||||
|
||||
Vector4& operator+=(const Vector4& other)
|
||||
{
|
||||
m_x += other.m_x;
|
||||
m_y += other.m_y;
|
||||
m_z += other.m_z;
|
||||
m_w += other.m_w;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vector4& operator-=(const Vector4& other)
|
||||
{
|
||||
m_x -= other.m_x;
|
||||
m_y -= other.m_y;
|
||||
m_z -= other.m_z;
|
||||
m_w -= other.m_w;
|
||||
return *this;
|
||||
}
|
||||
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue