public class Polygon extends Object
Constructor and Description |
---|
Polygon()
Create a blank polygon.
|
Modifier and Type | Method and Description |
---|---|
void |
addPoint(double x,
double y)
Add a point to the polygon.
|
boolean |
contains(Rectangle rectangle)
Check if the rectangle contains the other.
|
Collection<Line> |
getPoints()
Get the points.
|
Rectangle |
getRectangle()
Get the polygon rectangle bounds.
|
boolean |
intersects(Rectangle rectangle)
Check if the rectangle intersects the other.
|
void |
reset()
Reset the polygon.
|
public void addPoint(double x, double y)
x
- The horizontal location.y
- The vertical location.public void reset()
public Rectangle getRectangle()
public boolean intersects(Rectangle rectangle)
rectangle
- The rectangle to test with.true
if intersect, false
else.public boolean contains(Rectangle rectangle)
rectangle
- The rectangle to test with.true
if contains, false
else.public Collection<Line> getPoints()
Copyright © 2017 Byron 3D Games Studio. All rights reserved.