diff options
Diffstat (limited to 'core/math/math_2d.h')
-rw-r--r-- | core/math/math_2d.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/math/math_2d.h b/core/math/math_2d.h index a24c4266ee..6dd8799ba2 100644 --- a/core/math/math_2d.h +++ b/core/math/math_2d.h @@ -133,6 +133,7 @@ struct Vector2 { bool operator<(const Vector2& p_vec2) const { return (x==p_vec2.x)?(y<p_vec2.y):(x<p_vec2.x); } bool operator<=(const Vector2& p_vec2) const { return (x==p_vec2.x)?(y<=p_vec2.y):(x<=p_vec2.x); } + bool nan_equals(const Vector2& p_vec2) const; real_t angle() const; void set_rotation(real_t p_radians) { @@ -319,6 +320,8 @@ struct Rect2 { bool operator==(const Rect2& p_rect) const { return pos==p_rect.pos && size==p_rect.size; } bool operator!=(const Rect2& p_rect) const { return pos!=p_rect.pos || size!=p_rect.size; } + bool nan_equals(const Rect2& p_rect) const { return pos.nan_equals(p_rect.pos) && size == p_rect.size; } + inline Rect2 grow(real_t p_by) const { Rect2 g=*this; |