X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2FVector.h;h=6259b97f0cb9a78fab1b389347113b28a94e9a33;hb=7cf057b5b3a28c3896af27cb725fbf0b4f1459c2;hp=0fd5bfe49f84d878a688df600b919b29f8cc367e;hpb=03b142b877e19a2355e1a79e279e024922d44655;p=orbi.git diff --git a/src/graphics/Vector.h b/src/graphics/Vector.h index 0fd5bfe..6259b97 100644 --- a/src/graphics/Vector.h +++ b/src/graphics/Vector.h @@ -164,6 +164,14 @@ constexpr Vector abs(Vector v) { return Vector(std::abs(v.x), std::abs(v.y)); } template +inline Vector round(Vector v) { + return Vector(std::round(v.x), std::round(v.y)); +} +template<> +inline Vector round(Vector v) { + return Vector(std::roundf(v.x), std::roundf(v.y)); +} +template constexpr Vector min(Vector lhs, Vector rhs) { return Vector(std::min(lhs.x, rhs.x), std::min(lhs.y, rhs.y)); }