Habillage barre de vie + timer qui fonctionne

This commit is contained in:
Antoine
2021-06-17 01:11:35 +02:00
parent 9ff78c3382
commit c4e3c9623d
7 changed files with 27 additions and 19 deletions

View File

@ -17,7 +17,7 @@ public class Camera {
this.aspectRatio = aspectRatio;
this.engine = engine;
float ar = aspectRatio.y / aspectRatio.x;
ObjectGl.projection = Matrix4f.orthographic(-dimension, dimension, -dimension * ar, dimension * ar, 0.1f, 100.0f);
ObjectGl.projection = Matrix4f.orthographic(-dimension, dimension, -dimension * ar, dimension * ar, 0.1f, 1000.0f);
}
public void zoom(float zoomFactor){

View File

@ -93,7 +93,8 @@ public class UIElementText extends UIDummy{
if (background != null){
background.resetTransform();
background.scale(new Vector3f(this.scalingFactor, this.scalingFactor, 1f));
background.translate(new Vector3f(x, y));
background.translate(new Vector3f(x, y, this.zPos - 1f));
background.translate(new Vector3f(- engine.getTransformationView().x, - engine.getTransformationView().y));
}
}

View File

@ -40,20 +40,18 @@ public class Matrix4f {
}
public static Matrix4f translate(Vector3f vector){
Matrix4f result= identity();
Matrix4f result = identity();
result.elements[0 + 3*4] = vector.x;
result.elements[1 + 3*4] = vector.y;
result.elements[2 + 3*4] = vector.z;
return result;
}
public static Matrix4f scale(Vector3f vector){
Matrix4f result= identity();
Matrix4f result = identity();
result.elements[0 + 0*4] = vector.x;
result.elements[1 + 1*4] = vector.y;
result.elements[2 + 2*4] = vector.z;
return result;
}

View File

@ -10,13 +10,6 @@ import static org.lwjgl.glfw.GLFW.glfwGetTime;
*/
public class ObjectGl {
/**
* STATE CONST DECLARATION
*/
public static final int DEFAULT = 0, STICK_BOTTOM = 1, STICK_TOP = 2;
private int stick_state;
protected VertexArray vertexArray;
protected Shader shader;
protected Matrix4f transform;
@ -82,7 +75,6 @@ public class ObjectGl {
this.scalingFactor = 1;
this.transform = Matrix4f.identity();
this.scale(new Vector3f(size, size,1.0f));
this.stick_state = DEFAULT;
this.useTime = false;
// use different shader for each set of option