Package buildengine.math.shape
Class Rectangle
java.lang.Object
buildengine.math.shape.Shape
buildengine.math.shape.Polygon
buildengine.math.shape.Rectangle
- Author:
- Kai v. Maurik
-
Field Summary
Modifier and TypeFieldDescriptionfloat
static final int
float
float
float
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Vector2f[]
getAxes()
Gets the normalized axes of every edge of the Polygon.float
Vector2f[]
Translates bounds to vertices.float
getWidth()
float
getX()
float
getY()
boolean
intersects
(Rectangle with) boolean
intersectsLazy
(Rectangle with) void
setHeight
(float height) void
setWidth
(float width) void
setX
(float x) void
setY
(float y) Methods inherited from class buildengine.math.shape.Polygon
getRotation, project, setRotation
Methods inherited from class buildengine.math.shape.Shape
getDiameter
-
Field Details
-
VERTICES_LENGTH
public static final int VERTICES_LENGTH- See Also:
-
x
public float x -
y
public float y -
width
public float width -
height
public float height
-
-
Constructor Details
-
Rectangle
public Rectangle(float width, float height) -
Rectangle
public Rectangle(float x, float y, float width, float height) -
Rectangle
public Rectangle(float x, float y, float width, float height, double rotation)
-
-
Method Details
-
contains
-
intersects
-
intersectsLazy
-
getVertices
Translates bounds to vertices.- Overrides:
getVertices
in classPolygon
- Returns:
- vertices of rectangle
-
getAxes
Gets the normalized axes of every edge of the Polygon. This is used in for collision detection. Because this is a Rectangle object, only 2 axes are required to check. -
getCenter
-
getWidth
public float getWidth() -
setWidth
public void setWidth(float width) -
getHeight
public float getHeight() -
setHeight
public void setHeight(float height) -
getX
public float getX() -
setX
public void setX(float x) -
getY
public float getY() -
setY
public void setY(float y)
-