Class Circle
java.lang.Object
dev.prozilla.pine.core.rendering.shape.Shape
dev.prozilla.pine.core.rendering.shape.Circle
- All Implemented Interfaces:
Cloneable<Shape>,ColoredDrawable,Drawable,TexturedDrawable
Generates a circular shape.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a new object that is equal to this object.booleanbooleanChecks if the given object is equal to this object.booleanprotected float[]Generates the UV array for this shape.protected float[]Generates the vertex array for this shape.intgetEdges()Returns the amount of edges of this circle.floatReturns the radius of this circle.floatgetX()Returns the x-coordinate of this circle.floatgetY()Returns the y-coordinate of this circle.voidAutomatically sets the amount of edges based on the radius.voidsetEdges(int edges) Sets the amount of edges of this circle.voidsetPosition(Vector2f position) Sets the position of this circle.voidsetRadius(float radius) Sets the radius of this circle.voidsetX(float x) Sets the x-coordinate of this circle.voidsetY(float y) Sets the y-coordinate of this circle.Methods inherited from class dev.prozilla.pine.core.rendering.shape.Shape
addModifier, cloneWithModifiers, draw, generate, getModifier, removeModifierMethods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.prozilla.pine.core.rendering.shape.ColoredDrawable
drawMethods inherited from interface dev.prozilla.pine.core.rendering.shape.TexturedDrawable
draw, draw
-
Field Details
-
position
-
radius
protected float radius -
edges
protected int edges
-
-
Constructor Details
-
Circle
-
Circle
-
-
Method Details
-
generateVertices
protected float[] generateVertices()Description copied from class:ShapeGenerates the vertex array for this shape.Odd elements define the x-component of the vertex and even elements define the y-component.
Every three vertices (or six elements) define a triangle.
- Specified by:
generateVerticesin classShape- Returns:
- The array of vertices.
-
generateUVs
protected float[] generateUVs()Description copied from class:ShapeGenerates the UV array for this shape.Odd elements define the x-component of the texture coordinate and even elements define the y-component.
- Specified by:
generateUVsin classShape- Returns:
- The array of texture coordinates.
-
getX
public float getX()Returns the x-coordinate of this circle.- Returns:
- The x-coordinate of this circle.
-
getY
public float getY()Returns the y-coordinate of this circle.- Returns:
- The y-coordinate of this circle.
-
setX
public void setX(float x) Sets the x-coordinate of this circle.- Parameters:
x- The new x-coordinate
-
setY
public void setY(float y) Sets the y-coordinate of this circle.- Parameters:
y- The new y-coordinate
-
setPosition
Sets the position of this circle.- Parameters:
position- The new position
-
getRadius
public float getRadius()Returns the radius of this circle.- Returns:
- The radius of this circle.
-
setRadius
public void setRadius(float radius) Sets the radius of this circle.- Parameters:
radius- The new radius of this circle
-
getEdges
public int getEdges()Returns the amount of edges of this circle.- Returns:
- The amount of edges.
-
setAutoEdges
public void setAutoEdges()Automatically sets the amount of edges based on the radius. -
setEdges
public void setEdges(int edges) Sets the amount of edges of this circle.- Parameters:
edges- The new amount of edges
-
equals
-
equals
Description copied from interface:CloneableChecks if the given object is equal to this object.- Parameters:
shape- Other object- Returns:
trueif both objects are equal.
-
equals
-
clone
Description copied from interface:CloneableReturns a new object that is equal to this object.
-