6 QRectF addBBox(QRectF r1, QRectF r2);
7 bool isInBox(const QPointF &p, const QRectF &box);
9 class ConvexPolygon:public QPolygonF
13 ConvexPolygon (QPolygonF p);
15 QPointF centroid() const;
22 QPointF normalize (const QPointF &p);
25 qreal dotProduct (const QPointF &a, const QPointF &b);
27 QPointF scale (const QPointF &v,const qreal &f);
28 QPointF invert (const QPointF &v);
30 class PolygonCollisionResult {
32 // Are the polygons going to intersect forward in time?
35 // Are the polygons currently intersecting?
38 // The translation to apply to the first polygon to push the polygons apart.
39 QPointF minTranslation;
43 void projectPolygon(QPointF axis, QPolygonF polygon, qreal &min, qreal &max) ;
45 qreal intervalDistance(qreal minA, qreal maxA, qreal minB, qreal maxB);
46 PolygonCollisionResult polygonCollision(QPolygonF polygonA,
47 QPolygonF polygonB, QPointF velocity);