diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-29 13:16:51 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-29 13:16:51 +0100 |
commit | 269145f48a13a943f52d67a20d9aa7b075f1e0db (patch) | |
tree | 414179012a354bb78c18204c2408eb25081549af /core/math/vector2.cpp | |
parent | 440d8cd989c484e5b3bee7f733574a92376d98c9 (diff) | |
parent | 0437db0106374ca42b0081e46954e72208b5b30b (diff) | |
download | redot-engine-269145f48a13a943f52d67a20d9aa7b075f1e0db.tar.gz |
Merge pull request #87300 from Calinou/math-normalize-error-show-value
Display values in vector/quaternion math function errors
Diffstat (limited to 'core/math/vector2.cpp')
-rw-r--r-- | core/math/vector2.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/vector2.cpp b/core/math/vector2.cpp index df8c804243..9982415b97 100644 --- a/core/math/vector2.cpp +++ b/core/math/vector2.cpp @@ -162,7 +162,7 @@ Vector2 Vector2::move_toward(const Vector2 &p_to, const real_t p_delta) const { // slide returns the component of the vector along the given plane, specified by its normal vector. Vector2 Vector2::slide(const Vector2 &p_normal) const { #ifdef MATH_CHECKS - ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector2(), "The normal Vector2 must be normalized."); + ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector2(), "The normal Vector2 " + p_normal.operator String() + "must be normalized."); #endif return *this - p_normal * this->dot(p_normal); } @@ -173,7 +173,7 @@ Vector2 Vector2::bounce(const Vector2 &p_normal) const { Vector2 Vector2::reflect(const Vector2 &p_normal) const { #ifdef MATH_CHECKS - ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector2(), "The normal Vector2 must be normalized."); + ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector2(), "The normal Vector2 " + p_normal.operator String() + "must be normalized."); #endif return 2.0f * p_normal * this->dot(p_normal) - *this; } |