diff -r 53ef954e90b6 -r d2a9c31353f7 geometry.h --- a/geometry.h Wed Jan 16 15:45:19 2008 +0000 +++ b/geometry.h Mon Jul 14 11:21:10 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