This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static bool Inside(IList<Vector2> polygon, Vector2 position, bool toleranceOnOutside = true) | |
{ | |
Vector2 point = position; | |
const float epsilon = 0.5f; | |
bool inside = false; | |
// Must have 3 or more edges | |
if (polygon.Count < 3) return false; |