summaryrefslogtreecommitdiffstats
path: root/core/math/vector3.h
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2024-01-17 17:30:04 +0100
committerHugo Locurcio <hugo.locurcio@hugo.pro>2024-01-28 18:45:46 +0100
commit0437db0106374ca42b0081e46954e72208b5b30b (patch)
tree5cb53b16aa670326a2c26897976feed4d5fc8347 /core/math/vector3.h
parent17e7f85c06366b427e5068c5b3e2940e27ff5f1d (diff)
downloadredot-engine-0437db0106374ca42b0081e46954e72208b5b30b.tar.gz
Display values in vector/quaternion math function errors
This can help track down the source of the error more easily.
Diffstat (limited to 'core/math/vector3.h')
-rw-r--r--core/math/vector3.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/math/vector3.h b/core/math/vector3.h
index 18943a820f..7551b21493 100644
--- a/core/math/vector3.h
+++ b/core/math/vector3.h
@@ -33,8 +33,8 @@
#include "core/error/error_macros.h"
#include "core/math/math_funcs.h"
+#include "core/string/ustring.h"
-class String;
struct Basis;
struct Vector2;
struct Vector3i;
@@ -512,7 +512,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_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 must be normalized.");
+ ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 " + p_normal.operator String() + " must be normalized.");
#endif
return *this - p_normal * this->dot(p_normal);
}
@@ -523,7 +523,7 @@ Vector3 Vector3::bounce(const Vector3 &p_normal) const {
Vector3 Vector3::reflect(const Vector3 &p_normal) const {
#ifdef MATH_CHECKS
- ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 must be normalized.");
+ ERR_FAIL_COND_V_MSG(!p_normal.is_normalized(), Vector3(), "The normal Vector3 " + p_normal.operator String() + " must be normalized.");
#endif
return 2.0f * p_normal * this->dot(p_normal) - *this;
}