mirror of
https://github.com/AxioDL/zeus.git
synced 2025-07-01 19:03:32 +00:00
CVector2f-CVector2i interop
This commit is contained in:
parent
88769bded0
commit
0fc3e5e9ca
@ -2,6 +2,7 @@
|
||||
|
||||
#include "Global.hpp"
|
||||
#include "zeus/Math.hpp"
|
||||
#include "CVector2f.hpp"
|
||||
|
||||
#if ZE_ATHENA_TYPES
|
||||
#include <athena/IStreamReader.hpp>
|
||||
@ -22,6 +23,9 @@ public:
|
||||
};
|
||||
CVector2i() = default;
|
||||
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
|
||||
{
|
||||
@ -47,6 +51,10 @@ public:
|
||||
{
|
||||
return x != other.x || y != other.y;
|
||||
}
|
||||
inline CVector2i operator*(int val) const
|
||||
{
|
||||
return CVector2i(x * val, y * val);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user