mirror of https://github.com/AxioDL/zeus.git
CVector2f-CVector2i interop
This commit is contained in:
parent
88769bded0
commit
0fc3e5e9ca
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "Global.hpp"
|
#include "Global.hpp"
|
||||||
#include "zeus/Math.hpp"
|
#include "zeus/Math.hpp"
|
||||||
|
#include "CVector2f.hpp"
|
||||||
|
|
||||||
#if ZE_ATHENA_TYPES
|
#if ZE_ATHENA_TYPES
|
||||||
#include <athena/IStreamReader.hpp>
|
#include <athena/IStreamReader.hpp>
|
||||||
|
@ -22,6 +23,9 @@ public:
|
||||||
};
|
};
|
||||||
CVector2i() = default;
|
CVector2i() = default;
|
||||||
CVector2i(int xin, int yin) : x(xin), y(yin) {}
|
CVector2i(int xin, int yin) : x(xin), y(yin) {}
|
||||||
|
CVector2i(const CVector2f& vec) : x(int(vec.x)), y(int(vec.y)) {}
|
||||||
|
|
||||||
|
CVector2f toVec2f() const { return CVector2f(x, y); }
|
||||||
|
|
||||||
inline CVector2i operator+(const CVector2i& val) const
|
inline CVector2i operator+(const CVector2i& val) const
|
||||||
{
|
{
|
||||||
|
@ -47,6 +51,10 @@ public:
|
||||||
{
|
{
|
||||||
return x != other.x || y != other.y;
|
return x != other.x || y != other.y;
|
||||||
}
|
}
|
||||||
|
inline CVector2i operator*(int val) const
|
||||||
|
{
|
||||||
|
return CVector2i(x * val, y * val);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue