Class Vertex
java.lang.Object
xyz.gmitch215.socketmc.util.render.Vertex
- All Implemented Interfaces:
Serializable
Utility class for representing a vertex in 2D space, with a Z index.
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
ZERO
Represents a Vertex at the origin with a Z index of 0. -
ZERO_BACK
Represents a Vertex at the origin with the lowest possible Z index.
-
-
Constructor Details
-
Vertex
public Vertex()Creates a new vertex at the origin. -
Vertex
public Vertex(int x, int y) Creates a new vertex.- Parameters:
x
- The X coordinate.y
- The Y coordinate.
-
Vertex
public Vertex(int x, int y, int zIndex) Creates a new vertex.- Parameters:
x
- The X coordinate.y
- The Y coordinate.zIndex
- The Z index on the screen.
-
-
Method Details
-
getX
public int getX()Gets the X coordinate.- Returns:
- The X coordinate.
-
setX
public void setX(int x) Sets the X coordinate.- Parameters:
x
- The X coordinate.
-
getY
public int getY()Gets the Y coordinate.- Returns:
- The Y coordinate.
-
setY
public void setY(int y) Sets the Y coordinate.- Parameters:
y
- The Y coordinate.
-
getZ
public int getZ()Gets the Z index on the screen. Z index is used to determine the order in which shapes are drawn. Shapes with a higher Z index are drawn on top of shapes with a lower Z index.- Returns:
- The Z index.
-
setZ
public void setZ(int zIndex) Sets the Z index.- Parameters:
zIndex
- The Z index.- See Also:
-
equals
-
hashCode
public int hashCode()
-