summaryrefslogtreecommitdiffstats
path: root/core/math/rect2.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/math/rect2.h')
-rw-r--r--core/math/rect2.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/math/rect2.h b/core/math/rect2.h
index 497ed8cf04..7f410feb1c 100644
--- a/core/math/rect2.h
+++ b/core/math/rect2.h
@@ -307,14 +307,14 @@ struct _NO_DISCARD_ Rect2 {
i_f = i;
Vector2 r = (b - a);
- float l = r.length();
+ const real_t l = r.length();
if (l == 0.0f) {
continue;
}
// Check inside.
Vector2 tg = r.orthogonal();
- float s = tg.dot(center) - tg.dot(a);
+ const real_t s = tg.dot(center) - tg.dot(a);
if (s < 0.0f) {
side_plus++;
} else {
@@ -330,8 +330,8 @@ struct _NO_DISCARD_ Rect2 {
Vector2 t13 = (position - a) * ir;
Vector2 t24 = (end - a) * ir;
- float tmin = MAX(MIN(t13.x, t24.x), MIN(t13.y, t24.y));
- float tmax = MIN(MAX(t13.x, t24.x), MAX(t13.y, t24.y));
+ const real_t tmin = MAX(MIN(t13.x, t24.x), MIN(t13.y, t24.y));
+ const real_t tmax = MIN(MAX(t13.x, t24.x), MAX(t13.y, t24.y));
// if tmax < 0, ray (line) is intersecting AABB, but the whole AABB is behind us
if (tmax < 0 || tmin > tmax || tmin >= l) {