[Core] Approximate equality

This commit is contained in:
Aaron Franke
2019-04-25 13:19:14 -04:00
parent cce2e4b07c
commit b2e1c9c276
6 changed files with 34 additions and 26 deletions

View File

@@ -110,7 +110,7 @@ bool Plane::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3
real_t den = normal.dot(segment);
//printf("den is %i\n",den);
if (Math::abs(den) <= CMP_EPSILON) {
if (Math::is_zero_approx(den)) {
return false;
}
@@ -135,7 +135,7 @@ bool Plane::intersects_segment(const Vector3 &p_begin, const Vector3 &p_end, Vec
real_t den = normal.dot(segment);
//printf("den is %i\n",den);
if (Math::abs(den) <= CMP_EPSILON) {
if (Math::is_zero_approx(den)) {
return false;
}