net.minecraft.src
Class ModelRendererTurbo

java.lang.Object
  extended by net.minecraft.src.ModelRenderer
      extended by net.minecraft.src.ModelRendererTurbo

public class ModelRendererTurbo
extends net.minecraft.src.ModelRenderer

An extension to the ModelRenderer class. It basically is a copy to ModelRenderer, however, it contains various new methods to make your models.

Since the ModelRendererTurbo class gets loaded during startup, the models made can be very complex. This is why I can afford to add, for example, Wavefont OBJ support or have the addSprite method, methods that add a lot of vertices and polygons.

Author:
GaryCXJk

Field Summary
 boolean field_1402_i
           
 boolean flip
           
 boolean forcedRecompile
           
 boolean mirror
           
static int MR_BACK
           
static int MR_BOTTOM
           
static int MR_FRONT
           
static int MR_LEFT
           
static int MR_RIGHT
           
static int MR_TOP
           
 boolean showModel
           
 boolean useLegacyCompiler
           
 
Fields inherited from class net.minecraft.src.ModelRenderer
rotateAngleX, rotateAngleY, rotateAngleZ, rotationPointX, rotationPointY, rotationPointZ
 
Constructor Summary
ModelRendererTurbo(int textureX, int textureY)
          Creates a new ModelRenderTurbo object.
ModelRendererTurbo(int textureX, int textureY, int textureU, int textureV)
          Creates a new ModelRenderTurbo object.
 
