Improved code readability
authorSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Mon, 8 May 2023 23:24:14 +0000 (02:24 +0300)
committerSvjatoslav Agejenko <svjatoslav@svjatoslav.eu>
Mon, 8 May 2023 23:24:14 +0000 (02:24 +0300)
src/main/java/eu/svjatoslav/sixth/e3d/geometry/package-info.java [new file with mode: 0644]
src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewFrame.java
src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/package-info.java

diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/package-info.java b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/package-info.java
new file mode 100644 (file)
index 0000000..9423419
--- /dev/null
@@ -0,0 +1,5 @@
+package eu.svjatoslav.sixth.e3d.geometry;
+
+/**
+ * Goal is to provide basic geometry classes.
+ */
\ No newline at end of file
index abbf0dd..f2d58c9 100755 (executable)
@@ -11,6 +11,9 @@ import static java.lang.Math.sin;
 
 /**
  * The avatar is a user-controlled object in the 3D world.
+ *
+ * It is a point in space that can be moved around by the user.
+ * It has orientation in space, and it can also be rotated around.
  */
 public class Avatar implements ViewRenderListener {
 
index a5f7fb7..63ff0d9 100644 (file)
@@ -13,13 +13,32 @@ import java.awt.image.BufferedImage;
 import java.awt.image.DataBufferByte;
 import java.awt.image.WritableRaster;
 
+/**
+ * Rendering context that contains all the information that is needed to render the scene.
+ */
+
 public class RenderingContext {
 
     public static final int bufferedImageType = BufferedImage.TYPE_4BYTE_ABGR;
+
     public final Graphics2D graphics;
+
+    /**
+     * Pixels of the rendering area.
+     * Each pixel is represented by 4 bytes: alpha, blue, green, red.
+     */
     public final byte[] pixels;
+
+    /**
+     * Width of the rendering area in pixels.
+     */
     public final int width;
+
+    /**
+     * Height of the rendering area in pixels.
+     */
     public final int height;
+
     /**
      * Center of the screen in screen space (pixels).
      * This is the point where (0,0) coordinate of the world space is rendered.
index 6a824c8..a7b0445 100755 (executable)
@@ -12,7 +12,7 @@ import java.awt.event.WindowEvent;
 import java.awt.event.WindowListener;
 
 /**
- * Java Swing GUI frame that contains canvas for 3D rendering.
+ * Java Swing GUI frame that contains {@link ViewPanel} with canvas for 3D rendering.
  */
 public class ViewFrame extends JFrame implements WindowListener {
 
index 3773a0a..ff8dff5 100644 (file)
@@ -1,7 +1,5 @@
 package eu.svjatoslav.sixth.e3d.gui.textEditorComponent;
 
 /**
- * This package contains a text editor component.
- *
- * It is a simple text editor.
+ * This package contains a simple text editor component.
  */
\ No newline at end of file