Package buildengine.math.shape
Class Polygon
java.lang.Object
buildengine.math.shape.Shape
buildengine.math.shape.Polygon
Polygon
All not-round shapes. For example a triangle.
- Author:
- Kai v. Maurik
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected double
protected final Vector2f[]
Vertices of the Polygon.static final int
Default vertices length -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionVector2f[]
getAxes()
Gets the normalized axes of every edge of the Polygon.double
Vector2f[]
Project vertices on an axisvoid
setRotation
(double rotation) Methods inherited from class buildengine.math.shape.Shape
getCenter, getDiameter
-
Field Details
-
VERTICES_LENGTH
public static final int VERTICES_LENGTHDefault vertices length- See Also:
-
vertices
Vertices of the Polygon. The vertices are to be CW(Counter-Clockwise) defined. -
rotation
protected double rotation
-
-
Constructor Details
-
Polygon
- Parameters:
vertices
- Specifies how many cords the Polygon consists of.center
- The default center for rotation calculations.
-
Polygon
- Parameters:
vertices
- Specifies how many cords the Polygon consists of.center
- The default center for rotation calculations.rotation
- The rotation of the object.
-
-
Method Details
-
project
Project vertices on an axis- Returns:
- A new Projection object.
- See Also:
-
getAxes
Gets the normalized axes of every edge of the Polygon. This is used in for collision detection.- Returns:
- axes of all edges.
-
getVertices
- Returns:
- vertices of Polygon
-
getRotation
public double getRotation() -
setRotation
public void setRotation(double rotation)
-