Method Summary
 void addBox(float x, float y, float z, int w, int h, int d)
          Adds a new box to the model.
 void addBox(float x, float y, float z, int w, int h, int d, float expansion)
          Adds a new box to the model.
 void addBox(float x, float y, float z, int w, int h, int d, float expansion, float scale)
          Adds a new box to the model.
 void addCone(float x, float y, float z, float radius, float length, int segments)
          Adds a cone.
 void addCone(float x, float y, float z, float radius, float length, int segments, float baseScale)
          Adds a cone.
 void addCone(float x, float y, float z, float radius, float length, int segments, float baseScale, int baseDirection)
          Adds a cone.
 void addCone(float x, float y, float z, float radius, float length, int segments, float baseScale, int baseDirection, int textureCircleDiameterW, int textureCircleDiameterH)
          Adds a cone.
 void addCylinder(float x, float y, float z, float radius, float length, int segments)
          Adds a cylinder.
 void addCylinder(float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale)
          Adds a cylinder.
 void addCylinder(float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale, int baseDirection)
          Adds a cylinder.
 void addCylinder(float x, float y, float z, float radius, float length, int segments, float baseScale, float topScale, int baseDirection, int textureCircleDiameterW, int textureCircleDiameterH, int textureH)
          Adds a cylinder.
 void addModel(java.lang.String file, java.lang.Class modelFormat)
          Adds model format support.
 void addObj(java.lang.String file)
          Adds a Waveform .obj file as a model.
 void addPixel(float x, float y, float z, float[] scale, int w, int h)
          Adds a cube the size of one pixel.
 void addPixel(float x, float y, float z, float width, float height, float length)
          Adds a cube the size of one pixel.
 void addPolygon(net.minecraft.src.PositionTextureVertex[] verts)
          Creates a new polygon.
 void addPolygon(net.minecraft.src.PositionTextureVertex[] verts, int[][] uv)
          Creates a new polygon, and adds UV mapping to it.
 void addPolygon(net.minecraft.src.PositionTextureVertex[] verts, int u1, int v1, int u2, int v2)
          Creates a new polygon with a given UV.
 void addRectShape(float[] v, float[] v1, float[] v2, float[] v3, float[] v4, float[] v5, float[] v6, float[] v7, int w, int h, int d)
          Adds a rectangular shape.
 void addShape3D(float x, float y, float z, java.util.ArrayList<Coord2D> coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction)
          Creates a shape from a 2D vector shape.
 void addShape3D(float x, float y, float z, java.util.ArrayList<Coord2D> coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, float[] faceLengths)
          Creates a shape from a 2D vector shape.
 void addShape3D(float x, float y, float z, Coord2D[] coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction)
          Creates a shape from a 2D vector shape.
 void addShape3D(float x, float y, float z, Coord2D[] coordinates, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, float[] faceLengths)
          Creates a shape from a 2D vector shape.
 void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float rotX, float rotY, float rotZ)
          Creates a shape from a 2D vector shape.
 void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, float rotX, float rotY, float rotZ, float[] faceLengths)
           
 void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction)
          Creates a shape from a 2D vector shape.
 void addShape3D(float x, float y, float z, Shape2D shape, float depth, int shapeTextureWidth, int shapeTextureHeight, int sideTextureWidth, int sideTextureHeight, int direction, float[] faceLengths)
          Creates a shape from a 2D vector shape.
 void addSphere(float x, float y, float z, float r, int segs, int rings, int textureW, int textureH)
          Adds a spherical shape.
 void addSprite(float x, float y, float z, int w, int h, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion)
          Creates a model shaped like the exact image on the texture.
 void addSprite(float x, float y, float z, int w, int h, float expansion)
          Creates a model shaped like the exact image on the texture.
 void addSprite(float x, float y, float z, int w, int h, int d, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion)
          Creates a model shaped like the exact image on the texture.
 void addSprite(float x, float y, float z, int w, int h, int d, float pixelScale, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion)
          Creates a model shaped like the exact image on the texture.
 void addSprite(float x, float y, float z, java.lang.String[] mask, int d, float pixelScale, boolean rotX, boolean rotY, boolean rotZ, boolean mirrorX, boolean mirrorY, float expansion)
          Creates a model shaped like the exact image on the texture.
 void addTrapezoid(float x, float y, float z, int w, int h, int d, float scale, float bottomScale, int dir)
          Adds a trapezoid-like shape.
 void clear()
          Clears the current shape.
 void copyTo(net.minecraft.src.PositionTextureVertex[] verts, net.minecraft.src.TexturedPolygon[] poly)
          Copies an array of vertices and polygons to the current shape.
 void copyTo(net.minecraft.src.PositionTextureVertex[] verts, net.minecraft.src.TexturedPolygon[] poly, boolean copyGroup)
           
 void copyTo(net.minecraft.src.PositionTextureVertex[] verts, net.minecraft.src.TexturedQuad[] quad)
          Copies an array of vertices and quads to the current shape.
 void doMirror(boolean x, boolean y, boolean z)
          Mirrors the model in any direction.
 TransformGroup getGroup()
          Gets the current transformation group.
 TransformGroup getGroup(java.lang.String groupName)
          Gets the transformation group with a given group name.
 TextureGroup getTextureGroup()
          Gets the current texture group.
 TextureGroup getTextureGroup(java.lang.String groupName)
          Gets the texture group with the given name.
 void postRender(float f)
           
 void render(float worldScale)
          Renders the shape.
 void setDefaultTexture(java.lang.String s)
          Sets the default texture.
 void setFlipped(boolean isFlipped)
          Sets whether the shape's faces are flipped or not.
 void setGroup(java.lang.String groupName)
          Sets the current transformation group.
 void setGroup(java.lang.String groupName, Bone bone, double weight)
          Sets the current transformation group.
 void setGroupTexture(java.lang.String s)
          Sets the texture of the current texture group.
 void setMirrored(boolean isMirrored)
          Sets whether the shape is mirrored or not.
 void setPosition(float x, float y, float z)
          Sets the position of the shape, relative to the model's origins.
 void setTextureGroup(java.lang.String groupName)
          Sets the current texture group, which is used to switch the textures on a per-model base.
 void setTextureOffset(int x, int y)
          Sets a new position for the texture offset.
 
Methods inherited from class net.minecraft.src.ModelRenderer
renderWithRotation, setRotationPoint
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mirror

public boolean mirror

flip

public boolean flip

showModel

public boolean showModel

field_1402_i

public boolean field_1402_i

forcedRecompile

public boolean forcedRecompile

useLegacyCompiler

public boolean useLegacyCompiler

MR_FRONT

public static final int MR_FRONT
See Also:
Constant Field Values

MR_BACK

public static final int MR_BACK
See Also:
Constant Field Values

MR_LEFT

public static final int MR_LEFT
See Also:
Constant Field Values

MR_RIGHT

public static final int MR_RIGHT
See Also:
Constant Field Values

MR_TOP

public static final int MR_TOP
See Also:
Constant Field Values

MR_BOTTOM

public static final int MR_BOTTOM
See Also:
Constant Field Values
Constructor Detail

ModelRendererTurbo

public ModelRendererTurbo(int textureX,
                          int textureY)
Creates a new ModelRenderTurbo object. It requires the coordinates of the position of the texture.

Parameters:
textureX - the x-coordinate on the texture
textureY - the y-coordinate on the texture

