summaryrefslogtreecommitdiff
path: root/core/math/vector3.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2020-01-24 16:55:34 +0100
committerGitHub <noreply@github.com>2020-01-24 16:55:34 +0100
commitfeb88ebe6fd8468eb17d597b31d3b5b73196e180 (patch)
tree3fc1e8c3c4ad5e2b353737ae860674acdb13adc0 /core/math/vector3.h
parent97cc2e53f6fbba7e85a2cbb79f38e077a6e511f7 (diff)
parenta002b93d860887a219aa40d7a5cc65fc3a5272c1 (diff)
Merge pull request #35510 from Calinou/add-normalized-error-explanations
Add explanations for errors related to Vector/Quat normalization
Diffstat (limited to 'core/math/vector3.h')
-rw-r--r--core/math/vector3.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/vector3.h b/core/math/vector3.h
index 9bf7c41729..4ad3017109 100644
--- a/core/math/vector3.h
+++ b/core/math/vector3.h
@@ -454,7 +454,7 @@ void Vector3::zero() {
// slide returns the component of the vector along the given plane, specified by its normal vector.
Vector3 Vector3::slide(const Vector3 &p_normal) const {
#ifdef MATH_CHECKS
- ERR_FAIL_COND_V(!p_normal.is_normalized(), Vector3());
+ ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 must be normalized.");
#endif
return *this - p_normal * this->dot(p_normal);
}
@@ -465,7 +465,7 @@ Vector3 Vector3::bounce(const Vector3 &p_normal) const {
Vector3 Vector3::reflect(const Vector3 &p_normal) const {
#ifdef MATH_CHECKS
- ERR_FAIL_COND_V(!p_normal.is_normalized(), Vector3());
+ ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 must be normalized.");
#endif
return 2.0 * p_normal * this->dot(p_normal) - *this;
}