isLinesShadowOver static method
Rapid rejection experiment
Determine whether the projections of the line segment a
~b
and the line segment c
~d
on the x-axis and y-axis have a common area
Implementation
static bool isLinesShadowOver(Vector2 a, Vector2 b, Vector2 c, Vector2 d) {
if (min(a.x, b.x) > max(c.x, d.x) ||
min(c.x, d.x) > max(a.x, b.x) ||
min(a.y, b.y) > max(c.y, d.y) ||
min(c.y, d.y) > max(a.y, b.y)) {
return false;
}
return true;
}