ModelRendererTurbo

public ModelRendererTurbo(int textureX,
                          int textureY,
                          int textureU,
                          int textureV)
Creates a new ModelRenderTurbo object. It requires the coordinates of the position of the texture, but also allows you to specify the width and height of the texture, allowing you to use bigger textures instead.

Parameters:
textureX -
textureY -
textureU -
textureV -
Method Detail

addPolygon

public void addPolygon(net.minecraft.src.PositionTextureVertex[] verts)
Creates a new polygon.

Parameters:
verts - an array of vertices

addPolygon

public void addPolygon(net.minecraft.src.PositionTextureVertex[] verts,
                       int[][] uv)
Creates a new polygon, and adds UV mapping to it.

Parameters:
verts - an array of vertices
uv - an array of UV coordinates

addPolygon

public void addPolygon(net.minecraft.src.PositionTextureVertex[] verts,
                       int u1,
                       int v1,
                       int u2,
                       int v2)
Creates a new polygon with a given UV.

Parameters:
verts - an array of vertices
u1 -
v1 -
u2 -
v2 -

addRectShape

public void addRectShape(float[] v,
                         float[] v1,
                         float[] v2,
                         float[] v3,
                         float[] v4,
                         float[] v5,
                         float[] v6,
                         float[] v7,
                         int w,
                         int h,
                         int d)
Adds a rectangular shape. Basically, you can make any eight-pointed shape you want, as the method requires eight vector coordinates.

Parameters:
v - a float array with three values, the x, y and z coordinates of the vertex
v1 - a float array with three values, the x, y and z coordinates of the vertex
v2 - a float array with three values, the x, y and z coordinates of the vertex
v3 - a float array with three values, the x, y and z coordinates of the vertex
v4 - a float array with three values, the x, y and z coordinates of the vertex
v5 - a float array with three values, the x, y and z coordinates of the vertex
v6 - a float array with three values, the x, y and z coordinates of the vertex
v7 - a float array with three values, the x, y and z coordinates of the vertex
w - the width of the shape, used in determining the texture
h - the height of the shape, used in determining the texture
d - the depth of the shape, used in determining the texture

addBox

public void addBox(float x,
                   float y,
                   float z,
                   int w,
                   int h,
                   int d)
Adds a new box to the model.

Overrides:
addBox in class net.minecraft.src.ModelRenderer
Parameters:
x - the starting x-position
y - the starting y-position
z - the starting z-position
w - the width (over the x-direction)
h - the height (over the y-direction)
d - the depth (over the z-direction)

addBox

public void addBox(float x,
                   float y,
                   float z,
                   int w,
                   int h,
                   int d,
                   float expansion)
Adds a new box to the model.

Overrides:
addBox in class net.minecraft.src.ModelRenderer
Parameters:
x - the starting x-position
y - the starting y-position
z - the starting z-position
w - the width (over the x-direction)
h - the height (over the y-direction)
d - the depth (over the z-direction)
expansion - the expansion of the box. It increases the size in each direction by that many.

addBox

public void addBox(float x,
                   float y,
                   float z,
                   int w,
                   int h,
                   int d,
                   float expansion,
                   float scale)
Adds a new box to the model.

Parameters:
x - the starting x-position
y - the starting y-position
z - the starting z-position
w - the width (over the x-direction)
h - the height (over the y-direction)
d - the depth (over the z-direction)
expansion - the expansion of the box. It increases the size in each direction by that many. It's independent from the scale.
scale -

addTrapezoid

public void addTrapezoid(float x,
                         float y,
                         float z,
                         int w,
                         int h,
                         int d,
                         float scale,
                         float bottomScale,
                         int dir)
Adds a trapezoid-like shape. It's achieved by expanding the shape on one side. You can use the static variables MR_RIGHT, MR_LEFT, MR_FRONT, MR_BACK, MR_TOP and MR_BOTTOM.

Parameters:
x - the starting x-position
y - the starting y-position
z - the starting z-position
w - the width (over the x-direction)
h - the height (over the y-direction)
d - the depth (over the z-direction)
scale - the "scale" of the box. It only increases the size in each direction by that many.
bottomScale - the "scale" of the bottom
dir - the side the scaling is applied to

addShape3D

public void addShape3D(float x,
                       float y,
                       float z,
                       Coord2D[] coordinates,
                       float depth,
                       int shapeTextureWidth,
                       int shapeTextureHeight,
                       int sideTextureWidth,
                       int sideTextureHeight,
                       int direction)
