projects
/
sixth-3d.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
163f1c4
)
Updated readability of the code.
author
Svjatoslav Agejenko
<svjatoslav@svjatoslav.eu>
Tue, 7 Mar 2023 18:19:25 +0000
(20:19 +0200)
committer
Svjatoslav Agejenko
<svjatoslav@svjatoslav.eu>
Tue, 7 Mar 2023 18:19:25 +0000
(20:19 +0200)
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/IntegerPoint.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/package-info.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/ForwardOrientedTexture.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/line/Line.java
patch
|
blob
|
history
src/main/java/eu/svjatoslav/sixth/e3d/renderer/raster/shapes/basic/solidpolygon/SolidPolygon.java
patch
|
blob
|
history
diff --git
a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/IntegerPoint.java
b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/IntegerPoint.java
index
2aa151c
..
7dce375
100644
(file)
--- a/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/IntegerPoint.java
+++ b/
src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/IntegerPoint.java
@@
-1,5
+1,8
@@
package eu.svjatoslav.sixth.e3d.renderer.octree;
package eu.svjatoslav.sixth.e3d.renderer.octree;
+/**
+ * Point in 3D space. Used for octree. All coordinates are integers.
+ */
public class IntegerPoint
{
public int x, y, z = 0;
public class IntegerPoint
{
public int x, y, z = 0;
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
5cdcef4
..
1317fc8
100755
(executable)
--- 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
@@
-3,7
+3,7
@@
* This project is released under Creative Commons Zero (CC0) license.
*
*
* This project is released under Creative Commons Zero (CC0) license.
*
*
- *
Realtime voxel renderer (in software)
.
+ *
Voxel renderer
.
* Uses octree for data compression.
*/
* Uses octree for data compression.
*/
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
3f9f084
..
cbfd7e3
100644
(file)
--- 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
@@
-11,6
+11,9
@@
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape;
import eu.svjatoslav.sixth.e3d.renderer.raster.texture.Texture;
import eu.svjatoslav.sixth.e3d.renderer.raster.texture.TextureBitmap;
import eu.svjatoslav.sixth.e3d.renderer.raster.texture.Texture;
import eu.svjatoslav.sixth.e3d.renderer.raster.texture.TextureBitmap;
+/**
+ * Texture object that is always oriented towards the viewer.
+ */
public class ForwardOrientedTexture extends AbstractCoordinateShape {
private static final double SCALE_MULTIPLIER = 0.005;
public class ForwardOrientedTexture extends AbstractCoordinateShape {
private static final double SCALE_MULTIPLIER = 0.005;
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
10896ec
..
2366e79
100644
(file)
--- 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
@@
-10,14
+10,26
@@
import eu.svjatoslav.sixth.e3d.gui.RenderingContext;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape;
import eu.svjatoslav.sixth.e3d.renderer.raster.Color;
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape;
+/**
+ * Line in 3D space.
+ *
+ * Line is represented by two points, width and color and width.
+ */
public class Line extends AbstractCoordinateShape {
private static final double MINIMUM_WIDTH_THRESHOLD = 1;
private static final double LINE_WIDTH_MULTIPLIER = 0.2d;
public class Line extends AbstractCoordinateShape {
private static final double MINIMUM_WIDTH_THRESHOLD = 1;
private static final double LINE_WIDTH_MULTIPLIER = 0.2d;
+ /**
+ * width of the line.
+ */
public final double width;
public final double width;
- final LineInterpolator[] li = new LineInterpolator[4];
+ final LineInterpolator[] lineInterpolators = new LineInterpolator[4];
+
+ /**
+ * Color of the line.
+ */
public Color color;
public Line(final Line parentLine) {
public Color color;
public Line(final Line parentLine) {
@@
-34,8
+46,8
@@
public class Line extends AbstractCoordinateShape {
this.color = color;
this.width = width;
this.color = color;
this.width = width;
- for (int i = 0; i < li.length; i++)
- li[i] = new LineInterpolator();
+ for (int i = 0; i < li
neInterpolators
.length; i++)
+ li
neInterpolators
[i] = new LineInterpolator();
}
}
@@
-215,8
+227,8
@@
public class Line extends AbstractCoordinateShape {
private int getLineInterpolator(final int startPointer, final int y) {
private int getLineInterpolator(final int startPointer, final int y) {
- for (int i = startPointer; i < li.length; i++)
- if (li[i].containsY(y))
+ for (int i = startPointer; i < li
neInterpolators
.length; i++)
+ if (li
neInterpolators
[i].containsY(y))
return i;
return -1;
}
return i;
return -1;
}
@@
-274,11
+286,11
@@
public class Line extends AbstractCoordinateShape {
final double p2x2 = onScreenPoint2.x + xdec2;
final double p2y2 = onScreenPoint2.y - yinc2;
final double p2x2 = onScreenPoint2.x + xdec2;
final double p2y2 = onScreenPoint2.y - yinc2;
- li[0].setPoints(p1x1, p1y1, 1d, p2x1, p2y1, 1d);
- li[1].setPoints(p1x2, p1y2, -1d, p2x2, p2y2, -1d);
+ li
neInterpolators
[0].setPoints(p1x1, p1y1, 1d, p2x1, p2y1, 1d);
+ li
neInterpolators
[1].setPoints(p1x2, p1y2, -1d, p2x2, p2y2, -1d);
- li[2].setPoints(p1x1, p1y1, 1d, p1x2, p1y2, -1d);
- li[3].setPoints(p2x1, p2y1, 1d, p2x2, p2y2, -1d);
+ li
neInterpolators
[2].setPoints(p1x1, p1y1, 1d, p1x2, p1y2, -1d);
+ li
neInterpolators
[3].setPoints(p2x1, p2y1, 1d, p2x2, p2y2, -1d);
double ymin = p1y1;
if (p1y2 < ymin)
double ymin = p1y1;
if (p1y2 < ymin)
@@
-305,7
+317,7
@@
public class Line extends AbstractCoordinateShape {
if (li1 != -1) {
final int li2 = getLineInterpolator(li1 + 1, y);
if (li2 != -1)
if (li1 != -1) {
final int li2 = getLineInterpolator(li1 + 1, y);
if (li2 != -1)
- drawHorizontalLine(li
[li1], li
[li2], y, buffer);
+ drawHorizontalLine(li
neInterpolators[li1], lineInterpolators
[li2], y, buffer);
}
}
}
}
}
}
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
7f59169
..
1b4bcfc
100644
(file)
--- 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
@@
-13,6
+13,9
@@
import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.AbstractCoordinateShape;
import static eu.svjatoslav.sixth.e3d.geometry.Polygon.pointWithinPolygon;
import static eu.svjatoslav.sixth.e3d.geometry.Polygon.pointWithinPolygon;
+/**
+ * polygon with solid color.
+ */
public class SolidPolygon extends AbstractCoordinateShape {
private final static LineInterpolator polygonBoundary1 = new LineInterpolator();
public class SolidPolygon extends AbstractCoordinateShape {
private final static LineInterpolator polygonBoundary1 = new LineInterpolator();