#pragma once #include #include "Vector.hpp" struct Rotation { public: Rotation() : vector{} {}; Rotation(Vector<3> vector) : vector{ wrap(vector) } {}; Rotation(float angles[3]) : Rotation(angles[0], angles[1], angles[2]) {}; Rotation(float x, float y, float z) { vector = wrap({ x, y, z }); }; Rotation operator+(Rotation other) const { return wrap(vector + other.vector); } std::string string() const { return vector.string(); } static Vector<3> wrap(Vector<3> v) { return v.apply([=](float a) -> float { return fmod(a, 360.0f); }); } Vector<3> vector; };