Package codechicken.lib.model
Class Quad.Vertex
java.lang.Object
codechicken.lib.model.Quad.Vertex
- Enclosing class:
Quad
A simple vertex format.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionVertex(CachedFormat format) Create a new Vertex.Vertex(Quad.Vertex other) Creates a new Vertex using the data inside the other. -
Method Summary
Modifier and TypeMethodDescriptionfinal float[]color()copy()Copies this Vertex to a new one.floatdx(int s) Gets the 2d X coord for the given axis.floatdy(int s) Gets the 2d Y coord for the given axis.interpColorFrom(InterpHelper interpHelper, Quad.Vertex[] others) Interpolates the new color values for this Vertex using the others as a reference.interpLightMapFrom(InterpHelper interpHelper, Quad.Vertex[] others) Interpolates the new LightMap values for this Vertex using the others as a reference.interpUVFrom(InterpHelper interpHelper, Quad.Vertex[] others) Interpolates the new UV values for this Vertex using the others as a reference.final float[]lightmap()final float[]normal()final float[]overlay()voidPulls references to the individual element's arrays inside raw.voidreset(CachedFormat format) Resets the Vertex to a new format.final float[]uv()final float[]vec()
-
Field Details
-
format
-
raw
public float[][] rawThe raw data.
-
-
Constructor Details
-
Vertex
Create a new Vertex.- Parameters:
format- The format for the vertex.
-
Vertex
Creates a new Vertex using the data inside the other. A copy!- Parameters:
other- The other.
-
-
Method Details
-
preProcess
public void preProcess()Pulls references to the individual element's arrays inside raw. Modifying the individual element arrays will update raw. -
vec
public final float[] vec() -
normal
public final float[] normal() -
color
public final float[] color() -
uv
public final float[] uv() -
overlay
public final float[] overlay() -
lightmap
public final float[] lightmap() -
dx
public float dx(int s) Gets the 2d X coord for the given axis.- Parameters:
s- The axis. side >> 1- Returns:
- The x coord.
-
dy
public float dy(int s) Gets the 2d Y coord for the given axis.- Parameters:
s- The axis. side >> 1- Returns:
- The y coord.
-
interpColorFrom
Interpolates the new color values for this Vertex using the others as a reference.- Parameters:
interpHelper- The InterpHelper to use.others- The other Vertices to use as a template.- Returns:
- The same Vertex.
-
interpUVFrom
Interpolates the new UV values for this Vertex using the others as a reference.- Parameters:
interpHelper- The InterpHelper to use.others- The other Vertices to use as a template.- Returns:
- The same Vertex.
-
interpLightMapFrom
Interpolates the new LightMap values for this Vertex using the others as a reference.- Parameters:
interpHelper- The InterpHelper to use.others- The other Vertices to use as a template.- Returns:
- The same Vertex.
-
copy
Copies this Vertex to a new one.- Returns:
- The new Vertex.
-
reset
Resets the Vertex to a new format. Expands the raw array if needed.- Parameters:
format- The format to reset to.
-