summaryrefslogtreecommitdiffstats
path: root/core/math/vector3.h
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2020-01-24 13:51:25 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2020-01-24 14:19:23 +0100
commita002b93d860887a219aa40d7a5cc65fc3a5272c1 (patch)
tree3fc1e8c3c4ad5e2b353737ae860674acdb13adc0 /core/math/vector3.h
parent97cc2e53f6fbba7e85a2cbb79f38e077a6e511f7 (diff)
downloadredot-engine-a002b93d860887a219aa40d7a5cc65fc3a5272c1.tar.gz
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;
}