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 TypeMethodDescriptioncopy()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.voidPulls references to the individual element's arrays inside raw.voidreset(CachedFormat format) Resets the Vertex to a new format.
-
Field Details
-
format
-
raw
public float[][] rawThe raw data. -
vec
public float[] vec -
normal
public float[] normal -
color
public float[] color -
uv
public float[] uv -
overlay
public float[] overlay -
lightmap
public float[] lightmap
-
-
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. -
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.
-