Creates a shape from a 2D vector shape.

Parameters:
x - the starting x position
y - the starting y position
z - the starting z position
coordinates - an array of coordinates that form the shape
depth - the depth of the shape
shapeTextureWidth - the width of the texture of one side of the shape
shapeTextureHeight - the height of the texture the shape
sideTextureWidth - the width of the texture of the side of the shape
sideTextureHeight - the height of the texture of the side of the shape
direction - the direction the starting point of the shape is facing

addShape3D

public void addShape3D(float x,
                       float y,
                       float z,
                       Coord2D[] coordinates,
                       float depth,
                       int shapeTextureWidth,
                       int shapeTextureHeight,
                       int sideTextureWidth,
                       int sideTextureHeight,
                       int direction,
                       float[] faceLengths)
Creates a shape from a 2D vector shape.

Parameters:
x - the starting x position
y - the starting y position
z - the starting z position
coordinates - an array of coordinates that form the shape
depth - the depth of the shape
shapeTextureWidth - the width of the texture of one side of the shape
shapeTextureHeight - the height of the texture the shape
sideTextureWidth - the width of the texture of the side of the shape
sideTextureHeight - the height of the texture of the side of the shape
direction - the direction the starting point of the shape is facing
faceLengths - An array with the length of each face. Used to set the texture width of each face on the side manually.

addShape3D

public void addShape3D(float x,
                       float y,
                       float z,
                       java.util.ArrayList<Coord2D> coordinates,
                       float depth,
                       int shapeTextureWidth,
                       int shapeTextureHeight,
                       int sideTextureWidth,
                       int sideTextureHeight,
                       int direction)
Creates a shape from a 2D vector shape.

Parameters:
x - the starting x position
y - the starting y position
z - the starting z position
coordinates - an ArrayList of coordinates that form the shape
depth - the depth of the shape
shapeTextureWidth - the width of the texture of one side of the shape
shapeTextureHeight - the height of the texture the shape
sideTextureWidth - the width of the texture of the side of the shape
sideTextureHeight - the height of the texture of the side of the shape
direction - the direction the starting point of the shape is facing

addShape3D

public void addShape3D(float x,
                       float y,
                       float z,
                       java.util.ArrayList<Coord2D> coordinates,
                       float depth,
                       int shapeTextureWidth,
                       int shapeTextureHeight,
                       int sideTextureWidth,
                       int sideTextureHeight,
                       int direction,
                       float[] faceLengths)
Creates a shape from a 2D vector shape.

Parameters:
x - the starting x position
y - the starting y position
z - the starting z position
coordinates - an ArrayList of coordinates that form the shape
depth - the depth of the shape
shapeTextureWidth - the width of the texture of one side of the shape
shapeTextureHeight - the height of the texture the shape
sideTextureWidth - the width of the texture of the side of the shape
sideTextureHeight - the height of the texture of the side of the shape
direction - the direction the starting point of the shape is facing
faceLengths - An array with the length of each face. Used to set the texture width of each face on the side manually.

addShape3D

public void addShape3D(float x,
                       float y,
                       float z,
                       Shape2D shape,
                       float depth,
                       int shapeTextureWidth,
                       int shapeTextureHeight,
                       int sideTextureWidth,
                       int sideTextureHeight,
                       int direction)
Creates a shape from a 2D vector shape.

Parameters:
x - the starting x position
y - the starting y position
z - the starting z position
shape - a Shape2D which contains the coordinates of the shape points
depth - the depth of the shape
shapeTextureWidth - the width of the texture of one side of the shape
shapeTextureHeight - the height of the texture the shape
sideTextureWidth - the width of the texture of the side of the shape
sideTextureHeight - the height of the texture of the side of the shape
direction - the direction the starting point of the shape is facing

addShape3D

public void addShape3D(float x,
                       float y,
                       float z,
                       Shape2D shape,
                       float depth,
                       int shapeTextureWidth,
                       int shapeTextureHeight,
                       int sideTextureWidth,
                       int sideTextureHeight,
                       int direction,
                       float[] faceLengths)
Creates a shape from a 2D vector shape.

Parameters:
x - the starting x position
y - the starting y position
z - the starting z position
shape - a Shape2D which contains the coordinates of the shape points
depth - the depth of the shape
shapeTextureWidth - the width of the texture of one side of the shape
shapeTextureHeight - the height of the texture the shape
sideTextureWidth - the width of the texture of the side of the shape
sideTextureHeight - the height of the texture of the side of the shape
direction - the direction the starting point of the shape is facing
faceLengths - An array with the length of each face. Used to set the texture width of each face on the side manually.

