22 #ifndef BLADERUNNER_RECT_FLOAT_H 23 #define BLADERUNNER_RECT_FLOAT_H 25 #include "common/debug.h" 26 #include "common/types.h" 27 #include "common/util.h" 28 #include "math/utils.h" 39 : x0(0.0f), y0(0.0f), x1(0.0f), y1(0.0f)
41 RectFloat(
float x0_,
float y0_,
float x1_,
float y1_)
42 : x0(x0_), y0(y0_), x1(x1_), y1(y1_)
45 void expand(
float d) {
52 void trunc_2_decimals() {
53 x0 = Math::trunc(x0 * 100.0f) / 100.0f;
54 y0 = Math::trunc(y0 * 100.0f) / 100.0f;
55 x1 = Math::trunc(x1 * 100.0f) / 100.0f;
56 y1 = Math::trunc(y1 * 100.0f) / 100.0f;
61 return !(a.y1 < b.y0 || a.y0 > b.y1 || a.x0 > b.x1 || a.x1 < b.x0);
66 c.x0 =
MIN(a.x0, b.x0);
67 c.y0 =
MIN(a.y0, b.y0);
68 c.x1 =
MAX(a.x1, b.x1);
69 c.y1 =
MAX(a.y1, b.y1);
T MIN(T a, T b)
Definition: util.h:59
Definition: rect_float.h:32
T MAX(T a, T b)
Definition: util.h:62