diff options
Diffstat (limited to 'core/math/math_2d.cpp')
| -rw-r--r-- | core/math/math_2d.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/core/math/math_2d.cpp b/core/math/math_2d.cpp index d2e410199..a053ffbd9 100644 --- a/core/math/math_2d.cpp +++ b/core/math/math_2d.cpp @@ -98,14 +98,19 @@ real_t Vector2::cross(const Vector2 &p_other) const { return x * p_other.y - y * p_other.x; } -Vector2 Vector2::cross(real_t p_other) const { +Vector2 Vector2::floor() const { - return Vector2(p_other * y, -p_other * x); + return Vector2(Math::floor(x), Math::floor(y)); } -Vector2 Vector2::floor() const { +Vector2 Vector2::ceil() const { - return Vector2(Math::floor(x), Math::floor(y)); + return Vector2(Math::ceil(x), Math::ceil(y)); +} + +Vector2 Vector2::round() const { + + return Vector2(Math::round(x), Math::round(y)); } Vector2 Vector2::rotated(real_t p_by) const { |