addShape3D

public void addShape3D(float x,
                       float y,
                       float z,
                       Shape2D shape,
                       float depth,
                       int shapeTextureWidth,
                       int shapeTextureHeight,
                       int sideTextureWidth,
                       int sideTextureHeight,
                       float rotX,
                       float rotY,
                       float rotZ)
Creates a shape from a 2D vector shape.

Parameters:
x - the starting x position
y - the starting y position
z - the starting z position
shape - a Shape2D which contains the coordinates of the shape points
depth - the depth of the shape
shapeTextureWidth - the width of the texture of one side of the shape
shapeTextureHeight - the height of the texture the shape
sideTextureWidth - the width of the texture of the side of the shape
sideTextureHeight - the height of the texture of the side of the shape
rotX - the rotation around the x-axis
rotY - the rotation around the y-axis
rotZ - the rotation around the z-axis

addShape3D

public void addShape3D(float x,
                       float y,
                       float z,
                       Shape2D shape,
                       float depth,
                       int shapeTextureWidth,
                       int shapeTextureHeight,
                       int sideTextureWidth,
                       int sideTextureHeight,
                       float rotX,
                       float rotY,
                       float rotZ,
                       float[] faceLengths)

addPixel

public void addPixel(float x,
                     float y,
                     float z,
                     float width,
                     float height,
                     float length)
Adds a cube the size of one pixel. It will take a pixel from the texture and uses that as the texture of said cube. The accurate name would actually be "addVoxel". This method has been added to make it more compatible with Techne, and allows for easy single-colored boxes.

Parameters:
x - the starting x-position
y - the starting y-position
z - the starting z-position
width - the width of the box
height - the height of the box
length - the length of the box

addPixel

public void addPixel(float x,
                     float y,
                     float z,
                     float[] scale,
                     int w,
                     int h)
Adds a cube the size of one pixel. It will take a pixel from the texture and uses that as the texture of said cube. The accurate name would actually be "addVoxel". It will not overwrite the model data, but rather, it will add to the model.

Parameters:
x - the starting x-position
y - the starting y-position
z - the starting z-position
scale - the "scale" of the cube, where scale is a float integer consisting of three values
w - the x-coordinate on the texture
h - the y-coordinate on the texture

addSprite

public void addSprite(float x,
                      float y,
                      float z,
                      int w,
                      int h,
                      float expansion)
Creates a model shaped like the exact image on the texture. Note that this method will increase the amount of quads on your model, which could effectively slow down your PC, so unless it is really a necessity to use it, I'd suggest you avoid using this method to create your model.

Parameters:
x - the starting x-position
y - the starting y-position
z - the starting z-position
w - the width of the sprite
h - the height of the sprite
expansion - the expansion of the sprite. It only increases the size in each direction by that many.

addSprite

public void addSprite(float x,
                      float y,
                      float z,
                      int w,
                      int h,
                      boolean rotX,
                      boolean rotY,
                      boolean rotZ,
                      boolean mirrorX,
                      boolean mirrorY,
                      float expansion)
Creates a model shaped like the exact image on the texture. Note that this method will increase the amount of quads on your model, which could effectively slow down your PC, so unless it is really a necessity to use it, I'd suggest you avoid using this method to create your model.

Parameters:
x - the starting x-position
y - the starting y-position
z - the starting z-position
w - the width of the sprite
h - the height of the sprite
rotX - a boolean to define if it rotates 90 degrees around its yaw-axis
rotY - a boolean to define if it rotates 90 degrees around its pitch-axis
rotZ - a boolean to define if it rotates 90 degrees around its roll-axis
mirrorX - a boolean to define if the sprite should be mirrored
mirrorY - a boolean to define if the sprite should be flipped
expansion - the expansion of the sprite. It only increases the size in each direction by that many.

addSprite

public void addSprite(float x,
                      float y,
                      float z,
                      int w,
                      int h,
                      int d,
                      boolean rotX,
                      boolean rotY,
                      boolean rotZ,
                      boolean mirrorX,
                      boolean mirrorY,
                      float expansion)
Creates a model shaped like the exact image on the texture. Note that this method will increase the amount of quads on your model, which could effectively slow down your PC, so unless it is really a necessity to use it, I'd suggest you avoid using this method to create your model.

