From a3ff3683bd0a025061667b26b6fcf56fe20f0afc Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Sat, 4 Mar 2023 00:04:08 +0200 Subject: [PATCH] Updated readability of the code. --- .../svjatoslav/sixth/e3d/geometry/Circle.java | 2 +- .../sixth/e3d/geometry/Point2D.java | 3 +- .../sixth/e3d/geometry/Point3D.java | 10 ++- .../sixth/e3d/geometry/Polygon.java | 2 +- .../sixth/e3d/geometry/Rectangle.java | 2 +- .../sixth/e3d/gui/GuiComponent.java | 6 +- .../sixth/e3d/gui/RenderingContext.java | 48 ++++++------ .../svjatoslav/sixth/e3d/gui/TextPointer.java | 8 +- .../sixth/e3d/gui/UserRelativityTracker.java | 2 +- .../svjatoslav/sixth/e3d/gui/ViewFrame.java | 2 +- .../svjatoslav/sixth/e3d/gui/ViewPanel.java | 6 +- .../sixth/e3d/gui/ViewRenderListener.java | 2 +- .../sixth/e3d/gui/ViewUpdateTimerTask.java | 2 +- .../e3d/gui/humaninput/HIDInputTracker.java | 4 +- .../gui/humaninput/KeyboardFocusStack.java | 6 +- .../e3d/gui/humaninput/KeyboardHelper.java | 2 +- .../gui/humaninput/KeyboardInputHandler.java | 4 +- .../sixth/e3d/gui/humaninput/MouseEvent.java | 2 +- .../MouseInteractionController.java | 5 +- .../WorldNavigationUserInputTracker.java | 2 +- .../gui/textEditorComponent/Character.java | 2 +- .../gui/textEditorComponent/LookAndFeel.java | 2 +- .../e3d/gui/textEditorComponent/Page.java | 17 ++--- .../TextEditComponent.java | 3 +- .../svjatoslav/sixth/e3d/io/Connexion3D.java | 2 +- .../sixth/e3d/math/Orientation.java | 2 +- .../svjatoslav/sixth/e3d/math/Transform.java | 20 ++--- .../eu/svjatoslav/sixth/e3d/math/Vertex.java | 4 +- .../e3d/renderer/octree/OctreeVolume.java | 3 +- .../e3d/renderer/octree/package-info.java | 4 +- .../e3d/renderer/octree/raytracer/Camera.java | 2 +- .../renderer/octree/raytracer/CameraView.java | 10 +-- .../octree/raytracer/LightSource.java | 12 ++- .../e3d/renderer/octree/raytracer/Ray.java | 2 +- .../e3d/renderer/octree/raytracer/RayHit.java | 2 +- .../renderer/octree/raytracer/RayTracer.java | 74 +++++++++---------- .../octree/raytracer/package-info.java | 4 +- .../sixth/e3d/renderer/package-info.java | 2 +- .../sixth/e3d/renderer/raster/Color.java | 2 +- .../e3d/renderer/raster/RenderAggregator.java | 6 +- .../e3d/renderer/raster/ShapeCollection.java | 2 +- .../e3d/renderer/raster/package-info.java | 4 +- .../shapes/AbstractCoordinateShape.java | 2 +- .../renderer/raster/shapes/AbstractShape.java | 2 +- .../shapes/basic/ForwardOrientedTexture.java | 4 +- .../raster/shapes/basic/GlowingPoint.java | 4 +- .../raster/shapes/basic/line/Line.java | 2 +- .../shapes/basic/line/LineAppearance.java | 2 +- .../shapes/basic/line/LineInterpolator.java | 8 +- .../basic/solidpolygon/LineInterpolator.java | 8 +- .../basic/solidpolygon/SolidPolygon.java | 2 +- .../PolygonBorderInterpolator.java | 8 +- .../texturedpolygon/TexturedPolygon.java | 2 +- .../composite/ForwardOrientedTextBlock.java | 2 +- .../raster/shapes/composite/Graph.java | 2 +- .../shapes/composite/TexturedRectangle.java | 2 +- .../base/AbstractCompositeShape.java | 4 +- .../shapes/composite/base/SubShape.java | 2 +- .../composite/solid/SolidPolygonCube.java | 2 +- .../solid/SolidPolygonRectangularBox.java | 2 +- .../composite/textcanvas/CanvasCharacter.java | 2 +- .../composite/textcanvas/RenderMode.java | 2 +- .../composite/textcanvas/TextCanvas.java | 8 +- .../shapes/composite/wireframe/Grid2D.java | 8 +- .../shapes/composite/wireframe/Grid3D.java | 2 +- .../composite/wireframe/WireframeCube.java | 2 +- .../composite/wireframe/WireframeDrawing.java | 2 +- .../composite/wireframe/WireframeSphere.java | 2 +- .../renderer/raster/slicer/BorderLine.java | 2 +- .../raster/slicer/PolygonCoordinate.java | 2 +- .../e3d/renderer/raster/slicer/Slicer.java | 4 +- .../e3d/renderer/raster/texture/Texture.java | 15 ++-- .../raster/texture/TextureBitmap.java | 4 +- 73 files changed, 201 insertions(+), 215 deletions(-) diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Circle.java b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Circle.java index 5402fc4..6201765 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Circle.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Circle.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.geometry; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java index c272047..f2d2603 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point2D.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.geometry; @@ -90,6 +90,7 @@ public class Point2D implements Cloneable { /** * Calculate length of vector. + * * @return length of vector. */ public double getVectorLength() { diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java index 6bf2dd3..120ea32 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.geometry; @@ -60,9 +60,10 @@ public class Point3D implements Cloneable { /** * Add coordinates of current point to other point. Value of current point will not be changed. + * * @return current point. */ - public Point3D addTo(final Point3D ... otherPoints) { + public Point3D addTo(final Point3D... otherPoints) { for (final Point3D otherPoint : otherPoints) otherPoint.add(this); return this; } @@ -157,12 +158,12 @@ public class Point3D implements Cloneable { *

* See also: Let's remove Quaternions from every 3D Engine * - * @param center center point. + * @param center center point. * @param angleXZ angle around XZ axis. * @param angleYZ angle around YZ axis. */ public Point3D rotate(final Point3D center, final double angleXZ, - final double angleYZ) { + final double angleYZ) { final double s1 = sin(angleXZ); final double c1 = cos(angleXZ); @@ -229,6 +230,7 @@ public class Point3D implements Cloneable { /** * Set current point coordinates to given values. + * * @param x X coordinate. * @param y Y coordinate. * @param z Z coordinate. diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Polygon.java b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Polygon.java index 13996ee..b630ca3 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Polygon.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Polygon.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.geometry; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Rectangle.java b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Rectangle.java index 617978e..1d11e72 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Rectangle.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Rectangle.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.geometry; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java index 3f16d26..4d94136 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/GuiComponent.java @@ -1,14 +1,14 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui; import eu.svjatoslav.sixth.e3d.geometry.Box; import eu.svjatoslav.sixth.e3d.geometry.Point3D; -import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController; -import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardInputHandler; import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardHelper; +import eu.svjatoslav.sixth.e3d.gui.humaninput.KeyboardInputHandler; +import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController; import eu.svjatoslav.sixth.e3d.math.Transform; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCompositeShape; 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 c5c42f6..a5f7fb7 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/RenderingContext.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui; @@ -41,12 +41,6 @@ public class RenderingContext { * UI component that mouse is currently hovering over. */ private MouseInteractionController objectPreviouslyUnderMouseCursor; - - public void prepareForNewFrameRendering(){ - mouseEvent = null; - currentObjectUnderMouseCursor = null; - } - /** * Mouse click event that needs to be processed. * This event is processed only once per frame. @@ -56,29 +50,11 @@ public class RenderingContext { * This field is set to null after the event is processed. */ private MouseEvent mouseEvent; - - public void setMouseEvent(MouseEvent mouseEvent) { - this.mouseEvent = mouseEvent; - } - - public MouseEvent getMouseEvent() { - return mouseEvent; - } - /** * UI component that mouse is currently hovering over. */ private MouseInteractionController currentObjectUnderMouseCursor; - /** - * Called when given object was detected under mouse cursor, while processing {@link #mouseEvent}. - * Because objects are rendered back to front. The last method caller will set the top-most object, if - * there are multiple objects under mouse cursor. - */ - public void setCurrentObjectUnderMouseCursor(MouseInteractionController currentObjectUnderMouseCursor) { - this.currentObjectUnderMouseCursor = currentObjectUnderMouseCursor; - } - public RenderingContext(final int width, final int height) { this.width = width; this.height = height; @@ -96,6 +72,28 @@ public class RenderingContext { graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); } + public void prepareForNewFrameRendering() { + mouseEvent = null; + currentObjectUnderMouseCursor = null; + } + + public MouseEvent getMouseEvent() { + return mouseEvent; + } + + public void setMouseEvent(MouseEvent mouseEvent) { + this.mouseEvent = mouseEvent; + } + + /** + * Called when given object was detected under mouse cursor, while processing {@link #mouseEvent}. + * Because objects are rendered back to front. The last method caller will set the top-most object, if + * there are multiple objects under mouse cursor. + */ + public void setCurrentObjectUnderMouseCursor(MouseInteractionController currentObjectUnderMouseCursor) { + this.currentObjectUnderMouseCursor = currentObjectUnderMouseCursor; + } + /** * @return true if view update is needed as a consequence of this mouse event. */ diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java index 7e2bf74..701ec50 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui; @@ -54,10 +54,8 @@ public class TextPointer implements Comparable { /** * Checks if this pointer is between the specified pointers. * - * @param start - * The start pointer. - * @param end - * The end pointer. + * @param start The start pointer. + * @param end The end pointer. * @return True if this pointer is between the specified pointers. */ public boolean isBetween(final TextPointer start, final TextPointer end) { diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java index 48b1016..6665676 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewFrame.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewFrame.java index 29cf98f..0c6ef51 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewFrame.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewFrame.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java index 088d98a..9c0681c 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewPanel.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui; @@ -21,12 +21,12 @@ import java.util.concurrent.ConcurrentHashMap; */ public class ViewPanel extends JPanel implements ComponentListener { private static final long serialVersionUID = 1683277888885045387L; - public Color backgroundColor = Color.BLACK; private final HIDInputTracker HIDInputTracker = new HIDInputTracker(this); private final KeyboardFocusStack keyboardFocusStack; private final Avatar avatar = new Avatar(); private final ShapeCollection rootShapeCollection = new ShapeCollection(); private final Set viewRenderListeners = ConcurrentHashMap.newKeySet(); + public Color backgroundColor = Color.BLACK; /** * Last time this view was updated. */ @@ -215,7 +215,7 @@ public class ViewPanel extends JPanel implements ComponentListener { int panelWidth = getWidth(); int panelHeight = getHeight(); - if (panelWidth <= 0 || panelHeight <=0){ + if (panelWidth <= 0 || panelHeight <= 0) { renderingContext = null; return; } diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewRenderListener.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewRenderListener.java index 30e73d2..befbd6e 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewRenderListener.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewRenderListener.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewUpdateTimerTask.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewUpdateTimerTask.java index cb7bac4..b86dc88 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewUpdateTimerTask.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/ViewUpdateTimerTask.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/HIDInputTracker.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/HIDInputTracker.java index a63c33b..c08fa8e 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/HIDInputTracker.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/HIDInputTracker.java @@ -32,10 +32,10 @@ public class HIDInputTracker implements private final Map pressedKeysToPressedTimeMap = new HashMap<>(); private final List detectedMouseEvents = new ArrayList<>(); private final List detectedKeyEvents = new ArrayList<>(); - private int wheelMovedDirection = 0; private final Point2D mouseDraggedDirection = new Point2D(); - private Point2D oldMouseCoordinatesWhenDragging; private final ViewPanel viewPanel; + private int wheelMovedDirection = 0; + private Point2D oldMouseCoordinatesWhenDragging; private Point2D currentMouseLocation; private boolean mouseMoved; private boolean mouseWithinWindow = false; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardFocusStack.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardFocusStack.java index 9a1cd6d..53202db 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardFocusStack.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardFocusStack.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui.humaninput; @@ -11,8 +11,8 @@ import java.util.Stack; public class KeyboardFocusStack { private final ViewPanel viewPanel; - private WorldNavigationUserInputTracker defaultInputHandler = new WorldNavigationUserInputTracker(); - private Stack inputHandlers = new Stack<>(); + private final WorldNavigationUserInputTracker defaultInputHandler = new WorldNavigationUserInputTracker(); + private final Stack inputHandlers = new Stack<>(); private KeyboardInputHandler currentUserInputHandler; public KeyboardFocusStack(final ViewPanel viewPanel) { diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardHelper.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardHelper.java index 44b861e..1bbda5b 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardHelper.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardHelper.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui.humaninput; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardInputHandler.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardInputHandler.java index 3f26cdf..ccdb962 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardInputHandler.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/KeyboardInputHandler.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui.humaninput; @@ -10,7 +10,7 @@ import java.awt.event.KeyEvent; /** * This is the process: - * + *

* 1. Component receives focus, perhaps because user clicked on it with the mouse. * 2. Now component will receive user key press and release events from the keyboard. * 3. Component loses focus. Perhaps user chose another component to interact with. diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/MouseEvent.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/MouseEvent.java index b487d15..459d0d2 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/MouseEvent.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/MouseEvent.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui.humaninput; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/MouseInteractionController.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/MouseInteractionController.java index d5f1f08..5b6d470 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/MouseInteractionController.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/MouseInteractionController.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui.humaninput; @@ -11,18 +11,21 @@ public interface MouseInteractionController { /** * Called when mouse is clicked on component. + * * @return true if view update is needed as a consequence of this mouse click. */ boolean mouseClicked(int button); /** * Called when mouse gets over given component. + * * @return true if view update is needed as a consequence of this mouse enter. */ boolean mouseEntered(); /** * Called when mouse leaves screen area occupied by component. + * * @return true if view update is needed as a consequence of this mouse exit. */ boolean mouseExited(); diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/WorldNavigationUserInputTracker.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/WorldNavigationUserInputTracker.java index 8a66a3e..9c8415e 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/WorldNavigationUserInputTracker.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/humaninput/WorldNavigationUserInputTracker.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui.humaninput; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Character.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Character.java index 3c20ff2..27113b0 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Character.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Character.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui.textEditorComponent; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/LookAndFeel.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/LookAndFeel.java index 784cdc0..b792779 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/LookAndFeel.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/LookAndFeel.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui.textEditorComponent; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Page.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Page.java index 0f60618..47c898f 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Page.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/Page.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui.textEditorComponent; @@ -37,8 +37,7 @@ public class Page { /** * Returns the specified line. * - * @param row - * The line number. + * @param row The line number. * @return The line. */ public TextLine getLine(final int row) { @@ -49,8 +48,7 @@ public class Page { /** * Returns the length of the specified line. * - * @param row - * The line number. + * @param row The line number. * @return The length of the line. */ public int getLineLength(final int row) { @@ -115,10 +113,8 @@ public class Page { /** * Removes the specified character from the page. * - * @param row - * The line number. - * @param col - * The character number. + * @param row The line number. + * @param col The character number. */ public void removeCharacter(final int row, final int col) { if (rows.size() <= row) @@ -129,8 +125,7 @@ public class Page { /** * Removes the specified line from the page. * - * @param row - * The line number. + * @param row The line number. */ public void removeLine(final int row) { if (rows.size() <= row) diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java index 44b19aa..0cd379c 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextEditComponent.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.gui.textEditorComponent; @@ -495,7 +495,6 @@ public class TextEditComponent extends GuiComponent implements ClipboardOwner { if (keyCode == KeyboardHelper.PGUP) { cursorLocation.row -= textCanvas.getSize().row; repaintPage = true; - return; } } diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/io/Connexion3D.java b/src/main/java/eu/svjatoslav/sixth/e3d/io/Connexion3D.java index 40fad83..90e7306 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/io/Connexion3D.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/io/Connexion3D.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.io; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/math/Orientation.java b/src/main/java/eu/svjatoslav/sixth/e3d/math/Orientation.java index b889392..9cc6dcd 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/math/Orientation.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/math/Orientation.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.math; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/math/Transform.java b/src/main/java/eu/svjatoslav/sixth/e3d/math/Transform.java index f7f64db..85a2dda 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/math/Transform.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/math/Transform.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.math; @@ -23,8 +23,7 @@ public class Transform implements Cloneable { /** * Creates a new transform with the specified translation. * - * @param translation - * the translation + * @param translation the translation */ public Transform(final Point3D translation) { this.translation = translation; @@ -34,12 +33,9 @@ public class Transform implements Cloneable { /** * Creates a new transform with the specified translation and orientation. * - * @param translation - * the translation - * @param angleXZ - * the angle around the XZ axis - * @param angleYZ - * the angle around the YZ axis + * @param translation the translation + * @param angleXZ the angle around the XZ axis + * @param angleYZ the angle around the YZ axis */ public Transform(final Point3D translation, final double angleXZ, final double angleYZ) { @@ -51,10 +47,8 @@ public class Transform implements Cloneable { /** * Creates a new transform with the specified translation and orientation. * - * @param translation - * the translation - * @param orientation - * the orientation + * @param translation the translation + * @param orientation the orientation */ public Transform(final Point3D translation, final Orientation orientation) { this.translation = translation; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/math/Vertex.java b/src/main/java/eu/svjatoslav/sixth/e3d/math/Vertex.java index 6e083fc..69b3095 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/math/Vertex.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/math/Vertex.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.math; @@ -53,7 +53,7 @@ public class Vertex { * Transforms vertex coordinate to calculate its location relative to the viewer. * It also calculates its location on the screen. * - * @param transforms Transforms pipeline. + * @param transforms Transforms pipeline. * @param renderContext Rendering context. */ public void calculateLocationRelativeToViewer(final TransformsStack transforms, diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/OctreeVolume.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/OctreeVolume.java index e1b7269..5cc17dd 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/OctreeVolume.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/OctreeVolume.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.octree; @@ -7,7 +7,6 @@ package eu.svjatoslav.sixth.e3d.renderer.octree; import eu.svjatoslav.sixth.e3d.geometry.Point3D; import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.Ray; import eu.svjatoslav.sixth.e3d.renderer.raster.Color; -import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance; /** *

diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/package-info.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/package-info.java
index c4c5d9b..5cdcef4 100755
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/package-info.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/package-info.java
@@ -1,8 +1,8 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  *
-*
+ *
  * Realtime voxel renderer (in software).
  * Uses octree for data compression.
  */
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Camera.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Camera.java
index 5670ac0..559cc6c 100755
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Camera.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Camera.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/CameraView.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/CameraView.java
index ce92787..c2acb88 100644
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/CameraView.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/CameraView.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
@@ -23,10 +23,10 @@ public class CameraView {
         // compute camera view coordinates as if camera is at (0,0,0) and look at (0,0,1)
         final float viewAngle = (float) .6;
         cameraCenter = new Point3D();
-        topLeft = new Point3D(0,0, SIZE).rotate(-viewAngle, -viewAngle);
-        topRight = new Point3D(0,0, SIZE).rotate(viewAngle, -viewAngle);
-        bottomLeft = new Point3D(0,0,SIZE).rotate(-viewAngle, viewAngle);
-        bottomRight = new Point3D(0,0,SIZE).rotate(viewAngle, viewAngle);
+        topLeft = new Point3D(0, 0, SIZE).rotate(-viewAngle, -viewAngle);
+        topRight = new Point3D(0, 0, SIZE).rotate(viewAngle, -viewAngle);
+        bottomLeft = new Point3D(0, 0, SIZE).rotate(-viewAngle, viewAngle);
+        bottomRight = new Point3D(0, 0, SIZE).rotate(viewAngle, viewAngle);
 
         topLeft.rotate(-avatar.getAngleXZ(), -avatar.getAngleYZ());
         topRight.rotate(-avatar.getAngleXZ(), -avatar.getAngleYZ());
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/LightSource.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/LightSource.java
index 3c963d6..c0939d7 100755
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/LightSource.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/LightSource.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
@@ -12,20 +12,18 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
  */
 public class LightSource {
 
-    /**
-     * Light source location.
-     */
-    Point3D location;
-
     /**
      * Light source color.
      */
     public Color color;
-
     /**
      * Light source brightness.
      */
     public float brightness;
+    /**
+     * Light source location.
+     */
+    Point3D location;
 
     public LightSource(final Point3D location, final Color color,
                        final float Brightness) {
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Ray.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Ray.java
index 659a989..b616f2c 100755
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Ray.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Ray.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayHit.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayHit.java
index b65fdf9..fa0772c 100755
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayHit.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayHit.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java
index d389a82..daeb417 100755
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
@@ -87,9 +87,9 @@ public class RayTracer implements Runnable {
                                 cameraView.cameraCenter.y,
                                 cameraView.cameraCenter.z),
                         new Point3D(
-                        cx3 - cameraView.cameraCenter.x, cy3
-                        - cameraView.cameraCenter.y, cz3
-                        - cameraView.cameraCenter.z)
+                                cx3 - cameraView.cameraCenter.x, cy3
+                                - cameraView.cameraCenter.y, cz3
+                                - cameraView.cameraCenter.z)
                 );
                 final int c = traceRay(r);
 
@@ -140,13 +140,13 @@ public class RayTracer implements Runnable {
 
                         final Ray r1 = new Ray(
                                 new Point3D(
-                                ray.hitCellX,
-                                ray.hitCellY - (float) 1.5,
-                                ray.hitCellZ),
+                                        ray.hitCellX,
+                                        ray.hitCellY - (float) 1.5,
+                                        ray.hitCellZ),
 
                                 new Point3D((float) l.location.x - (float) ray.hitCellX, l.location.y
-                                - (ray.hitCellY - (float) 1.5), (float) l.location.z
-                                - (float) ray.hitCellZ)
+                                        - (ray.hitCellY - (float) 1.5), (float) l.location.z
+                                        - (float) ray.hitCellZ)
                         );
 
                         final int rt1 = octreeVolume.traceCell(0, 0, 0,
@@ -160,13 +160,13 @@ public class RayTracer implements Runnable {
 
                         final Ray r2 = new Ray(
                                 new Point3D(
-                                ray.hitCellX - (float) 1.5,
-                                ray.hitCellY, ray.hitCellZ),
+                                        ray.hitCellX - (float) 1.5,
+                                        ray.hitCellY, ray.hitCellZ),
 
                                 new Point3D(
-                                l.location.x - (ray.hitCellX - (float) 1.5), (float) l.location.y
-                                - (float) ray.hitCellY, (float) l.location.z
-                                - (float) ray.hitCellZ)
+                                        l.location.x - (ray.hitCellX - (float) 1.5), (float) l.location.y
+                                        - (float) ray.hitCellY, (float) l.location.z
+                                        - (float) ray.hitCellZ)
                         );
 
                         final int rt2 = octreeVolume.traceCell(0, 0, 0,
@@ -186,13 +186,13 @@ public class RayTracer implements Runnable {
                         }
 
                         final Ray r3 = new Ray(
-                                new Point3D (
-                                ray.hitCellX, ray.hitCellY,
-                                ray.hitCellZ - (float) 1.5),
                                 new Point3D(
-                                (float) l.location.x - (float) ray.hitCellX, (float) l.location.y
-                                - (float) ray.hitCellY, l.location.z
-                                - (ray.hitCellZ - (float) 1.5))
+                                        ray.hitCellX, ray.hitCellY,
+                                        ray.hitCellZ - (float) 1.5),
+                                new Point3D(
+                                        (float) l.location.x - (float) ray.hitCellX, (float) l.location.y
+                                        - (float) ray.hitCellY, l.location.z
+                                        - (ray.hitCellZ - (float) 1.5))
                         );
 
                         final int rt3 = octreeVolume.traceCell(0, 0, 0,
@@ -212,14 +212,14 @@ public class RayTracer implements Runnable {
 
                         final Ray r4 = new Ray(
                                 new Point3D(
-                                ray.hitCellX,
-                                ray.hitCellY+ (float) 1.5,
-                                ray.hitCellZ),
+                                        ray.hitCellX,
+                                        ray.hitCellY + (float) 1.5,
+                                        ray.hitCellZ),
 
                                 new Point3D(
-                                (float) l.location.x - (float) ray.hitCellX, l.location.y
-                                - (ray.hitCellY + (float) 1.5), (float) l.location.z
-                                - (float) ray.hitCellZ)
+                                        (float) l.location.x - (float) ray.hitCellX, l.location.y
+                                        - (ray.hitCellY + (float) 1.5), (float) l.location.z
+                                        - (float) ray.hitCellZ)
                         );
 
                         final int rt4 = octreeVolume.traceCell(0, 0, 0,
@@ -239,14 +239,14 @@ public class RayTracer implements Runnable {
 
                         final Ray r5 = new Ray(
                                 new Point3D(
-                                ray.hitCellX + (float) 1.5,
-                                ray.hitCellY, ray.hitCellZ),
+                                        ray.hitCellX + (float) 1.5,
+                                        ray.hitCellY, ray.hitCellZ),
 
                                 new Point3D(
-                                l.location.x - (ray.hitCellX + (float) 1.5), (float) l.location.y
-                                - (float) ray.hitCellY, (float) l.location.z
-                                - (float) ray.hitCellZ)
-                            );
+                                        l.location.x - (ray.hitCellX + (float) 1.5), (float) l.location.y
+                                        - (float) ray.hitCellY, (float) l.location.z
+                                        - (float) ray.hitCellZ)
+                        );
 
                         final int rt5 = octreeVolume.traceCell(0, 0, 0,
                                 octreeVolume.masterCellSize, 0, r5);
@@ -265,14 +265,14 @@ public class RayTracer implements Runnable {
 
                         final Ray r6 = new Ray(
                                 new Point3D(
-                                ray.hitCellX, ray.hitCellY,
-                                ray.hitCellZ + (float) 1.5),
+                                        ray.hitCellX, ray.hitCellY,
+                                        ray.hitCellZ + (float) 1.5),
 
                                 new Point3D(
 
-                                (float) l.location.x - (float) ray.hitCellX, (float) l.location.y
-                                - (float) ray.hitCellY, l.location.z
-                                - (ray.hitCellZ + (float) 1.5)));
+                                        (float) l.location.x - (float) ray.hitCellX, (float) l.location.y
+                                        - (float) ray.hitCellY, l.location.z
+                                        - (ray.hitCellZ + (float) 1.5)));
 
                         final int rt6 = octreeVolume.traceCell(0, 0, 0,
                                 octreeVolume.masterCellSize, 0, r6);
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/package-info.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/package-info.java
index 66ff9d3..a3bbd8b 100755
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/package-info.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/package-info.java
@@ -1,8 +1,8 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  *
-*
+ *
  * Raytracer through voxel data that is stored in octree.
  */
 
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/package-info.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/package-info.java
index d93100b..4de6f25 100755
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/package-info.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/package-info.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  *
  * Various 3D renderers utilizing different rendering approaches.
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/Color.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/Color.java
index 9c51f1e..a78192d 100644
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/Color.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/Color.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.renderer.raster;
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/RenderAggregator.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/RenderAggregator.java
index dca0066..d6da472 100644
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/RenderAggregator.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/RenderAggregator.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.renderer.raster;
@@ -13,8 +13,8 @@ import java.util.Comparator;
 
 public class RenderAggregator {
 
-    private ArrayList shapes = new ArrayList<>();
-    private ShapesZIndexComparator comparator = new ShapesZIndexComparator();
+    private final ArrayList shapes = new ArrayList<>();
+    private final ShapesZIndexComparator comparator = new ShapesZIndexComparator();
 
     public void paint(final RenderingContext renderBuffer) {
         shapes.sort(comparator);
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/ShapeCollection.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/ShapeCollection.java
index b58de06..11ab674 100755
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/ShapeCollection.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/ShapeCollection.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.renderer.raster;
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/package-info.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/package-info.java
index deaf60d..464b681 100755
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/package-info.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/package-info.java
@@ -1,8 +1,8 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  *
-*
+ *
  * 
  * Realtime renderer (in software) using traditional approaches:
  *      Wireframe
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractCoordinateShape.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractCoordinateShape.java
index 7f0daf1..d42ac78 100644
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractCoordinateShape.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractCoordinateShape.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.renderer.raster.shapes;
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractShape.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractShape.java
index 7909d70..61cf4d7 100644
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractShape.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/AbstractShape.java
@@ -1,5 +1,5 @@
 /*
- * Sixth 3D engine. Author: Svjatoslav Agejenko. 
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
  * This project is released under Creative Commons Zero (CC0) license.
  */
 package eu.svjatoslav.sixth.e3d.renderer.raster.shapes;
diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/ForwardOrientedTexture.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/ForwardOrientedTexture.java
index 7f13783..3f9f084 100644
--- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/ForwardOrientedTexture.java
+++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/ForwardOrientedTexture.java
@@ -18,9 +18,9 @@ public class ForwardOrientedTexture extends AbstractCoordinateShape {
 
     /**
      * Scale of the texture object.
-     *
+     * 

* Object rendered visible size on the screen depends on underlying texture size and scale. - * + *

* 0 means that object will be infinitely small. * 1 in recommended value to maintain sharpness of the texture as seen by the viewer. */ diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/GlowingPoint.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/GlowingPoint.java index 14e213c..6541aca 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/GlowingPoint.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/GlowingPoint.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic; @@ -68,7 +68,7 @@ public class GlowingPoint extends ForwardOrientedTexture { for (int y = 0; y < TEXTURE_RESOLUTION_PIXELS; y++) { int address = texture.primaryBitmap.getAddress(x, y); - final int distanceFromCenter = (int) sqrt(pow (halfResolution - x, 2) + pow (halfResolution - y, 2)); + final int distanceFromCenter = (int) sqrt(pow(halfResolution - x, 2) + pow(halfResolution - y, 2)); int alpha = 255 - ((270 * distanceFromCenter) / halfResolution); if (alpha < 0) diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/Line.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/Line.java index 6a4bf2d..10896ec 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/Line.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/Line.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/LineAppearance.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/LineAppearance.java index 0e99f35..4cf0007 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/LineAppearance.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/LineAppearance.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/LineInterpolator.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/LineInterpolator.java index 12b698c..b0428e2 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/LineInterpolator.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/LineInterpolator.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line; @@ -17,11 +17,9 @@ public class LineInterpolator { if (y1 < y2) { if (y >= y1) - if (y <= y2) - return true; + return y <= y2; } else if (y >= y2) - if (y <= y1) - return true; + return y <= y1; return false; } diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/LineInterpolator.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/LineInterpolator.java index 93545f0..8f028cc 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/LineInterpolator.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/LineInterpolator.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.solidpolygon; @@ -43,11 +43,9 @@ public class LineInterpolator implements Comparable { if (p1.y <= p2.y) { if (y >= p1.y) - if (y <= p2.y) - return true; + return y <= p2.y; } else if (y >= p2.y) - if (y <= p1.y) - return true; + return y <= p1.y; return false; } diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/SolidPolygon.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/SolidPolygon.java index 87143b5..7f59169 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/SolidPolygon.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/SolidPolygon.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.solidpolygon; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/texturedpolygon/PolygonBorderInterpolator.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/texturedpolygon/PolygonBorderInterpolator.java index 1300e3a..c0ae36f 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/texturedpolygon/PolygonBorderInterpolator.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/texturedpolygon/PolygonBorderInterpolator.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.texturedpolygon; @@ -56,11 +56,9 @@ public class PolygonBorderInterpolator implements if (p1.y < p2.y) { if (y >= p1.y) - if (y <= p2.y) - return true; + return y <= p2.y; } else if (y >= p2.y) - if (y <= p1.y) - return true; + return y <= p1.y; return false; } diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/texturedpolygon/TexturedPolygon.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/texturedpolygon/TexturedPolygon.java index 7a6f2bf..972f6bb 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/texturedpolygon/TexturedPolygon.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/texturedpolygon/TexturedPolygon.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.texturedpolygon; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/ForwardOrientedTextBlock.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/ForwardOrientedTextBlock.java index 30e92bc..20a68c1 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/ForwardOrientedTextBlock.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/ForwardOrientedTextBlock.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java index e605823..7af3eab 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/Graph.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/TexturedRectangle.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/TexturedRectangle.java index 776c41d..919a87e 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/TexturedRectangle.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/TexturedRectangle.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java index 747dd08..55c81e8 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/AbstractCompositeShape.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base; @@ -117,7 +117,7 @@ public class AbstractCompositeShape extends AbstractShape { public List getGroup(final String groupIdentifier) { return originalSubShapes.stream().filter( - subShape -> subShape.matchesGroup(groupIdentifier)) + subShape -> subShape.matchesGroup(groupIdentifier)) .collect(Collectors.toList()); } diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/SubShape.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/SubShape.java index 9860b1c..8d279af 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/SubShape.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/base/SubShape.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/solid/SolidPolygonCube.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/solid/SolidPolygonCube.java index 6f70729..8332d93 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/solid/SolidPolygonCube.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/solid/SolidPolygonCube.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.solid; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/solid/SolidPolygonRectangularBox.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/solid/SolidPolygonRectangularBox.java index 21a1b79..1b23d79 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/solid/SolidPolygonRectangularBox.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/solid/SolidPolygonRectangularBox.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.solid; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/CanvasCharacter.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/CanvasCharacter.java index c66d5b5..b754faf 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/CanvasCharacter.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/CanvasCharacter.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/RenderMode.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/RenderMode.java index eb2f64e..ebc0f86 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/RenderMode.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/RenderMode.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java index 7a0c5e5..854d756 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/textcanvas/TextCanvas.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.textcanvas; @@ -31,7 +31,7 @@ public class TextCanvas extends TexturedRectangle { public static final int FONT_CHAR_HEIGHT_TEXTURE_PIXELS = 32; - public static final Font FONT = CanvasCharacter.getFont((int)(FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.066)); + public static final Font FONT = CanvasCharacter.getFont((int) (FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.066)); private static final String GROUP_TEXTURE = "texture"; private static final String GROUP_CHARACTERS = "characters"; private final TextPointer size; @@ -173,8 +173,8 @@ public class TextCanvas extends TexturedRectangle { graphics.setColor(foreground.toAwtColor()); graphics.drawChars( new char[]{character,}, 0, 1, - (column * FONT_CHAR_WIDTH_TEXTURE_PIXELS) - 0, - (row * FONT_CHAR_HEIGHT_TEXTURE_PIXELS) + (int)(FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.23f)); + (column * FONT_CHAR_WIDTH_TEXTURE_PIXELS), + (row * FONT_CHAR_HEIGHT_TEXTURE_PIXELS) + (int) (FONT_CHAR_HEIGHT_TEXTURE_PIXELS / 1.23f)); getTexture().resetResampledBitmapCache(); } diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/Grid2D.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/Grid2D.java index cd4f4a2..c05f3f3 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/Grid2D.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/Grid2D.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe; @@ -13,11 +13,11 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.base.AbstractCom public class Grid2D extends AbstractCompositeShape { /** - * @param transform Grid location - * @param rectangle Grid dimensions + * @param transform Grid location + * @param rectangle Grid dimensions * @param xDivisionCount Division count along X axis * @param yDivisionCount Division count along Y axis - * @param appearance Grid lines appearance + * @param appearance Grid lines appearance */ public Grid2D(final Transform transform, final Rectangle rectangle, final int xDivisionCount, final int yDivisionCount, diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/Grid3D.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/Grid3D.java index d918ce9..62f42bc 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/Grid3D.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/Grid3D.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeCube.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeCube.java index d91c49c..3345da6 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeCube.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeCube.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeDrawing.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeDrawing.java index d78d729..0a9fd49 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeDrawing.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeDrawing.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeSphere.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeSphere.java index 572623d..40ce99e 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeSphere.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/composite/wireframe/WireframeSphere.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.wireframe; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/BorderLine.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/BorderLine.java index 080bc0d..6f28c36 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/BorderLine.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/BorderLine.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.slicer; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/PolygonCoordinate.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/PolygonCoordinate.java index 539892e..eca9afc 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/PolygonCoordinate.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/PolygonCoordinate.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.slicer; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/Slicer.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/Slicer.java index 29abe41..73c9abf 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/Slicer.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/slicer/Slicer.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.slicer; @@ -23,7 +23,7 @@ public class Slicer { final PolygonCoordinate c2, final PolygonCoordinate c3, final TexturedPolygon originalPolygon) { - final BorderLine lines[] = new BorderLine[]{ + final BorderLine[] lines = new BorderLine[]{ new BorderLine(c1, c2, 1), new BorderLine(c2, c3, 2), new BorderLine(c3, c1, 3)}; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/texture/Texture.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/texture/Texture.java index 6009bb8..70a6107 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/texture/Texture.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/texture/Texture.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.texture; @@ -113,6 +113,7 @@ public class Texture { /** * Returns the bitmap that should be used for rendering at the given zoom + * * @param scaleFactor The upscale factor * @return The bitmap */ @@ -133,6 +134,7 @@ public class Texture { /** * Returns the bitmap that should be used for rendering at the given zoom + * * @param zoomLevel The zoom level * @return The bitmap */ @@ -165,6 +167,7 @@ public class Texture { /** * Upscales the given bitmap by a factor of 2 + * * @param originalBitmap The bitmap to upscale * @return The upscaled bitmap */ @@ -216,9 +219,10 @@ public class Texture { /** * Accumulates the color values of the given pixel + * * @param bitmap The bitmap - * @param x The x coordinate of the pixel - * @param y The y coordinate of the pixel + * @param x The x coordinate of the pixel + * @param y The y coordinate of the pixel */ public void accumulate(final TextureBitmap bitmap, final int x, final int y) { @@ -251,9 +255,10 @@ public class Texture { /** * Stores the accumulated color values in the given bitmap + * * @param bitmap The bitmap - * @param x The x coordinate of the pixel - * @param y The y coordinate of the pixel + * @param x The x coordinate of the pixel + * @param y The y coordinate of the pixel */ public void storeResult(final TextureBitmap bitmap, final int x, final int y) { diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/texture/TextureBitmap.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/texture/TextureBitmap.java index fe1e304..303ab3f 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/texture/TextureBitmap.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/texture/TextureBitmap.java @@ -1,5 +1,5 @@ /* - * Sixth 3D engine. Author: Svjatoslav Agejenko. + * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. */ package eu.svjatoslav.sixth.e3d.renderer.raster.texture; @@ -38,7 +38,7 @@ public class TextureBitmap { * Transfer (render) one pixel from current {@link TextureBitmap} to target raster bitmap. * * @param sourceBitmapPixelAddress Pixel address within current {@link TextureBitmap} as indicated by its offset. - * @param targetBitmap Bitmap of the target image where pixel should be rendered to. + * @param targetBitmap Bitmap of the target image where pixel should be rendered to. * @param targetBitmapPixelAddress Pixel location within target image where pixel should be rendered to. */ public void drawPixel(int sourceBitmapPixelAddress, -- 2.20.1