Première implémentation du tracking d'un personnage

This commit is contained in:
Antoine
2021-06-02 22:12:57 +02:00
parent 48c0a66f11
commit 9a93fafd0d
3 changed files with 35 additions and 25 deletions

View File

@ -34,6 +34,9 @@ public class ObjectGl {
private float xPos;
private float yPos;
private float zPos;
private float xAngle;
private float yAngle;
private float zAngle;
private float width; // To be used in setTextureWrap
private float height;
private float scalingFactor;
@ -75,9 +78,9 @@ public class ObjectGl {
this.vertexArray = new VertexArray(Primitive.createRectangle(this.zPos, this.width, this.height), Primitive.rectangle_indices, colorBuffer, Primitive.stdTexWrap);
this.scalingFactor = size;
this.scalingFactor = 1;
this.transform = Matrix4f.identity();
this.scale(new Vector3f(size, size,1f));
this.scale(new Vector3f(size, size,1.0f));
this.stick_state = DEFAULT;
this.useTime = false;
@ -110,11 +113,11 @@ public class ObjectGl {
* @param vec Vector3f
*/
public void translate(Vector3f vec){
vec.divXY(this.scalingFactor);
this.transform = this.transform.multiply(Matrix4f.translate(vec));
this.xPos += vec.x;
this.yPos += vec.y;
this.zPos += vec.z;
vec.divXY(this.scalingFactor);
this.transform = this.transform.multiply(Matrix4f.translate(vec));
}
/**