Parameters:
x - the starting x-position
y - the starting y-position
z - the starting z-position
w - the width of the sprite
h - the height of the sprite
d - the depth of the shape itself
rotX - a boolean to define if it rotates 90 degrees around its yaw-axis
rotY - a boolean to define if it rotates 90 degrees around its pitch-axis
rotZ - a boolean to define if it rotates 90 degrees around its roll-axis
mirrorX - a boolean to define if the sprite should be mirrored
mirrorY - a boolean to define if the sprite should be flipped
expansion - the expansion of the sprite. It only increases the size in each direction by that many.

addSprite

public void addSprite(float x,
                      float y,
                      float z,
                      int w,
                      int h,
                      int d,
                      float pixelScale,
                      boolean rotX,
                      boolean rotY,
                      boolean rotZ,
                      boolean mirrorX,
                      boolean mirrorY,
                      float expansion)
Creates a model shaped like the exact image on the texture. Note that this method will increase the amount of quads on your model, which could effectively slow down your PC, so unless it is really a necessity to use it, I'd suggest you avoid using this method to create your model.

Parameters:
x - the starting x-position
y - the starting y-position
z - the starting z-position
w - the width of the sprite
h - the height of the sprite
d - the depth of the shape itself
pixelScale - the scale of each individual pixel
rotX - a boolean to define if it rotates 90 degrees around its yaw-axis
rotY - a boolean to define if it rotates 90 degrees around its pitch-axis
rotZ - a boolean to define if it rotates 90 degrees around its roll-axis
mirrorX - a boolean to define if the sprite should be mirrored
mirrorY - a boolean to define if the sprite should be flipped
expansion - the expansion of the sprite. It only increases the size in each direction by that many.

addSprite

public void addSprite(float x,
                      float y,
                      float z,
                      java.lang.String[] mask,
                      int d,
                      float pixelScale,
                      boolean rotX,
                      boolean rotY,
                      boolean rotZ,
                      boolean mirrorX,
                      boolean mirrorY,
                      float expansion)
Creates a model shaped like the exact image on the texture. Note that this method will increase the amount of quads on your model, which could effectively slow down your PC, so unless it is really a necessity to use it, I'd suggest you avoid using this method to create your model.

This method uses a mask string. This way you can reduce the amount of quads used. To use this, create a String array, where you use a 1 to signify that the pixel will be drawn. Any other character will cause that pixel to not be drawn.

Parameters:
x - the starting x-position
y - the starting y-position
z - the starting z-position
mask - an array with the mask string
d - the depth of the shape itself
pixelScale - the scale of each individual pixel
rotX - a boolean to define if it rotates 90 degrees around its yaw-axis
rotY - a boolean to define if it rotates 90 degrees around its pitch-axis
rotZ - a boolean to define if it rotates 90 degrees around its roll-axis
mirrorX - a boolean to define if the sprite should be mirrored
mirrorY - a boolean to define if the sprite should be flipped
expansion - the expansion of the sprite. It only increases the size in each direction by that many.

addSphere

public void addSphere(float x,
                      float y,
                      float z,
                      float r,
                      int segs,
                      int rings,
                      int textureW,
                      int textureH)
Adds a spherical shape.

Parameters:
x -
y -
z -
r -
segs -
rings -
textureW -
textureH -

addCone

public void addCone(float x,
                    float y,
                    float z,
                    float radius,
                    float length,
                    int segments)
Adds a cone.

Parameters:
x - the x-position of the base
y - the y-position of the base
z - the z-position of the base
radius - the radius of the cylinder
length - the length of the cylinder
segments - the amount of segments the cylinder is made of

addCone

public void addCone(float x,
                    float y,
                    float z,
                    float radius,
                    float length,
                    int segments,
                    float baseScale)
Adds a cone. baseScale cannot be zero. If it is, it will automatically be set to 1F.

Parameters:
x - the x-position of the base
y - the y-position of the base
z - the z-position of the base
radius - the radius of the cylinder
length - the length of the cylinder
segments - the amount of segments the cylinder is made of
baseScale - the scaling of the base. Can be negative.

addCone

public void addCone(float x,
                    float y,
                    float z,
                    float radius,
                    float length,
                    int segments,
                    float baseScale,
                    int baseDirection)
Adds a cone. baseScale cannot be zero. If it is, it will automatically be set to 1F. Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in the top being placed at the (x,y,z).

