diff -r 53ef954e90b6 -r 459110777aaf geometry.h --- a/geometry.h Wed Jan 16 15:45:19 2008 +0000 +++ b/geometry.h Wed Feb 27 16:09:06 2008 +0000 @@ -10,4 +10,25 @@ QPointF normalize (const QPointF &p); + +qreal dotProduct (const QPointF &a, const QPointF &b); + +class PolygonCollisionResult { +public: + // Are the polygons going to intersect forward in time? + bool willIntersect; + + // Are the polygons currently intersecting? + bool intersect; + + // The translation to apply to the first polygon to push the polygons apart. + QPointF minTranslation; +}; + + +void ProjectPolygon(QPointF axis, QPolygonF polygon, qreal &min, qreal &max) ; +qreal intervalDistance(qreal minA, qreal maxA, qreal minB, qreal maxB); +PolygonCollisionResult PolygonCollision(QPolygonF polygonA, + QPolygonF polygonB, QPointF velocity); + #endif