Skip to content

Commit

Permalink
feat(game.particle): methods for drawing particle star polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Oct 15, 2022
1 parent 8555cf6 commit d206d43
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -22,16 +22,22 @@ public static void drawLine(ParticlePainterOptions options, Vec3 start, Vec3 end
}
}

public static void drawPolygon(ParticlePainterOptions options, Vec3[] vertexes) {
for (int i = 0, l = vertexes.length; i < l; ++i) {
drawLine(options, vertexes[i], vertexes[(i + 1 == l) ? 0 : i + 1]);
public static void drawPolygon(ParticlePainterOptions options, Vec3[] vertices) {
for (int i = 0, l = vertices.length; i < l; ++i) {
drawLine(options, vertices[i], vertices[(i + 1 == l) ? 0 : i + 1]);
}
}

public static void drawPolygon(ParticlePainterOptions options, Vec3 centre, Vec3 normalVector, double circumradius, double centralAngle) {
drawPolygon(options, ShapeUtils.createRegularPolygon(centre, normalVector, circumradius, centralAngle));
}

public static void drawStarPolygon(ParticlePainterOptions options, Vec3 centre, Vec3 normalVector, double circumradius, int points) {
for (var l : ShapeUtils.createStarPolygon(centre, normalVector, circumradius, points)) {
drawLine(options, l[0], l[1]);
}
}

public static void drawCircle(ParticlePainterOptions options, Vec3 centre, Vec3 normalVector, double radius, double deltaAngle) {
for (var p : ShapeUtils.createRegularPolygon(centre, normalVector, radius, deltaAngle)) {
drawPoint(options, p.x, p.y, p.z);
Expand Down

0 comments on commit d206d43

Please sign in to comment.