Parameters:
x - the x-position of the base
y - the y-position of the base
z - the z-position of the base
radius - the radius of the cylinder
length - the length of the cylinder
segments - the amount of segments the cylinder is made of
baseScale - the scaling of the base. Can be negative.
baseDirection - the direction it faces

addCone

public void addCone(float x,
                    float y,
                    float z,
                    float radius,
                    float length,
                    int segments,
                    float baseScale,
                    int baseDirection,
                    int textureCircleDiameterW,
                    int textureCircleDiameterH)
Adds a cone. baseScale cannot be zero. If it is, it will automatically be set to 1F. Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in the top being placed at the (x,y,z). The textures for the sides are placed next to each other.

Parameters:
x - the x-position of the base
y - the y-position of the base
z - the z-position of the base
radius - the radius of the cylinder
length - the length of the cylinder
segments - the amount of segments the cylinder is made of
baseScale - the scaling of the base. Can be negative.
baseDirection - the direction it faces
textureCircleDiameterW - the diameter width of the circle on the texture
textureCircleDiameterH - the diameter height of the circle on the texture

addCylinder

public void addCylinder(float x,
                        float y,
                        float z,
                        float radius,
                        float length,
                        int segments)
Adds a cylinder.

Parameters:
x - the x-position of the base
y - the y-position of the base
z - the z-position of the base
radius - the radius of the cylinder
length - the length of the cylinder
segments - the amount of segments the cylinder is made of

addCylinder

public void addCylinder(float x,
                        float y,
                        float z,
                        float radius,
                        float length,
                        int segments,
                        float baseScale,
                        float topScale)
Adds a cylinder. You can make cones by either setting baseScale or topScale to zero. Setting both to zero will set the baseScale to 1F.

Parameters:
x - the x-position of the base
y - the y-position of the base
z - the z-position of the base
radius - the radius of the cylinder
length - the length of the cylinder
segments - the amount of segments the cylinder is made of
baseScale - the scaling of the base. Can be negative.
topScale - the scaling of the top. Can be negative.

addCylinder

public void addCylinder(float x,
                        float y,
                        float z,
                        float radius,
                        float length,
                        int segments,
                        float baseScale,
                        float topScale,
                        int baseDirection)
Adds a cylinder. You can make cones by either setting baseScale or topScale to zero. Setting both to zero will set the baseScale to 1F. Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in the top being placed at the (x,y,z).

Parameters:
x - the x-position of the base
y - the y-position of the base
z - the z-position of the base
radius - the radius of the cylinder
length - the length of the cylinder
segments - the amount of segments the cylinder is made of
baseScale - the scaling of the base. Can be negative.
topScale - the scaling of the top. Can be negative.
baseDirection - the direction it faces

addCylinder

public void addCylinder(float x,
                        float y,
                        float z,
                        float radius,
                        float length,
                        int segments,
                        float baseScale,
                        float topScale,
                        int baseDirection,
                        int textureCircleDiameterW,
                        int textureCircleDiameterH,
                        int textureH)
Adds a cylinder. You can make cones by either setting baseScale or topScale to zero. Setting both to zero will set the baseScale to 1F. Setting the baseDirection to either MR_LEFT, MR_BOTTOM or MR_BACK will result in the top being placed at the (x,y,z). The textures for the base and top are placed next to each other, while the body will be placed below the circles.

Parameters:
x - the x-position of the base
y - the y-position of the base
z - the z-position of the base
radius - the radius of the cylinder
length - the length of the cylinder
segments - the amount of segments the cylinder is made of
baseScale - the scaling of the base. Can be negative.
topScale - the scaling of the top. Can be negative.
baseDirection - the direction it faces
textureCircleDiameterW - the diameter width of the circle on the texture
textureCircleDiameterH - the diameter height of the circle on the texture
textureH - the height of the texture of the body

addObj

public void addObj(java.lang.String file)
Adds a Waveform .obj file as a model. Model files use the entire texture file.

Parameters:
file - the location of the .obj file. The location is relative to the base directories, which are either resources/models or resources/mods/models.

addModel

public void addModel(java.lang.String file,
                     java.lang.Class modelFormat)
Adds model format support. Model files use the entire texture file.

Parameters:
file - the location of the model file. The location is relative to the base directories, which are either resources/models or resources/mods/models.
modelFormat - the class of the model format interpreter

setTextureOffset

public void setTextureOffset(int x,
                             int y)
Sets a new position for the texture offset.

Parameters:
x - the x-coordinate of the texture start
y - the y-coordinate of the texture start

setPosition

