Class Rectangle

    • Constructor Detail

      • Rectangle

        public Rectangle​(SizeBox s)
    • Method Detail

      • render

        public void render​(GralogGraphicsContext gc,
                           Vector2D center,
                           java.lang.String label,
                           GralogColor strokeColor,
                           GralogColor fillColor)
        Description copied from class: RenderingShape
        Renders a shape on the provided graphics context. RenderingShape will depend on the internal state of the shape object (e.g. parameters such as size, fill, color, etc..)
        Overrides:
        render in class RenderingShape
        Parameters:
        gc - The graphics context on which the shape is rendered
        strokeColor - Stroke color
        fillColor - Filling color
      • containsCoordinate

        public boolean containsCoordinate​(Vector2D point,
                                          Vector2D center)
        Description copied from class: RenderingShape
        Returns true if the given vector is overlapping with this shape
        Specified by:
        containsCoordinate in class RenderingShape
        Parameters:
        point - Vector that is being tested for overlapping
        Returns:
        True if the shape contains
      • getEdgePoint

        public Vector2D getEdgePoint​(double alpha,
                                     Vector2D center)
        Description copied from class: RenderingShape
        Calculates the (closest) point X on the edge of the shape so that (X-center) has an euler angle of alpha.
        Specified by:
        getEdgePoint in class RenderingShape
        Parameters:
        alpha - The angle of the point in degrees
        center - The point of reference for calculating X
        Returns:
        The closest such point as a Vector2D
      • getIntersection

        public Vector2D getIntersection​(Vector2D a,
                                        Vector2D b,
                                        Vector2D center)
        Description copied from class: RenderingShape
        Calculates the point of intersection between a line and the shape (Basically a RayCast)
        Specified by:
        getIntersection in class RenderingShape
        Parameters:
        a - Start of the line
        b - The end of the line INSIDE the shape. For a normal edge calculation, lineEnd = center
        center - The center of the object with this shape