class IShape
{
public:
virtual Vector FarthestPointInDirection(Vector direction) = 0; // pure virtual function
};
class Polygon : public IShape{
...
Vector FarthestPointInDirection(Vector direction) override{
....
}
};
Vector support(IShape& a, IShape& b, Vector direction){
Vector aFar = a.FarthestPointInDirection(direction);
Vector bFar = b.FarthestPointInDirection(direction);
return *aFar.Sub(bFar);
}
CONFIG -= qt
QT += core gui widgets network