public class Shape extends java.lang.Object implements ITransformable.Translate, ITransformable.Rotate, ITransformable.Scale
MalisisRenderer. Supports basic transformations like scaling, translation and rotations.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 Face[] |
faces
|
protected java.util.Map<java.lang.String,MergedVertex> |
mergedVertexes
The merged vertexes making up this
Shape. |
protected org.lwjgl.util.vector.Matrix4f |
transformMatrix
The matrix containing all the transformations applied to this
Shape. |
| Constructor and Description |
|---|
Shape()
Instantiates a new
Shape. |
Shape(Face... faces)
Instantiates a new
Shape. |
Shape(java.util.List<Face> faces)
Instantiates a new
Shape. |
Shape(Shape s)
Instantiates a new
Shape. |
| Modifier and Type | Method and Description |
|---|---|
Shape |
addFaces(Face[] faces)
|
Shape |
addFaces(Face[] faces,
java.lang.String groupName)
|
Shape |
applyMatrix()
Applies the transformations matrix to this
Shape. |
Shape |
copyMatrix(Shape shape)
Copies the transformation matrix from a
shape to this Shape. |
void |
deductParameters()
Deducts the parameters for each
Face automatically. |
void |
enableMergedVertexes()
Enables the
MergedVertex for this Shape. |
static Shape |
fromShapes(Shape... shapes)
Builds a
Shape from multiple ones. |
Face |
getFace(java.lang.String name)
Gets a face from its name.
|
Face[] |
getFaces()
|
java.util.List<Face> |
getFaces(java.lang.String name)
|
MergedVertex |
getMergedVertex(Vertex vertex)
Gets the
MergedVertex for the specified Vertex. |
java.util.List<MergedVertex> |
getMergedVertexes(net.minecraft.util.EnumFacing direction)
Gets a list of
MergedVertex with a base name containing the EnumFacing name. |
java.util.List<MergedVertex> |
getMergedVertexes(Face face)
Gets a list of
MergedVertex with a base name containing Face name. |
java.util.List<MergedVertex> |
getMergedVertexes(java.lang.String... names)
Gets a list of
MergedVertex with a name containing the specified name. |
java.util.List<Vertex> |
getVertexes(net.minecraft.util.EnumFacing direction)
Gets a list of
Vertex with a base name containing the EnumFacing name. |
java.util.List<Vertex> |
getVertexes(Face face)
|
java.util.List<Vertex> |
getVertexes(java.lang.String name)
Gets a list of
Vertex with a base name containing name. |
Shape |
interpolateUV()
|
Shape |
limit(net.minecraft.util.math.AxisAlignedBB aabb)
Limits this
Shape to the bounding box passed. |
Shape |
limit(double x,
double y,
double z,
double X,
double Y,
double Z)
Limits this
Shape to the bounding box passed. |
Shape |
removeFace(Face face)
|
Shape |
resetState()
|
void |
rotate(float angle,
float x,
float y,
float z)
Rotates this
Shape around the given axis the specified angle. |
void |
rotate(float angle,
float x,
float y,
float z,
float offsetX,
float offsetY,
float offsetZ)
Rotates this
Shape around the given axis the specified angle. |
void |
scale(float factor)
Scales this
Shape on all axis. |
void |
scale(float x,
float y,
float z)
Scale.
|
void |
scale(float x,
float y,
float z,
float offsetX,
float offsetY,
float offsetZ)
Scales this
Shape. |
Shape |
setBounds(net.minecraft.util.math.AxisAlignedBB aabb)
Sets the bounds for this
Shape. |
Shape |
setBounds(double minX,
double minY,
double minZ,
double maxX,
double maxY,
double maxZ)
Sets the bounds for this
Shape. |
Shape |
setParameters(RenderParameters params,
boolean merge)
|
Shape |
setParameters(java.lang.String name,
RenderParameters params,
boolean merge)
Set
RenderParameters for faces matching the specified name. |
Shape |
setSize(float width,
float height,
float depth)
Sets the size of this
Shape. |
Shape |
shrink(net.minecraft.util.EnumFacing dir,
float factor)
Shrinks the
Face matching face name by a certain factor. |
Shape |
storeState()
|
void |
translate(float x,
float y,
float z)
Translates this
Shape. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrotateprotected Face[] faces
protected org.lwjgl.util.vector.Matrix4f transformMatrix
Shape.protected java.util.Map<java.lang.String,MergedVertex> mergedVertexes
Shape.public Shape()
Shape.public Shape(java.util.List<Face> faces)
Shape.faces - the facespublic Shape addFaces(Face[] faces, java.lang.String groupName)
faces - the facesgroupName - the group nameShapepublic Face[] getFaces()
public java.util.List<Face> getFaces(java.lang.String name)
name - the namepublic Face getFace(java.lang.String name)
name - the namepublic void enableMergedVertexes()
MergedVertex for this Shape. Will transfer the current transformation matrix to the MergedVertexpublic java.util.List<Vertex> getVertexes(java.lang.String name)
Vertex with a base name containing name.name - the namepublic java.util.List<Vertex> getVertexes(Face face)
face - the facepublic java.util.List<Vertex> getVertexes(net.minecraft.util.EnumFacing direction)
Vertex with a base name containing the EnumFacing name.direction - the directionpublic MergedVertex getMergedVertex(Vertex vertex)
MergedVertex for the specified Vertex.vertex - the vertexpublic java.util.List<MergedVertex> getMergedVertexes(java.lang.String... names)
MergedVertex with a name containing the specified name.names - the namespublic java.util.List<MergedVertex> getMergedVertexes(Face face)
MergedVertex with a base name containing Face name.face - the facepublic java.util.List<MergedVertex> getMergedVertexes(net.minecraft.util.EnumFacing direction)
MergedVertex with a base name containing the EnumFacing name.direction - the directionpublic Shape copyMatrix(Shape shape)
shape to this Shape.shape - the shapepublic Shape applyMatrix()
Shape. This modifies the position of the vertexes making up the
faces of this Shape.public Shape setParameters(RenderParameters params, boolean merge)
params - the paramsmerge - the mergeShapepublic Shape setParameters(java.lang.String name, RenderParameters params, boolean merge)
RenderParameters for faces matching the specified name. If merge is true, the parameters will
be merge with the face parameters instead of completely overriding them.name - the nameparams - the paramsmerge - the mergeShapepublic Shape setSize(float width, float height, float depth)
Shape. width represents East-West axis, height represents Bottom-Top axis and
Depth represents North-South axis. The calculations are based on Vertex.baseName().width - the widthheight - the heightdepth - the depthShapepublic Shape setBounds(net.minecraft.util.math.AxisAlignedBB aabb)
Shape. Calculations are based on Vertex.baseName().aabb - the aabbShapepublic Shape setBounds(double minX, double minY, double minZ, double maxX, double maxY, double maxZ)
Shape. Calculations are based on Vertex.baseName().minX - the xminY - the yminZ - the zmaxX - the xmaxY - the ymaxZ - the zShapepublic Shape limit(net.minecraft.util.math.AxisAlignedBB aabb)
Shape to the bounding box passed.aabb - the aabbShapepublic Shape limit(double x, double y, double z, double X, double Y, double Z)
Shape to the bounding box passed.x - the xy - the yz - the zX - the xY - the yZ - the zpublic void translate(float x,
float y,
float z)
Shape.translate in interface ITransformable.Translatex - the xy - the yz - the zpublic void scale(float factor)
Shape on all axis.factor - the factorpublic void scale(float x,
float y,
float z)
x - the xy - the yz - the zpublic void scale(float x,
float y,
float z,
float offsetX,
float offsetY,
float offsetZ)
Shape.scale in interface ITransformable.Scalex - the xy - the yz - the zoffsetX - the offset xoffsetY - the offset yoffsetZ - the offset zpublic void rotate(float angle,
float x,
float y,
float z)
Shape around the given axis the specified angle.angle - the anglex - the xy - the yz - the zpublic void rotate(float angle,
float x,
float y,
float z,
float offsetX,
float offsetY,
float offsetZ)
Shape around the given axis the specified angle. Offsets the origin for the rotation.rotate in interface ITransformable.Rotateangle - the anglex - the xy - the yz - the zoffsetX - the offset xoffsetY - the offset yoffsetZ - the offset zpublic Shape interpolateUV()
Shape based on their position and the Face orientation.Shapepublic Shape shrink(net.minecraft.util.EnumFacing dir, float factor)
Face matching face name by a certain factor. The vertexes of connected faces are
moved too.dir - the dirfactor - the factorpublic void deductParameters()
Face automatically.