1.1 --- a/geometry.h Wed Jan 16 15:45:19 2008 +0000
1.2 +++ b/geometry.h Mon Jul 14 11:25:09 2008 +0000
1.3 @@ -10,4 +10,25 @@
1.4
1.5 QPointF normalize (const QPointF &p);
1.6
1.7 +
1.8 +qreal dotProduct (const QPointF &a, const QPointF &b);
1.9 +
1.10 +class PolygonCollisionResult {
1.11 +public:
1.12 + // Are the polygons going to intersect forward in time?
1.13 + bool willIntersect;
1.14 +
1.15 + // Are the polygons currently intersecting?
1.16 + bool intersect;
1.17 +
1.18 + // The translation to apply to the first polygon to push the polygons apart.
1.19 + QPointF minTranslation;
1.20 +};
1.21 +
1.22 +
1.23 +void ProjectPolygon(QPointF axis, QPolygonF polygon, qreal &min, qreal &max) ;
1.24 +qreal intervalDistance(qreal minA, qreal maxA, qreal minB, qreal maxB);
1.25 +PolygonCollisionResult PolygonCollision(QPolygonF polygonA,
1.26 + QPolygonF polygonB, QPointF velocity);
1.27 +
1.28 #endif