protected List<Vec2D> createInsidePoints(Polygon2D poly, Rect bounds) { List<Vec2D> points = new ArrayList<Vec2D>(); for (float y = bounds.y; y < bounds.getBottom(); y += res) { float yy = MathUtils.roundTo(y, res); for (float x = bounds.x; x < bounds.getRight(); x += res) { Vec2D p = new Vec2D(MathUtils.roundTo(x, res), yy); if (poly.containsPoint(p)) { points.add(p); } } } return points; }