geometry.h
changeset 662 9abdd5e6c3dc
parent 656 53ef954e90b6
child 754 db0ec4bcf416
     1.1 --- a/geometry.h	Fri Feb 01 15:28:35 2008 +0000
     1.2 +++ b/geometry.h	Fri Feb 01 15:28:35 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