public DrawablePolygon(TextMap parent, List <LineDef> input) { lines = DrawUtils.LineUpVerts(input); if (lines.Count < 3) { return; } vecs = new List <Vector2>(); for (var i = 0; i < input.Count; i++) { vecs.Add(DrawUtils.LineToVec2(input[i])); } //make vecs ccw if (VecsAreClockwise()) { vecs.Reverse(); } triangles = DrawUtils.GetTriangles(vecs); }
public bool ContainsPoint(float x, float y) { return(DrawUtils.PointInTriangle(new Vector2(x, y), points)); }