public class MutableVertex
extends java.lang.Object
BakedQuad
. This provides a variety
of methods to quickly set or get different elements. This should be used with MutableQuad
to make a face, or
by itself if you only need to define a single vertex. positiond(double, double, double)
will take in 3 doubles and set them to the position element, and colouri(int, int, int, int)
will take in 4
int's and set them to the colour elements.Modifier and Type | Field and Description |
---|---|
short |
colour_a
The colour of this vertex, where each one is a number in the range 0-255.
|
short |
colour_b
The colour of this vertex, where each one is a number in the range 0-255.
|
short |
colour_g
The colour of this vertex, where each one is a number in the range 0-255.
|
short |
colour_r
The colour of this vertex, where each one is a number in the range 0-255.
|
byte |
light_block
The light of this vertex.
|
byte |
light_sky
The light of this vertex.
|
float |
normal_x
The normal of this vertex.
|
float |
normal_y
The normal of this vertex.
|
float |
normal_z
The normal of this vertex.
|
float |
position_x
The position of this vertex.
|
float |
position_y
The position of this vertex.
|
float |
position_z
The position of this vertex.
|
float |
tex_u
The texture co-ord of this vertex.
|
float |
tex_v
The texture co-ord of this vertex.
|
Constructor and Description |
---|
MutableVertex() |
MutableVertex(MutableVertex from) |
Modifier and Type | Method and Description |
---|---|
int |
colourABGR() |
MutableVertex |
colourf(float r,
float g,
float b,
float a) |
MutableVertex |
colouri(int rgba) |
MutableVertex |
colouri(int r,
int g,
int b,
int a) |
int |
colourRGBA() |
javax.vecmath.Point4f |
colourv() |
MutableVertex |
colourv(javax.vecmath.Tuple4f vec) |
MutableVertex |
copyFrom(MutableVertex from) |
void |
fromBakedBlock(int[] data,
int offset) |
void |
fromBakedItem(int[] data,
int offset) |
MutableVertex |
invertNormal() |
int |
lightc() |
MutableVertex |
lightf(float block,
float sky) |
int[] |
lighti() |
MutableVertex |
lighti(int combined) |
MutableVertex |
lighti(int block,
int sky) |
MutableVertex |
lightv(javax.vecmath.Tuple2f vec) |
javax.vecmath.Point2f |
lightvf() |
MutableVertex |
maxLighti(int block,
int sky) |
MutableVertex |
multColourd(double d) |
MutableVertex |
multColourd(double r,
double g,
double b,
double a) |
MutableVertex |
multColouri(int by) |
MutableVertex |
multColouri(int r,
int g,
int b,
int a) |
MutableVertex |
multShade()
Multiplies the colour by
MutableQuad.diffuseLight(float, float, float) for the normal. |
javax.vecmath.Vector3f |
normal() |
MutableVertex |
normalf(float x,
float y,
float z)
Sets the current normal given the x, y, and z coordinates.
|
MutableVertex |
normali(int combined) |
int |
normalToPackedInt() |
MutableVertex |
normalv(javax.vecmath.Tuple3f vec)
Sets the current normal for this vertex based off the given vector.
Note: This calls normalf(float, float, float) internally, so refer to that for more warnings. |
MutableVertex |
positiond(double x,
double y,
double z) |
MutableVertex |
positionf(float x,
float y,
float z) |
MutableVertex |
positionv(javax.vecmath.Tuple3f vec) |
javax.vecmath.Point3f |
positionvf() |
void |
render(net.minecraft.client.renderer.BufferBuilder bb) |
void |
renderAsBlock(net.minecraft.client.renderer.BufferBuilder bb)
Renders this vertex into the given
BufferBuilder , assuming that the VertexFormat is
DefaultVertexFormats.BLOCK . |
void |
renderColour(net.minecraft.client.renderer.BufferBuilder bb) |
void |
renderLightMap(net.minecraft.client.renderer.BufferBuilder bb) |
void |
renderNormal(net.minecraft.client.renderer.BufferBuilder bb) |
void |
renderPosition(net.minecraft.client.renderer.BufferBuilder bb) |
void |
renderTex(net.minecraft.client.renderer.BufferBuilder bb) |
void |
renderTex(net.minecraft.client.renderer.BufferBuilder bb,
ISprite sprite) |
void |
rotateDirectlyX(float cos,
float sin) |
void |
rotateDirectlyY(float cos,
float sin) |
void |
rotateDirectlyZ(float cos,
float sin) |
MutableVertex |
rotateX_180()
Rotates this vertex around the X axis by 180 degrees.
|
MutableVertex |
rotateX_90(float scale)
Rotates this vertex around the X axis 90 degrees.
|
void |
rotateX(float angle)
Rotates around the X axis by angle.
|
MutableVertex |
rotateY_180()
Rotates this vertex around the Y axis by 180 degrees.
|
MutableVertex |
rotateY_90(float scale)
Rotates this vertex around the Y axis 90 degrees.
|
void |
rotateY(float angle)
Rotates around the Y axis by angle.
|
MutableVertex |
rotateZ_180()
Rotates this vertex around the Z axis by 180 degrees.
|
MutableVertex |
rotateZ_90(float scale)
Rotates this vertex around the Z axis 90 degrees.
|
void |
rotateZ(float angle)
Rotates around the Z axis by angle.
|
MutableVertex |
scaled(double scale) |
MutableVertex |
scaled(double x,
double y,
double z) |
MutableVertex |
scalef(float scale) |
MutableVertex |
scalef(float x,
float y,
float z) |
javax.vecmath.Point2f |
tex() |
MutableVertex |
texf(float u,
float v) |
MutableVertex |
texFromSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite sprite) |
MutableVertex |
texv(javax.vecmath.Tuple2f vec) |
void |
toBakedBlock(int[] data,
int offset) |
void |
toBakedItem(int[] data,
int offset) |
java.lang.String |
toString() |
MutableVertex |
transform(javax.vecmath.Matrix4f matrix) |
MutableVertex |
translated(double x,
double y,
double z) |
MutableVertex |
translatef(float x,
float y,
float z) |
MutableVertex |
translatei(int x,
int y,
int z) |
MutableVertex |
translatevd(net.minecraft.util.math.Vec3d vec) |
MutableVertex |
translatevi(net.minecraft.util.math.Vec3i vec) |
public float position_x
public float position_y
public float position_z
public float normal_x
public float normal_y
public float normal_z
public short colour_r
public short colour_g
public short colour_b
public short colour_a
public float tex_u
public float tex_v
public byte light_block
public byte light_sky
public MutableVertex()
public MutableVertex(MutableVertex from)
public java.lang.String toString()
toString
in class java.lang.Object
public MutableVertex copyFrom(MutableVertex from)
public void toBakedBlock(int[] data, int offset)
public void toBakedItem(int[] data, int offset)
public void fromBakedBlock(int[] data, int offset)
public void fromBakedItem(int[] data, int offset)
public void render(net.minecraft.client.renderer.BufferBuilder bb)
public void renderAsBlock(net.minecraft.client.renderer.BufferBuilder bb)
BufferBuilder
, assuming that the VertexFormat
is
DefaultVertexFormats.BLOCK
.
Slight performance increase over render(BufferBuilder)
.
public void renderPosition(net.minecraft.client.renderer.BufferBuilder bb)
public void renderNormal(net.minecraft.client.renderer.BufferBuilder bb)
public void renderColour(net.minecraft.client.renderer.BufferBuilder bb)
public void renderTex(net.minecraft.client.renderer.BufferBuilder bb)
public void renderTex(net.minecraft.client.renderer.BufferBuilder bb, ISprite sprite)
public void renderLightMap(net.minecraft.client.renderer.BufferBuilder bb)
public MutableVertex positionv(javax.vecmath.Tuple3f vec)
public MutableVertex positiond(double x, double y, double z)
public MutableVertex positionf(float x, float y, float z)
public javax.vecmath.Point3f positionvf()
public MutableVertex normalv(javax.vecmath.Tuple3f vec)
normalf(float, float, float)
internally, so refer to that for more warnings.normalf(float, float, float)
public MutableVertex normalf(float x, float y, float z)
public MutableVertex normali(int combined)
public MutableVertex invertNormal()
public javax.vecmath.Vector3f normal()
public int normalToPackedInt()
public MutableVertex colourv(javax.vecmath.Tuple4f vec)
public MutableVertex colourf(float r, float g, float b, float a)
public MutableVertex colouri(int rgba)
public MutableVertex colouri(int r, int g, int b, int a)
public javax.vecmath.Point4f colourv()
public int colourRGBA()
public int colourABGR()
public MutableVertex multColourd(double d)
public MutableVertex multColourd(double r, double g, double b, double a)
public MutableVertex multColouri(int by)
public MutableVertex multColouri(int r, int g, int b, int a)
public MutableVertex multShade()
MutableQuad.diffuseLight(float, float, float)
for the normal.public MutableVertex texFromSprite(net.minecraft.client.renderer.texture.TextureAtlasSprite sprite)
public MutableVertex texv(javax.vecmath.Tuple2f vec)
public MutableVertex texf(float u, float v)
public javax.vecmath.Point2f tex()
public MutableVertex lightv(javax.vecmath.Tuple2f vec)
public MutableVertex lightf(float block, float sky)
public MutableVertex lighti(int combined)
public MutableVertex lighti(int block, int sky)
public MutableVertex maxLighti(int block, int sky)
public javax.vecmath.Point2f lightvf()
public int lightc()
public int[] lighti()
public MutableVertex transform(javax.vecmath.Matrix4f matrix)
public MutableVertex translatei(int x, int y, int z)
public MutableVertex translatef(float x, float y, float z)
public MutableVertex translated(double x, double y, double z)
public MutableVertex translatevi(net.minecraft.util.math.Vec3i vec)
public MutableVertex translatevd(net.minecraft.util.math.Vec3d vec)
public MutableVertex scalef(float scale)
public MutableVertex scaled(double scale)
public MutableVertex scalef(float x, float y, float z)
public MutableVertex scaled(double x, double y, double z)
public void rotateX(float angle)
public void rotateY(float angle)
public void rotateZ(float angle)
public void rotateDirectlyX(float cos, float sin)
public void rotateDirectlyY(float cos, float sin)
public void rotateDirectlyZ(float cos, float sin)
public MutableVertex rotateX_90(float scale)
scale
- The multiplier for scaling. Positive values will rotate clockwise, negative values rotate
anti-clockwise.public MutableVertex rotateY_90(float scale)
scale
- The multiplier for scaling. Positive values will rotate clockwise, negative values rotate
anti-clockwise.public MutableVertex rotateZ_90(float scale)
scale
- The multiplier for scaling. Positive values will rotate clockwise, negative values rotate
anti-clockwise.public MutableVertex rotateX_180()
public MutableVertex rotateY_180()
public MutableVertex rotateZ_180()