#pragma once

namespace core
{
    namespace types
    {

        struct Vec3
        {
            float x{0}, y{0}, z{0};

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

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

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

    }
}
