diff options
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/basis.h | 2 | ||||
-rw-r--r-- | core/math/expression.cpp | 2 | ||||
-rw-r--r-- | core/math/geometry_2d.cpp | 2 | ||||
-rw-r--r-- | core/math/geometry_2d.h | 12 | ||||
-rw-r--r-- | core/math/plane.h | 2 | ||||
-rw-r--r-- | core/math/rect2.cpp | 2 | ||||
-rw-r--r-- | core/math/vector2.cpp | 2 | ||||
-rw-r--r-- | core/math/vector3.cpp | 2 |
8 files changed, 13 insertions, 13 deletions
diff --git a/core/math/basis.h b/core/math/basis.h index 236d666103..2d4994de19 100644 --- a/core/math/basis.h +++ b/core/math/basis.h @@ -223,7 +223,7 @@ struct [[nodiscard]] Basis { static Basis looking_at(const Vector3 &p_target, const Vector3 &p_up = Vector3(0, 1, 0), bool p_use_model_front = false); - Basis(const Quaternion &p_quaternion) { set_quaternion(p_quaternion); }; + Basis(const Quaternion &p_quaternion) { set_quaternion(p_quaternion); } Basis(const Quaternion &p_quaternion, const Vector3 &p_scale) { set_quaternion_scale(p_quaternion, p_scale); } Basis(const Vector3 &p_axis, real_t p_angle) { set_axis_angle(p_axis, p_angle); } diff --git a/core/math/expression.cpp b/core/math/expression.cpp index 0692ece1e6..35303fe9ac 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -1491,7 +1491,7 @@ Error Expression::parse(const String &p_expression, const Vector<String> &p_inpu } Variant Expression::execute(const Array &p_inputs, Object *p_base, bool p_show_error, bool p_const_calls_only) { - ERR_FAIL_COND_V_MSG(error_set, Variant(), "There was previously a parse error: " + error_str + "."); + ERR_FAIL_COND_V_MSG(error_set, Variant(), vformat("There was previously a parse error: %s.", error_str)); execution_error = false; Variant output; diff --git a/core/math/geometry_2d.cpp b/core/math/geometry_2d.cpp index a49826958a..376d5d0b43 100644 --- a/core/math/geometry_2d.cpp +++ b/core/math/geometry_2d.cpp @@ -76,7 +76,7 @@ struct _AtlasWorkRect { Size2i s; Point2i p; int idx = 0; - _FORCE_INLINE_ bool operator<(const _AtlasWorkRect &p_r) const { return s.width > p_r.s.width; }; + _FORCE_INLINE_ bool operator<(const _AtlasWorkRect &p_r) const { return s.width > p_r.s.width; } }; struct _AtlasWorkRectResult { diff --git a/core/math/geometry_2d.h b/core/math/geometry_2d.h index 83ebdc5a84..abd395d8df 100644 --- a/core/math/geometry_2d.h +++ b/core/math/geometry_2d.h @@ -451,17 +451,17 @@ public: return H; } - static Vector<Point2i> bresenham_line(const Point2i &p_start, const Point2i &p_end) { + static Vector<Point2i> bresenham_line(const Point2i &p_from, const Point2i &p_to) { Vector<Point2i> points; - Vector2i delta = (p_end - p_start).abs() * 2; - Vector2i step = (p_end - p_start).sign(); - Vector2i current = p_start; + Vector2i delta = (p_to - p_from).abs() * 2; + Vector2i step = (p_to - p_from).sign(); + Vector2i current = p_from; if (delta.x > delta.y) { int err = delta.x / 2; - for (; current.x != p_end.x; current.x += step.x) { + for (; current.x != p_to.x; current.x += step.x) { points.push_back(current); err -= delta.y; @@ -473,7 +473,7 @@ public: } else { int err = delta.y / 2; - for (; current.y != p_end.y; current.y += step.y) { + for (; current.y != p_to.y; current.y += step.y) { points.push_back(current); err -= delta.x; diff --git a/core/math/plane.h b/core/math/plane.h index 6529fea60a..65783ff4cf 100644 --- a/core/math/plane.h +++ b/core/math/plane.h @@ -40,7 +40,7 @@ struct [[nodiscard]] Plane { real_t d = 0; void set_normal(const Vector3 &p_normal); - _FORCE_INLINE_ Vector3 get_normal() const { return normal; }; + _FORCE_INLINE_ Vector3 get_normal() const { return normal; } void normalize(); Plane normalized() const; diff --git a/core/math/rect2.cpp b/core/math/rect2.cpp index c55226a57e..7f77b0786c 100644 --- a/core/math/rect2.cpp +++ b/core/math/rect2.cpp @@ -283,7 +283,7 @@ next4: } Rect2::operator String() const { - return "[P: " + position.operator String() + ", S: " + size + "]"; + return "[P: " + position.operator String() + ", S: " + size.operator String() + "]"; } Rect2::operator Rect2i() const { diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp index e86b97d6a8..0590ee8a37 100644 --- a/core/math/vector2.cpp +++ b/core/math/vector2.cpp @@ -203,7 +203,7 @@ bool Vector2::is_finite() const { } Vector2::operator String() const { - return "(" + String::num_real(x, false) + ", " + String::num_real(y, false) + ")"; + return "(" + String::num_real(x, true) + ", " + String::num_real(y, true) + ")"; } Vector2::operator Vector2i() const { diff --git a/core/math/vector3.cpp b/core/math/vector3.cpp index 1e90002665..e18ac3b011 100644 --- a/core/math/vector3.cpp +++ b/core/math/vector3.cpp @@ -165,7 +165,7 @@ bool Vector3::is_finite() const { } Vector3::operator String() const { - return "(" + String::num_real(x, false) + ", " + String::num_real(y, false) + ", " + String::num_real(z, false) + ")"; + return "(" + String::num_real(x, true) + ", " + String::num_real(y, true) + ", " + String::num_real(z, true) + ")"; } Vector3::operator Vector3i() const { |