From: Svjatoslav Agejenko Date: Wed, 22 Feb 2023 22:12:04 +0000 (+0200) Subject: Improved code readability X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=commitdiff_plain;h=8aa50f568d2edcfe974ceed4192158951e7f3215;p=sixth-3d.git Improved code readability --- diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java index 9876589..abbf0dd 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/Avatar.java @@ -9,8 +9,16 @@ import eu.svjatoslav.sixth.e3d.geometry.Point3D; import static java.lang.Math.cos; import static java.lang.Math.sin; +/** + * The avatar is a user-controlled object in the 3D world. + */ public class Avatar implements ViewRenderListener { + /** + * Avatar movement speed, relative to the world. When avatar coordinates are + * updated within the world, avatar orientation relative to the world is + * taken into account. + */ public static final double SPEED_LIMIT = 30; /** * Just in case we want to adjust global speed for some reason. @@ -61,6 +69,7 @@ public class Avatar implements ViewRenderListener { setAngleYZ(angleYZ); } + @Override public boolean beforeRender(final ViewPanel viewPanel, final int millisecondsSinceLastFrame) { @@ -116,11 +125,21 @@ public class Avatar implements ViewRenderListener { return movementVector.getVectorLength(); } + /** + * Apply friction to avatar movement vector. + * + * @param millisecondsPassedSinceLastFrame We want avatar movement to be independent of framerate. + * Therefore, we take frame rendering time into account when translating + * avatar between consecutive frames. + */ private void applyFrictionToUserMovement(int millisecondsPassedSinceLastFrame) { for (int i = 0; i < millisecondsPassedSinceLastFrame; i++) applyMillisecondFrictionToUserMovementVector(); } + /** + * Apply friction to avatar movement vector. + */ private void applyMillisecondFrictionToUserMovementVector() { getMovementVector().x /= MILLISECOND_FRICTION; getMovementVector().y /= MILLISECOND_FRICTION; @@ -131,7 +150,7 @@ public class Avatar implements ViewRenderListener { * Translate coordinates based on avatar movement vector and avatar orientation in the world. * * @param millisecondsPassedSinceLastFrame We want avatar movement to be independent of framerate. - * Therefore we take frame rendering time into account when translating + * Therefore, we take frame rendering time into account when translating * avatar between consecutive frames. */ private void translateAvatarLocationBasedOnMovementVector(int millisecondsPassedSinceLastFrame) { 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 8ba9f9f..7e2bf74 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/TextPointer.java @@ -4,6 +4,9 @@ */ package eu.svjatoslav.sixth.e3d.gui; +/** + * A pointer to a character in a text. + */ public class TextPointer implements Comparable { public int row; @@ -48,6 +51,15 @@ public class TextPointer implements Comparable { } + /** + * Checks if this pointer is between the specified pointers. + * + * @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) { if (start == null) @@ -56,6 +68,7 @@ public class TextPointer implements Comparable { if (end == null) return false; + // Make sure that start is smaller than end. TextPointer smaller; TextPointer bigger; @@ -67,8 +80,8 @@ public class TextPointer implements Comparable { bigger = start; } + // Check if this pointer is between the specified pointers. return (compareTo(smaller) >= 0) && (bigger.compareTo(this) > 0); - } } 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 69a2947..4ebca1a 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java @@ -6,7 +6,7 @@ package eu.svjatoslav.sixth.e3d.gui; import eu.svjatoslav.sixth.e3d.geometry.Point3D; import eu.svjatoslav.sixth.e3d.math.GeometryCoordinate; -import eu.svjatoslav.sixth.e3d.math.TransformPipe; +import eu.svjatoslav.sixth.e3d.math.TransformsPipeline; public class UserRelativityTracker { @@ -19,7 +19,7 @@ public class UserRelativityTracker { } - public void analyze(final TransformPipe transformPipe, + public void analyze(final TransformsPipeline transformPipe, final RenderingContext renderingContext) { center.transform(transformPipe, renderingContext); 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 74632b5..3c20ff2 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 @@ -4,12 +4,16 @@ */ package eu.svjatoslav.sixth.e3d.gui.textEditorComponent; +/** + * A character in a text editor. + */ public class Character { + /** + * The character value. + */ char value; - // TODO: background and foreground colors - public Character(final char value) { this.value = value; } 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 a7bff24..784cdc0 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 @@ -6,6 +6,9 @@ package eu.svjatoslav.sixth.e3d.gui.textEditorComponent; import eu.svjatoslav.sixth.e3d.renderer.raster.Color; +/** + * A look and feel of a text editor. + */ public class LookAndFeel { public Color foreground = new Color(255, 255, 255); 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 c52fbd7..0f60618 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 @@ -7,8 +7,14 @@ package eu.svjatoslav.sixth.e3d.gui.textEditorComponent; import java.util.ArrayList; import java.util.List; +/** + * A page in a text editor. + */ public class Page { + /** + * The text lines. + */ public List rows = new ArrayList<>(); public void ensureMaxTextLine(final int row) { @@ -16,28 +22,58 @@ public class Page { rows.add(new TextLine()); } + /** + * Returns the character at the specified location. + * If the location is out of bounds, returns a space. + * + * @return The character at the specified location. + */ public char getChar(final int row, final int column) { if (rows.size() <= row) return ' '; return rows.get(row).getCharForLocation(column); } + /** + * Returns the specified line. + * + * @param row + * The line number. + * @return The line. + */ public TextLine getLine(final int row) { ensureMaxTextLine(row); return rows.get(row); } + /** + * Returns the length of the specified line. + * + * @param row + * The line number. + * @return The length of the line. + */ public int getLineLength(final int row) { if (rows.size() <= row) return 0; return rows.get(row).getLength(); } + /** + * Returns the number of lines in the page. + * + * @return The number of lines in the page. + */ public int getLinesCount() { pack(); return rows.size(); } + /** + * Returns the text of the page. + * + * @return The text of the page. + */ public String getText() { pack(); @@ -58,6 +94,9 @@ public class Page { rows.add(row, textLine); } + /** + * Removes empty lines from the end of the page. + */ private void pack() { int newLength = 0; @@ -73,12 +112,26 @@ public class Page { rows = rows.subList(0, newLength); } + /** + * Removes the specified character from the page. + * + * @param row + * The line number. + * @param col + * The character number. + */ public void removeCharacter(final int row, final int col) { if (rows.size() <= row) return; getLine(row).removeCharacter(col); } + /** + * Removes the specified line from the page. + * + * @param row + * The line number. + */ public void removeLine(final int row) { if (rows.size() <= row) return; 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 93c0535..44b19aa 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 @@ -28,14 +28,25 @@ public class TextEditComponent extends GuiComponent implements ClipboardOwner { */ private final Set dirtyRows = new HashSet<>(); + private final TextCanvas textCanvas; public int scrolledCharacters = 0, scrolledLines = 0; public boolean selecting = false; + + /** + * Selection start and end pointers. + */ public TextPointer selectionStart = new TextPointer(0, 0); public TextPointer selectionEnd = new TextPointer(0, 0); + + public TextPointer cursorLocation = new TextPointer(0, 0); Page page = new Page(); LookAndFeel lookAndFeel; + + /** + * If true, the page will be repainted on the next update. + */ boolean repaintPage = false; public TextEditComponent(final Transform transform, @@ -589,13 +600,6 @@ public class TextEditComponent extends GuiComponent implements ClipboardOwner { dirtyRows.clear(); } - // public void setCaret(final int x, final int y) { - // selecting = false; - // cursorLocation.column = (x / characterWidth) + scrolledCharacters; - // cursorLocation.row = (y / characterHeight) + scrolledLines; - // repaintPage(); - // } - /** * Scroll full page to given amount of lines or charancters. */ diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextLine.java b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextLine.java index aa7d4e2..240ac29 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextLine.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/textEditorComponent/TextLine.java @@ -43,6 +43,7 @@ public class TextLine { return result.toString(); } + public void cutFromBeginning(int charactersToCut) { if (charactersToCut > chars.size()) diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/math/GeometryCoordinate.java b/src/main/java/eu/svjatoslav/sixth/e3d/math/GeometryCoordinate.java index e159295..af3d3d3 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/math/GeometryCoordinate.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/math/GeometryCoordinate.java @@ -8,10 +8,24 @@ import eu.svjatoslav.sixth.e3d.geometry.Point2D; import eu.svjatoslav.sixth.e3d.geometry.Point3D; import eu.svjatoslav.sixth.e3d.gui.RenderingContext; +/** + * A point in 3D space with a transformed and on-screen coordinates. + */ public class GeometryCoordinate { + /** + * The original coordinate. + */ public Point3D coordinate; + + /** + * The transformed coordinate. + */ public Point3D transformedCoordinate; + + /** + * The on-screen coordinate. + */ public Point2D onScreenCoordinate; private int lastTransformedFrame; @@ -28,7 +42,15 @@ public class GeometryCoordinate { onScreenCoordinate = new Point2D(); } - public void transform(final TransformPipe transforms, + /** + * Transforms the coordinate. + * + * @param transforms + * The transform pipe. + * @param renderContext + * The rendering context. + */ + public void transform(final TransformsPipeline transforms, final RenderingContext renderContext) { if (lastTransformedFrame == renderContext.frameNumber) 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 714b781..86db200 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/math/Orientation.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/math/Orientation.java @@ -8,9 +8,17 @@ import eu.svjatoslav.sixth.e3d.geometry.Point3D; public class Orientation implements Cloneable { + private double s1, c1, s2, c2; + /** + * The angle of rotation around the XZ axis. + */ private double angleXZ = 0; + + /** + * The angle of rotation around the YZ axis. + */ private double angleYZ = 0; public Orientation() { @@ -28,6 +36,9 @@ public class Orientation implements Cloneable { return new Orientation(angleXZ, angleYZ); } + /** + * Computes the sine and cosine of the angles. + */ private void computeMultipliers() { s1 = Math.sin(angleXZ); c1 = Math.cos(angleXZ); 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 48bf284..94c359c 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/math/Transform.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/math/Transform.java @@ -16,11 +16,27 @@ public class Transform implements Cloneable { orientation = new Orientation(); } + /** + * Creates a new transform with the specified translation. + * + * @param translation + * the translation + */ public Transform(final Point3D translation) { this.translation = translation; orientation = new Orientation(); } + /** + * 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 + */ public Transform(final Point3D translation, final double angleXZ, final double angleYZ) { @@ -28,6 +44,14 @@ public class Transform implements Cloneable { orientation = new Orientation(angleXZ, angleYZ); } + /** + * Creates a new transform with the specified translation and orientation. + * + * @param translation + * the translation + * @param orientation + * the orientation + */ public Transform(final Point3D translation, final Orientation orientation) { this.translation = translation; this.orientation = orientation; diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/math/TransformPipe.java b/src/main/java/eu/svjatoslav/sixth/e3d/math/TransformPipe.java deleted file mode 100644 index 5b766a2..0000000 --- a/src/main/java/eu/svjatoslav/sixth/e3d/math/TransformPipe.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Sixth 3D engine. Author: Svjatoslav Agejenko. - * This project is released under Creative Commons Zero (CC0) license. - */ -package eu.svjatoslav.sixth.e3d.math; - -import eu.svjatoslav.sixth.e3d.geometry.Point3D; - -public class TransformPipe { - - private Transform[] transforms = new Transform[100]; - - private int transformsCount = 0; - - public void addTransform(final Transform transform) { - transforms[transformsCount] = transform; - transformsCount++; - } - - public void clear() { - transformsCount = 0; - } - - public void dropTransform() { - transformsCount--; - } - - public void transform(final Point3D source, final Point3D destination) { - - destination.clone(source); - - for (int i = transformsCount - 1; i >= 0; i--) - transforms[i].transform(destination); - } -} diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/math/TransformsPipeline.java b/src/main/java/eu/svjatoslav/sixth/e3d/math/TransformsPipeline.java new file mode 100644 index 0000000..4e9985f --- /dev/null +++ b/src/main/java/eu/svjatoslav/sixth/e3d/math/TransformsPipeline.java @@ -0,0 +1,60 @@ +/* + * Sixth 3D engine. Author: Svjatoslav Agejenko. + * This project is released under Creative Commons Zero (CC0) license. + */ +package eu.svjatoslav.sixth.e3d.math; + +import eu.svjatoslav.sixth.e3d.geometry.Point3D; + +public class TransformsPipeline { + + + private Transform[] transforms = new Transform[100]; + + /** + * The number of transforms in the pipeline. + */ + private int transformsCount = 0; + + /** + * Adds a transform to the pipeline. + * + * @param transform + * The transform to add. + */ + public void addTransform(final Transform transform) { + transforms[transformsCount] = transform; + transformsCount++; + } + + /** + * Clears the pipeline. + */ + public void clear() { + transformsCount = 0; + } + + /** + * Drops the last transform from the pipeline. + */ + public void dropTransform() { + transformsCount--; + } + + /** + * Transforms a point. + * + * @param orinigalPoint + * Original point to transform. Original point is not modified. + * @param transformedPoint + * Transformed point. + */ + public void transform(final Point3D orinigalPoint, final Point3D transformedPoint) { + + transformedPoint.clone(orinigalPoint); + + // apply transforms in reverse order + for (int i = transformsCount - 1; i >= 0; i--) + transforms[i].transform(transformedPoint); + } +} 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 87c42c7..27b9488 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 @@ -26,13 +26,17 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance; public class OctreeVolume { + // cell is not hit by the ray public static final int TRACE_NO_HIT = -1; - /** - * Single solid color. - */ + + // solid cell (contains color and illumination) private static final int CELL_STATE_SOLID = -2; + + // unused cell private static final int CELL_STATE_UNUSED = -1; final LineAppearance factory = new LineAppearance(); + + public int ce1[]; public int ce2[]; public int ce3[]; @@ -406,8 +410,9 @@ public class OctreeVolume { } /** - * @return intersecting cell pointer or -1 if no cell in intersecting this - * ray. + * Trace ray through the world and return pointer to intersecting cell. + * + * @return pointer to intersecting cell or TRACE_NO_HIT if no intersection. */ public int traceCell(final int cellX, final int cellY, final int cellZ, final int cellSize, final int pointer, final Ray ray) { 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 b0dec82..02f21a7 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 @@ -6,35 +6,20 @@ package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer; public class Ray { + // ray origin public double x, y, z; + // ray direction public double xp, yp, zp; + // ray hit point public double hitX, hitY, hitZ; + public int hitCellSize; public int hitCellX, hitCellY, hitCellZ; - /* - * public int orientation; - * - * public static final int ORIENTATION_RIGHT = 0; - * - * public static final int ORIENTATION_LEFT = 1; - * - * public static final int ORIENTATION_DOWN = 2; - * - * public static final int ORIENTATION_UP = 3; - * - * public static final int ORIENTATION_FORWARD = 4; - * - * public static final int ORIENTATION_BACK = 5; - * - * public static final String orientations[] = { "RIGHT", "LEFT", "DOWN", - * "UP", "FORWARD", "BACK" }; - */ - public Ray(final double X, final double Y, final double Z, final double Xp, final double Yp, final double Zp) { x = X; @@ -43,30 +28,13 @@ public class Ray { xp = Xp; yp = Yp; zp = Zp; - // calculateOrientation(); } - /* - * public void calculateOrientation() { float axp = Math.abs(xp); float ayp - * = Math.abs(yp); float azp = Math.abs(zp); - * - * if (axp > ayp) { if (axp > azp) { if (xp > 0) { orientation = - * ORIENTATION_RIGHT; } else { orientation = ORIENTATION_LEFT; } } else { if - * (zp > 0) { orientation = ORIENTATION_FORWARD; } else { orientation = - * ORIENTATION_BACK; } } } else { if (ayp > azp) { if (yp > 0) { orientation - * = ORIENTATION_DOWN; } else { orientation = ORIENTATION_UP; } } else { if - * (zp > 0) { orientation = ORIENTATION_FORWARD; } else { orientation = - * ORIENTATION_BACK; } } } - * - * - * } - */ + @Override public String toString() { return "Ray \n" + " x " + x + "\n" + " y " + y + "\n" + " z " + z + "\n" + " xp " + xp + "\n" + " yp " + yp + "\n" + " zp " + zp - + "\n"; /* - * + " orientation " + orientations[orientation]; - */ + + "\n"; } } 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 98b9af4..d93100b 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 @@ -2,8 +2,8 @@ * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. * -* * Various 3D renderers utilizing different rendering approaches. + * */ package eu.svjatoslav.sixth.e3d.renderer; 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 ea14935..302abc1 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 @@ -9,7 +9,7 @@ import eu.svjatoslav.sixth.e3d.gui.Avatar; import eu.svjatoslav.sixth.e3d.gui.RenderingContext; import eu.svjatoslav.sixth.e3d.gui.ViewPanel; import eu.svjatoslav.sixth.e3d.math.Transform; -import eu.svjatoslav.sixth.e3d.math.TransformPipe; +import eu.svjatoslav.sixth.e3d.math.TransformsPipeline; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape; import java.util.ArrayList; @@ -19,7 +19,7 @@ import java.util.List; public class ShapeCollection { private final RenderAggregator aggregator = new RenderAggregator(); - private final TransformPipe transformPipe = new TransformPipe(); + private final TransformsPipeline transformPipe = new TransformsPipeline(); private final List shapes = new ArrayList<>(); public synchronized void addShape(final AbstractShape shape) { 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 30384e6..649e546 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 @@ -7,7 +7,7 @@ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes; import eu.svjatoslav.sixth.e3d.geometry.Point3D; import eu.svjatoslav.sixth.e3d.gui.RenderingContext; import eu.svjatoslav.sixth.e3d.math.GeometryCoordinate; -import eu.svjatoslav.sixth.e3d.math.TransformPipe; +import eu.svjatoslav.sixth.e3d.math.TransformsPipeline; import eu.svjatoslav.sixth.e3d.renderer.raster.RenderAggregator; import java.util.concurrent.atomic.AtomicInteger; @@ -43,7 +43,7 @@ public abstract class AbstractCoordinateShape extends AbstractShape { public abstract void paint(RenderingContext renderBuffer); @Override - public void transform(final TransformPipe transforms, + public void transform(final TransformsPipeline transforms, final RenderAggregator aggregator, final RenderingContext renderingContext) { 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 4f17cd3..4c1aba3 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 @@ -6,7 +6,7 @@ package eu.svjatoslav.sixth.e3d.renderer.raster.shapes; import eu.svjatoslav.sixth.e3d.gui.RenderingContext; import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController; -import eu.svjatoslav.sixth.e3d.math.TransformPipe; +import eu.svjatoslav.sixth.e3d.math.TransformsPipeline; import eu.svjatoslav.sixth.e3d.renderer.raster.RenderAggregator; public abstract class AbstractShape { @@ -18,7 +18,7 @@ public abstract class AbstractShape { this.mouseInteractionController = mouseInteractionController; } - public abstract void transform(final TransformPipe transforms, + public abstract void transform(final TransformsPipeline transforms, final RenderAggregator aggregator, final RenderingContext renderingContext); 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 f952a4a..184d57a 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 @@ -9,7 +9,7 @@ import eu.svjatoslav.sixth.e3d.gui.RenderingContext; import eu.svjatoslav.sixth.e3d.gui.UserRelativityTracker; import eu.svjatoslav.sixth.e3d.gui.humaninput.MouseInteractionController; import eu.svjatoslav.sixth.e3d.math.Transform; -import eu.svjatoslav.sixth.e3d.math.TransformPipe; +import eu.svjatoslav.sixth.e3d.math.TransformsPipeline; import eu.svjatoslav.sixth.e3d.renderer.raster.Color; import eu.svjatoslav.sixth.e3d.renderer.raster.RenderAggregator; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractShape; @@ -64,7 +64,7 @@ public class AbstractCompositeShape extends AbstractShape { * This method should be overridden by anyone wanting to customize shape * before it is rendered. */ - public void beforeTransformHook(final TransformPipe transformPipe, + public void beforeTransformHook(final TransformsPipeline transformPipe, final RenderingContext context) { } @@ -194,7 +194,7 @@ public class AbstractCompositeShape extends AbstractShape { } @Override - public void transform(final TransformPipe transformPipe, + public void transform(final TransformsPipeline transformPipe, final RenderAggregator aggregator, final RenderingContext context) { // add current composite shape transform to the end of the transform 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 7945a54..fd78bf9 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 @@ -8,7 +8,7 @@ import eu.svjatoslav.sixth.e3d.geometry.Point3D; import eu.svjatoslav.sixth.e3d.gui.RenderingContext; import eu.svjatoslav.sixth.e3d.gui.TextPointer; import eu.svjatoslav.sixth.e3d.math.Transform; -import eu.svjatoslav.sixth.e3d.math.TransformPipe; +import eu.svjatoslav.sixth.e3d.math.TransformsPipeline; import eu.svjatoslav.sixth.e3d.renderer.raster.Color; import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.composite.TexturedRectangle; @@ -118,7 +118,7 @@ public class TextCanvas extends TexturedRectangle { } @Override - public void beforeTransformHook(final TransformPipe transformPipe, + public void beforeTransformHook(final TransformsPipeline transformPipe, final RenderingContext context) { final double textRelativeSize = context.width