[3.x] Make is_equal_approx have explicit float and double versions

This commit is contained in:
Aaron Franke
2021-05-20 06:26:45 -04:00
parent 65ba193ae8
commit 1154b6264c
6 changed files with 35 additions and 9 deletions

View File

@@ -59,7 +59,7 @@ Vector2 Vector2::normalized() const {
bool Vector2::is_normalized() const {
// use length_squared() instead of length() to avoid sqrt(), makes it more stringent.
return Math::is_equal_approx(length_squared(), 1.0, UNIT_EPSILON);
return Math::is_equal_approx(length_squared(), 1, (real_t)UNIT_EPSILON);
}
real_t Vector2::distance_to(const Vector2 &p_vector2) const {