package com.javamarcher.geometry;
public class VertexData {
public final static int ELEMENT_BYTE_SIZE = 4;
public final static int ELEMENT_COUNT = 10;
public final static int VERTEX_BYTE_SIZE = ELEMENT_BYTE_SIZE * ELEMENT_COUNT;
// Position
private final float[] xyzw = new float[] {0f, 0f, 0f, 1f};
// Color
private final float[] rgba = new float[] {1f, 1f, 1f, 1f};
// UV
private final float[] uv = new float[] {0f, 0f};
public void setPosition(float x, float y, float z) {
xyzw[0] = x;
xyzw[1] = y;
xyzw[2] = z;
}
public void setColor(float r, float g, float b) {
rgba[0] = r;
rgba[1] = g;
rgba[2] = b;
}
public void setUV(float u, float v) {
uv[0] = u;
uv[1] = v;
}
public float[] getPosition() {
return xyzw;
}
public float[] getColor() {
return rgba;
}
public float[] getUV() {
return uv;
}
}