diff --git a/Utility.h b/Utility.h index f86385a..1bd6be0 100644 --- a/Utility.h +++ b/Utility.h @@ -6,12 +6,12 @@ static float sign(float x, float y, float x1, float y1, float x2, float y2) return (x - x2) * (y1 - y2) - (x1 - x2) * (y - y2); } -static float sign (Point &p1, Point &p2, Point &p3) +static float sign (const Point &p1, const Point &p2, const Point &p3) { return (p1.x() - p3.x()) * (p2.y() - p3.y()) - (p2.x() - p3.x()) * (p1.y() - p3.y()); } -static bool IsPointInTriangle(Point &pt, Point &p1, Point &p2, Point &p3) +static bool IsPointInTriangle(const Point &pt, const Point &p1, const Point &p2, const Point &p3) { float d1 = sign(pt, p1, p2); float d2 = sign(pt, p2, p3);