Package 

Class Polygon

  • All Implemented Interfaces:

    
    public final class Polygon
    extends Shape
                        

    Class for representing polygon shape.

    • Constructor Detail

      • Polygon

        Polygon(Array<Vec2> vertList)
        Constructor takes a supplied list of vertices and generates a convex hull around them.
        Parameters:
        vertList - Vertices of polygon to create.
      • Polygon

        Polygon(Double width, Double height)
        Constructor to generate a rectangle.
        Parameters:
        width - Desired width of rectangle
        height - Desired height of rectangle
      • Polygon

        Polygon(Integer radius, Integer noOfSides)
        Generate a regular polygon with a specified number of sides and size.
        Parameters:
        radius - The maximum distance any vertex is away from the center of mass.
        noOfSides - The desired number of face the polygon has.