#pragma once

namespace OX {

    struct Vec4
    {
        float x{0}, y{0}, z{0}, w{0};

        Vec4() = default;
        Vec4(float _x, float _y, float _z, float _w)
            : x(_x), y(_y), z(_z), w(_w)
        {
        }

        Vec4 &operator+=(const Vec4 &o)
        {
            x += o.x;
            y += o.y;
            z += o.z;
            w += o.w;
            return *this;
        }
        Vec4 &operator-=(const Vec4 &o)
        {
            x -= o.x;
            y -= o.y;
            z -= o.z;
            w -= o.w;
            return *this;
        }
        Vec4 &operator*=(float s)
        {
            x *= s;
            y *= s;
            z *= s;
            w *= s;
            return *this;
        }
        Vec4 &operator/=(float s)
        {
            x /= s;
            y /= s;
            z /= s;
            w /= s;
            return *this;
        }

        friend Vec4 operator+(Vec4 a, const Vec4 &b) { return a += b; }
        friend Vec4 operator-(Vec4 a, const Vec4 &b) { return a -= b; }
        friend Vec4 operator*(Vec4 v, float s) { return v *= s; }
        friend Vec4 operator/(Vec4 v, float s) { return v /= s; }
    };

}
