Hitbox reverse pour taille 4

This commit is contained in:
Antoine
2021-06-17 22:43:51 +02:00
parent ef1a8d5583
commit ff16ea1ae9
5 changed files with 17 additions and 15 deletions

View File

@ -2,20 +2,22 @@ package engine.object;
import engine.math.Vector3f;
import static org.lwjgl.glfw.GLFW.glfwGetTime;
public class Hitbox extends ObjectGl{
/**
* Create a rectangle shape, use setTextureWrap to correctly align the texture with the model
*
* @param z depth of your model the larger it is the more it will be "close" to the camera
* @param w height of the rectangle
* @param h width of the rectangle
* @param size scaling factor of the rectangle, the model could not show up because this value is too small or too large, a good compromise is between 2 and 15
* @param color set to null if you don't want a Color on your model
*/
public Hitbox(float z, float w, float h, float size, Vector3f color) {
super(z, w, h, size, null, color);
this.setShader("shaders/ObjectGlColor/vert.glsl", "shaders/StylishShaders/HitboxFrag.glsl");
}
protected void uniformInjection(){
if (this.useTime) this.shader.setUniform1f("time", (float) glfwGetTime());
this.shader.setUniformMat4f("projection", projection);
this.shader.setUniformMat4f("view", view);
this.shader.setUniformMat4f("transform", this.transform);
}
}