// Returns true if (px, py) intersects our object bool TouchRectangle::Hit(int px, int py) const{ float rads = PI * rotation / 180.f; std::pair local_coords(rotateAboutPoint(px, py, x, y, rads)); if (abs(local_coords.first - x) <= width * scale / 2){ if (abs(local_coords.second - y) <= width * scale / 2){ return true; } } return false; }