Closed DarkRewar closed 4 weeks ago
IsPointInsidePolygon(Vector2 point, Vector2[] polygon)
Check if a point is inside a polygon (determined by a list of Vector2). Also exists for Vector2Int by using IsPointInsidePolygon(Vector2Int point, Vector2Int[] polygon).
Vector2
Vector2Int
IsPointInsidePolygon(Vector2Int point, Vector2Int[] polygon)
using BaseTool; List<Vector2> square = new() { new(0, 0), new(0, 1), new(1, 1), new(1, 0) }; MathUtils.IsPointInsidePolygon(new Vector2(0.5f, 0.5f), points)); // true MathUtils.IsPointInsidePolygon(new Vector2(-1, -1), points)); // false
Note: currently, there are no Vector3 equivalent.
Vector3
closes #108
IsPointInsidePolygon(Vector2 point, Vector2[] polygon)
Check if a point is inside a polygon (determined by a list of
Vector2
). Also exists forVector2Int
by usingIsPointInsidePolygon(Vector2Int point, Vector2Int[] polygon)
.Note: currently, there are no
Vector3
equivalent.closes #108