Rectangle

public class Rectangle implements Iterable<Position2D>

Construct a new rectangular shape that exists of 2 positions (2d)

Constructors

Link copied to clipboard
public void Rectangle(Position2D min, Position2D max)

Properties

Link copied to clipboard
public Position2D max
Link copied to clipboard
public Position2D min

Functions

Link copied to clipboard
public boolean contains(Position2D position)
Returns true if the given Position is located within the bounds of this cuboid.
Link copied to clipboard
Return all positions contained within this cuboid
Link copied to clipboard
public void forEach(Consumer<? super T> action)
Link copied to clipboard
public Position2D getMax()
Link copied to clipboard
public Position2D getMin()
Link copied to clipboard
public double getWidthX()
Returns the cuboid width on the X axis
Link copied to clipboard
public double getWidthZ()
Returns the cuboid width on the Z axis
Link copied to clipboard
public Rectangle grow(double delta)
Returns a grown version of this cuboid
public Rectangle grow(double x, double y, double z)
Return a grown version of this cuboid
Link copied to clipboard
Link copied to clipboard
Returns a random position from this Cuboid
Link copied to clipboard
public void setMax(Position2D max)
Link copied to clipboard
public void setMin(Position2D min)
Link copied to clipboard
public Rectangle shrink(double delta)
Returns a shrunken version of this cuboid
public Rectangle shrink(double x, double y, double z)
Return a shrunken version of this cuboid
Link copied to clipboard
Link copied to clipboard
public String toString()