Skip to content

Instantly share code, notes, and snippets.

@jhead
Created March 13, 2013 02:44
Show Gist options
  • Save jhead/5148995 to your computer and use it in GitHub Desktop.
Save jhead/5148995 to your computer and use it in GitHub Desktop.
package echo.client.gl;
import echo.core.geom.Vector;
import lombok.Getter;
import lombok.Setter;
public class VertexVector extends Vector implements VertexAttribute {
public static final int ELEMENT_SIZE = 4;
public static final int LOCATION_ELEMENT_COUNT = 4;
public static final int COORD_ELEMENT_COUNT = 2;
public static final int ELEMENT_COUNT = LOCATION_ELEMENT_COUNT + COORD_ELEMENT_COUNT;
public static final int LOCATION_STRIDE = LOCATION_ELEMENT_COUNT * ELEMENT_SIZE;
public static final int COORD_STRIDE = COORD_ELEMENT_COUNT * ELEMENT_SIZE;
public static final int STRIDE = LOCATION_STRIDE + COORD_STRIDE;
@Getter protected final int w = 1;
@Getter @Setter protected int s, t;
public VertexVector(float x, float y, float z, int s, int t) {
super(x, y, z);
this.s = s;
this.t = t;
}
@Override
public float[] toFloatArray() {
return new float[] { x, y, z, w, s, t };
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment