Doc pour Engine + Introduction Tracking Tore
This commit is contained in:
@ -1,36 +0,0 @@
|
||||
package engine.object;
|
||||
|
||||
import engine.Engine;
|
||||
import engine.math.Matrix4f;
|
||||
import engine.math.Vector3f;
|
||||
|
||||
public class Camera {
|
||||
|
||||
private float dimension;
|
||||
private final Vector3f aspectRatio;
|
||||
private final Engine engine;
|
||||
|
||||
|
||||
public Camera(float dimension, Vector3f aspectRatio, Engine engine){
|
||||
this.dimension = dimension;
|
||||
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);
|
||||
}
|
||||
|
||||
public void zoom(float zoomFactor){
|
||||
engine.setUIElementZoomFactor(zoomFactor);
|
||||
this.dimension *= zoomFactor;
|
||||
float ar = aspectRatio.y / aspectRatio.x;
|
||||
ObjectGl.projection = Matrix4f.orthographic(-dimension, dimension, -dimension * ar, dimension * ar, 0.1f, 100.0f);
|
||||
}
|
||||
|
||||
public float getDimension(){
|
||||
return this.dimension;
|
||||
}
|
||||
|
||||
public Vector3f getAspectRatio(){
|
||||
return this.aspectRatio;
|
||||
}
|
||||
}
|
@ -253,6 +253,14 @@ public class ObjectGl {
|
||||
return zPos;
|
||||
}
|
||||
|
||||
public float getWidth(){
|
||||
return this.width;
|
||||
}
|
||||
|
||||
public float getHeight(){
|
||||
return this.height;
|
||||
}
|
||||
|
||||
public float getScalingFactor(){
|
||||
return scalingFactor;
|
||||
}
|
||||
|
Reference in New Issue
Block a user