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
FieldsModifier and TypeFieldDescriptionfloatstatic final intfloatfloatfloat -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanVector2f[]getAxes()Gets the normalized axes of every edge of the Polygon.floatVector2f[]Translates bounds to vertices.floatgetWidth()floatgetX()floatgetY()booleanintersects(Rectangle with) booleanintersectsLazy(Rectangle with) voidsetHeight(float height) voidsetWidth(float width) voidsetX(float x) voidsetY(float y) Methods inherited from class buildengine.math.shape.Polygon
getRotation, project, setRotationMethods 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:
getVerticesin 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)
-