Split is_equal_approx into float and double versions to match Godot

https://github.com/godotengine/godot/pull/48882
This commit is contained in:
Aaron Franke
2022-09-18 17:37:31 -05:00
parent 3450a1ab16
commit 942cd466ed
3 changed files with 38 additions and 12 deletions

View File

@@ -110,7 +110,7 @@ bool Basis::is_diagonal() const {
}
bool Basis::is_rotation() const {
return Math::is_equal_approx(determinant(), 1, UNIT_EPSILON) && is_orthogonal();
return Math::is_equal_approx(determinant(), (real_t)1, (real_t)UNIT_EPSILON) && is_orthogonal();
}
#ifdef MATH_CHECKS

View File

@@ -86,7 +86,7 @@ Quaternion Quaternion::normalized() const {
}
bool Quaternion::is_normalized() const {
return Math::is_equal_approx(length_squared(), 1.0, UNIT_EPSILON); //use less epsilon
return Math::is_equal_approx(length_squared(), (real_t)1.0, (real_t)UNIT_EPSILON); //use less epsilon
}
Quaternion Quaternion::inverse() const {