public class MergedVertex extends java.lang.Object implements ITransformable.Translate, ITransformable.Rotate, ITransformable.Scale, ITransformable.Alpha, ITransformable.Color, ITransformable.Brightness, java.lang.Iterable<Vertex>
ITransformable.Alpha, ITransformable.Brightness, ITransformable.Color, ITransformable.Position<T>, ITransformable.Rotate, ITransformable.Scale, ITransformable.Size<T>, ITransformable.Translate
Modifier and Type | Field and Description |
---|---|
protected Vertex |
base
Base
Vertex . |
protected java.lang.String |
name
Name of this
MergedVertex . |
protected org.lwjgl.util.vector.Matrix4f |
transformMatrix
Matrix holding the tranformations applied to this
MergedVertex . |
Constructor and Description |
---|
MergedVertex(Vertex vertex)
Instantiates a new
MergedVertex . |
Modifier and Type | Method and Description |
---|---|
void |
addVertex(Vertex vertex)
Adds a
Vertex to this MergedVertex . |
void |
applyMatrix()
Applies the transformations matrices to this
MergedVertex . |
void |
copyMatrix(org.lwjgl.util.vector.Matrix4f matrix)
Copies the transformation from a
shape to this Shape . |
static java.util.Map<java.lang.String,MergedVertex> |
getMergedVertexes(Shape shape)
Gets the list of
MergedVertex for a Shape . |
java.lang.String |
getName()
Gets the name of this
MergedVertex . |
double |
getX()
Gets the X coordinate of this
MergedVertex . |
double |
getY()
Gets the Y coordinate of this
MergedVertex |
double |
getZ()
Gets the Z coordinate of this
MergedVertex |
boolean |
is(java.lang.String... names)
Checks whether this
MergedVertex matches one of the names specified. |
java.util.Iterator<Vertex> |
iterator()
Gets the
Iterator for this MergedVertex . |
void |
removeVertex(Vertex vertex)
Removes a
Vertex from this MergedVertex . |
void |
rotate(float angle,
float x,
float y,
float z,
float offsetX,
float offsetY,
float offsetZ)
Rotates this
MergedVertex around the given axis the specified angle. |
void |
scale(float x,
float y,
float z,
float offsetX,
float offsetY,
float offsetZ)
Scales this
MergedVertex . |
void |
setAlpha(int alpha)
Sets the alpha value for this
MergedVertex . |
void |
setBrightness(int brightness)
Sets the brightness for this
MergedVertex . |
void |
setColor(int color)
Sets the color for this
MergedVertex . |
void |
translate(float x,
float y,
float z)
Translates this
MergedVertex . |
protected java.lang.String name
MergedVertex
.protected org.lwjgl.util.vector.Matrix4f transformMatrix
MergedVertex
.public MergedVertex(Vertex vertex)
MergedVertex
.vertex
- the vertexpublic java.lang.String getName()
MergedVertex
.MergedVertex
.public double getX()
MergedVertex
.MergedVertex
.public double getY()
MergedVertex
MergedVertex
.public double getZ()
MergedVertex
MergedVertex
.public boolean is(java.lang.String... names)
MergedVertex
matches one of the names specified.names
- the namespublic void addVertex(Vertex vertex)
vertex
- the vertexpublic void removeVertex(Vertex vertex)
Vertex
from this MergedVertex
.vertex
- the vertexpublic void copyMatrix(org.lwjgl.util.vector.Matrix4f matrix)
shape
to this Shape
.matrix
- the matrixpublic void applyMatrix()
MergedVertex
. This modifies the position of the vertexes.public void translate(float x, float y, float z)
MergedVertex
.translate
in interface ITransformable.Translate
x
- the xy
- the yz
- the zpublic void rotate(float angle, float x, float y, float z, float offsetX, float offsetY, float offsetZ)
MergedVertex
around the given axis the specified angle. Offsets the origin for the rotation.rotate
in interface ITransformable.Rotate
angle
- the anglex
- the xy
- the yz
- the zoffsetX
- the offset xoffsetY
- the offset yoffsetZ
- the offset zpublic void scale(float x, float y, float z, float offsetX, float offsetY, float offsetZ)
MergedVertex
.scale
in interface ITransformable.Scale
x
- the xy
- the yz
- the zoffsetX
- the offset xoffsetY
- the offset yoffsetZ
- the offset zpublic void setColor(int color)
MergedVertex
.setColor
in interface ITransformable.Color
color
- the new colorpublic void setAlpha(int alpha)
MergedVertex
.setAlpha
in interface ITransformable.Alpha
alpha
- the new alphapublic void setBrightness(int brightness)
MergedVertex
.setBrightness
in interface ITransformable.Brightness
brightness
- the new brightnesspublic java.util.Iterator<Vertex> iterator()
Iterator
for this MergedVertex
.iterator
in interface java.lang.Iterable<Vertex>
public static java.util.Map<java.lang.String,MergedVertex> getMergedVertexes(Shape shape)
MergedVertex
for a Shape
.shape
- the shapeHashMap
where the key is the Vertex.baseName()
of the vertexes merged.