summaryrefslogtreecommitdiff
path: root/core/math/vector2.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/math/vector2.h')
-rw-r--r--core/math/vector2.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/core/math/vector2.h b/core/math/vector2.h
index 1dec830821..ba5558102f 100644
--- a/core/math/vector2.h
+++ b/core/math/vector2.h
@@ -311,10 +311,15 @@ struct Vector2i {
bool operator<(const Vector2i &p_vec2) const { return (x == p_vec2.x) ? (y < p_vec2.y) : (x < p_vec2.x); }
bool operator>(const Vector2i &p_vec2) const { return (x == p_vec2.x) ? (y > p_vec2.y) : (x > p_vec2.x); }
+ bool operator<=(const Vector2i &p_vec2) const { return x == p_vec2.x ? (y <= p_vec2.y) : (x < p_vec2.x); }
+ bool operator>=(const Vector2i &p_vec2) const { return x == p_vec2.x ? (y >= p_vec2.y) : (x > p_vec2.x); }
+
bool operator==(const Vector2i &p_vec2) const;
bool operator!=(const Vector2i &p_vec2) const;
- real_t get_aspect() const { return width / (real_t)height; }
+ real_t aspect() const { return width / (real_t)height; }
+ Vector2i sign() const { return Vector2i(SGN(x), SGN(y)); }
+ Vector2i abs() const { return Vector2i(ABS(x), ABS(y)); }
operator String() const { return String::num(x) + ", " + String::num(y); }