#ifdef MATH_CHECKS
ERR_FAIL_COND_V_MSG(!is_rotation(), Quaternion(), "Basis must be normalized in order to be casted to a Quaternion. Use get_rotation_quaternion() or call orthonormalized() if the Basis contains linearly independent vectors.");
#endif
We have implemented those checks, but they are done in require blocks:
require(isRotation()) {
"Basis must be normalized in order to be casted to a Quaternion. Use get_rotation_quat() or call orthonormalized() instead."
}
Some of those checks can be really expensive to compute, sometimes even the costliest part of the method. I want to leverage the new debug preprocessor to surround the relevant require blocks with if(DEBUG).
It's a very straightforward work, but it has to be done across all methods in core types which can be time-consuming. We can't blindly wrap all "require" blocks as all of them are not necessarily coming from a MATH_CHECK C++ block.
The C++ code is full of blocks like this:
We have implemented those checks, but they are done in require blocks:
Some of those checks can be really expensive to compute, sometimes even the costliest part of the method. I want to leverage the new debug preprocessor to surround the relevant
require
blocks withif(DEBUG)
. It's a very straightforward work, but it has to be done across all methods in core types which can be time-consuming. We can't blindly wrap all "require" blocks as all of them are not necessarily coming from a MATH_CHECK C++ block.