public class RenderUtils
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static net.minecraft.util.ResourceLocation |
MC_BLOCKS_RESOURCE_LOCATION |
static net.minecraft.util.ResourceLocation |
MC_ITEMS_RESOURCE_LOCATION |
Constructor and Description |
---|
RenderUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
bindMinecraftBlockSheet()
Used to bind the MC blocks sheet
|
static void |
bindMinecraftItemSheet()
Used to bind the MC item sheet
|
static void |
bindTexture(net.minecraft.util.ResourceLocation resource)
Used to bind a texture to the render manager
|
static javax.vecmath.Matrix4f |
createEntityRotateMatrix(net.minecraft.entity.Entity entity)
Creates a rotation matrix for the entity
|
static void |
loadMatrix(javax.vecmath.Matrix4f transform)
Loads the matrix
|
static javax.vecmath.Matrix4f |
mul(javax.vecmath.Matrix4f left,
javax.vecmath.Matrix4f right,
javax.vecmath.Matrix4f dest)
Multiply the right matrix by the left and place the result in a third matrix.
|
static void |
prepareRenderState()
Used to prepare the rendering state.
|
static void |
renderCubeWithTexture(double x1,
double y1,
double z1,
double x2,
double y2,
double z2,
double u,
double v,
double u1,
double v1)
Used to draw a 3d cube, provide opposite corners
|
static void |
restoreColor()
Sets the color back to full white (normal)
|
static void |
restoreRenderState()
Un-does the prepare state
|
static void |
rotateMatrix4f(javax.vecmath.Matrix4f rotation,
float angle,
javax.vecmath.Vector3f vector)
Creates a rotation matrix.
|
static void |
setColor(java.awt.Color color)
Set the GL color.
|
static void |
store(javax.vecmath.Matrix4f vec,
java.nio.FloatBuffer buf)
Store this matrix in a float buffer.
|
public static final net.minecraft.util.ResourceLocation MC_BLOCKS_RESOURCE_LOCATION
public static final net.minecraft.util.ResourceLocation MC_ITEMS_RESOURCE_LOCATION
public static void bindTexture(net.minecraft.util.ResourceLocation resource)
resource
- The resource to bindpublic static void bindMinecraftItemSheet()
public static void bindMinecraftBlockSheet()
public static void setColor(java.awt.Color color)
color
- The color to setpublic static void restoreColor()
public static void prepareRenderState()
public static void restoreRenderState()
public static void loadMatrix(javax.vecmath.Matrix4f transform)
transform
- The transformpublic static javax.vecmath.Matrix4f createEntityRotateMatrix(net.minecraft.entity.Entity entity)
entity
- The looking entitypublic static void rotateMatrix4f(javax.vecmath.Matrix4f rotation, float angle, javax.vecmath.Vector3f vector)
glRotate(angle, x, y, z)
.
Credit to https://github.com/SilverTiger/lwjgl3-tutorial/blob/master/src/silvertiger/tutorial/lwjgl/math/Matrix4f.javaangle
- Angle of rotation in degreespublic static void store(javax.vecmath.Matrix4f vec, java.nio.FloatBuffer buf)
buf
- The buffer to store this matrix inpublic static javax.vecmath.Matrix4f mul(javax.vecmath.Matrix4f left, javax.vecmath.Matrix4f right, javax.vecmath.Matrix4f dest)
left
- The left source matrixright
- The right source matrixdest
- The destination matrix, or null if a new one is to be createdpublic static void renderCubeWithTexture(double x1, double y1, double z1, double x2, double y2, double z2, double u, double v, double u1, double v1)
x1
- First X Positiony1
- First Y Positionz1
- First Z Positionx2
- Second X Positiony2
- Second Y Positionz2
- Second Z Positionu
- Min Uv
- Min Vu1
- Max Uv1
- Max V