public void setPosition(float x,
                        float y,
                        float z)
Sets the position of the shape, relative to the model's origins. Note that changing the offsets will not change the pivot of the model.

Parameters:
x - the x-position of the shape
y - the y-position of the shape
z - the z-position of the shape

doMirror

public void doMirror(boolean x,
                     boolean y,
                     boolean z)
Mirrors the model in any direction.

Parameters:
x - whether the model should be mirrored in the x-direction
y - whether the model should be mirrored in the y-direction
z - whether the model should be mirrored in the z-direction

setMirrored

public void setMirrored(boolean isMirrored)
Sets whether the shape is mirrored or not. This has effect on the way the textures get displayed. When working with addSprite, addPixel and addObj, it will be ignored.

Parameters:
isMirrored - a boolean to define whether the shape is mirrored

setFlipped

public void setFlipped(boolean isFlipped)
Sets whether the shape's faces are flipped or not. When GL_CULL_FACE is enabled, it won't render the back faces, effectively giving you the possibility to make "hollow" shapes. When working with addSprite and addPixel, it will be ignored.

Parameters:
isFlipped - a boolean to define whether the shape is flipped

clear

public void clear()
Clears the current shape. Since all shapes are stacked into one shape, you can't just replace a shape by overwriting the shape with another one. In this case you would need to clear the shape first.


copyTo

public void copyTo(net.minecraft.src.PositionTextureVertex[] verts,
                   net.minecraft.src.TexturedPolygon[] poly)
Copies an array of vertices and polygons to the current shape. This mainly is used to copy each shape to the main class, but you can just use it to copy your own shapes, for example from other classes, into the current class.

Parameters:
verts - the array of vertices you want to copy
poly - the array of polygons you want to copy

copyTo

public void copyTo(net.minecraft.src.PositionTextureVertex[] verts,
                   net.minecraft.src.TexturedPolygon[] poly,
                   boolean copyGroup)

copyTo

public void copyTo(net.minecraft.src.PositionTextureVertex[] verts,
                   net.minecraft.src.TexturedQuad[] quad)
Copies an array of vertices and quads to the current shape. This method converts quads to polygons and then calls the main copyTo method.

Parameters:
verts - the array of vertices you want to copy
quad - the array of quads you want to copy

setGroup

public void setGroup(java.lang.String groupName)
Sets the current transformation group. The transformation group is used to allow for vertex transformation. If a transformation group does not exist, a new one will be created.

Parameters:
groupName - the name of the transformation group you want to switch to

setGroup

public void setGroup(java.lang.String groupName,
                     Bone bone,
                     double weight)
Sets the current transformation group. The transformation group is used to allow for vertex transformation. If a transformation group does not exist, a new one will be created.

Parameters:
groupName - the name of the transformation group you want to switch to
bone - the Bone this transformation group is attached to
weight - the weight of the transformation group

getGroup

public TransformGroup getGroup()
Gets the current transformation group.

Returns:
the current PositionTransformGroup.

getGroup

public TransformGroup getGroup(java.lang.String groupName)
Gets the transformation group with a given group name.

Returns:
the current PositionTransformGroup.

setTextureGroup

public void setTextureGroup(java.lang.String groupName)
Sets the current texture group, which is used to switch the textures on a per-model base. Do note that any model that is rendered afterwards will use the same texture. To counter it, set a default texture, either at initialization or before rendering.

Parameters:
groupName - The name of the texture group. If the texture group doesn't exist, it creates a new group automatically.

getTextureGroup

public TextureGroup getTextureGroup()
Gets the current texture group.

Returns:
a TextureGroup object.

getTextureGroup

public TextureGroup getTextureGroup(java.lang.String groupName)
Gets the texture group with the given name.

Parameters:
groupName - the name of the texture group to return
Returns:
a TextureGroup object.

setGroupTexture

public void setGroupTexture(java.lang.String s)
Sets the texture of the current texture group.

Parameters:
s - the filename

setDefaultTexture

public void setDefaultTexture(java.lang.String s)
Sets the default texture. When left as an empty string, it will use the texture that has been set previously. Note that this will also move on to other rendered models of the same entity.

Parameters:
s - the filename

render

public void render(float worldScale)
Renders the shape.

Overrides:
render in class net.minecraft.src.ModelRenderer
Parameters:
worldScale - the scale of the shape. Usually is 0.0625.

postRender

public void postRender(float f)
Overrides:
postRender in class net.minecraft.src.ModelRenderer