X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fgui%2FRenderingContext.java;h=ce8c4a00d4fa4493801098b5e63bf5ed938c1538;hp=b6417e5aa7a66b1377bea912b6b64209baf8ccb3;hb=de8fb260a5e99922231b1d0f437916e796ec6ccb;hpb=a377e3094d304bbc815b36edc2eb303ec023ea48 diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java index b6417e5..ce8c4a0 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java @@ -4,6 +4,7 @@ */ package eu.svjatoslav.sixth.e3d.gui; +import eu.svjatoslav.sixth.e3d.geometry.Point2D; import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseEvent; import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController; @@ -19,8 +20,12 @@ public class RenderingContext { public final byte[] pixels; public final int width; public final int height; - public final int xCenter; - public final int yCenter; + /** + * Center of the screen in screen space (pixels). + * This is the point where (0,0) coordinate of the world space is rendered. + */ + public final Point2D centerCoordinate; + public final double zoom; final BufferedImage bufferedImage; public int frameNumber = 0; @@ -65,10 +70,7 @@ public class RenderingContext { public RenderingContext(final int width, final int height) { this.width = width; this.height = height; - - this.xCenter = width / 2; - this.yCenter = height / 2; - + this.centerCoordinate = new Point2D(width / 2d, height / 2d); this.zoom = width / 3d; bufferedImage = new BufferedImage(width, height, bufferedImageType);