// 02111-1307, USA.
#include <config.h>
-#include "collision.h"
+#include "collision.hpp"
#include <algorithm>
#include <iostream>
#include <stdio.h>
#include <float.h>
#include <math.h>
-#include "math/vector.h"
-#include "math/aatriangle.h"
-#include "math/rect.h"
-#include "collision_hit.h"
+#include "math/vector.hpp"
+#include "math/aatriangle.hpp"
+#include "math/rect.hpp"
+#include "collision_hit.hpp"
static const float DELTA = .0001;
bool
+Collision::intersects(const Rect& r1, const Rect& r2)
+{
+ if(r1.p2.x < r2.p1.x || r1.p1.x > r2.p2.x)
+ return false;
+ if(r1.p2.y < r2.p1.y || r1.p1.y > r2.p2.y)
+ return false;
+
+ return true;
+}
+
+bool
Collision::rectangle_rectangle(CollisionHit& hit, const Rect& r1,
const Vector& movement, const Rect& r2)
{