diff --git a/src/math/vector.cpp b/src/core/math/vector.cpp similarity index 99% rename from src/math/vector.cpp rename to src/core/math/vector.cpp index 6566de2..b8b44e9 100644 --- a/src/math/vector.cpp +++ b/src/core/math/vector.cpp @@ -4,6 +4,7 @@ #define VECTOR_EPSILON 0.00001f +namespace ce { Vecf::Vecf(float x, float y) : x{x}, y{y} {} @@ -99,3 +100,4 @@ void Vecf::scale(float x, float y) { void Vecf::scale(Vecf const &factors) { this->scale(factors.x, factors.y); } +} diff --git a/src/math/vector.hpp b/src/core/math/vector.hpp similarity index 99% rename from src/math/vector.hpp rename to src/core/math/vector.hpp index a7daefe..e8ea656 100644 --- a/src/math/vector.hpp +++ b/src/core/math/vector.hpp @@ -4,7 +4,10 @@ #include #include +namespace ce { struct Vecf { + float x{0.f}, y{0.f}; + Vecf() = default; Vecf(float x, float y); Vecf(std::initializer_list members); @@ -49,8 +52,6 @@ struct Vecf { void scale(float x, float y); //! scale vector member-wise void scale(Vecf const &factors); - - float x{0.f}, y{0.f}; }; static inline @@ -97,5 +98,6 @@ static inline Vecf &operator/=(Vecf &lhs, float rhs) { return lhs = lhs * rhs; } +} #endif // !VECTOR_MATH_HPP