32 lines
901 B
Java

package engine.object;
import engine.math.Vector3f;
import static org.lwjgl.glfw.GLFW.glfwGetTime;
public class Letter extends ObjectGl {
private int index;
private boolean indexBasedShader;
public Letter(float z, float w, float h, float size, String tex, Vector3f color, int index) {
super(z, w, h, size, tex, color);
this.index = index;
this.indexBasedShader = false;
}
public void setIndexBasedShader(boolean b){
this.indexBasedShader = b;
}
protected void uniformInjection(){
if (this.useTime) this.shader.setUniform1f("time", (float) glfwGetTime());
if (this.indexBasedShader) this.shader.setUniform1i("index",this.index);
this.shader.setUniformMat4f("projection", projection);
this.shader.setUniformMat4f("view", view);
this.shader.setUniformMat4f("transform", this.transform);
}
}