Fixed git clone URL
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / renderer / raster / slicer / BorderLine.java
index f364068..b21e5ed 100644 (file)
@@ -1,26 +1,22 @@
 /*
- * Sixth 3D engine. Copyright ©2012-2020, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of version 3 of the GNU Lesser General Public License
- * or later as published by the Free Software Foundation.
- *
+ * Sixth 3D engine. Author: Svjatoslav Agejenko.
+ * This project is released under Creative Commons Zero (CC0) license.
  */
-
 package eu.svjatoslav.sixth.e3d.renderer.raster.slicer;
 
 import eu.svjatoslav.sixth.e3d.geometry.Point2D;
 import eu.svjatoslav.sixth.e3d.geometry.Point3D;
+import eu.svjatoslav.sixth.e3d.math.Vertex;
 
 import java.util.Comparator;
 
 public class BorderLine implements Comparator<BorderLine> {
 
     public final int count;
-    final PolygonCoordinate c1;
-    final PolygonCoordinate c2;
+    final Vertex c1;
+    final Vertex c2;
 
-    public BorderLine(final PolygonCoordinate c1, final PolygonCoordinate c2,
+    public BorderLine(final Vertex c1, final Vertex c2,
                       final int count) {
         this.c1 = c1;
         this.c2 = c2;
@@ -33,12 +29,12 @@ public class BorderLine implements Comparator<BorderLine> {
     }
 
     public double getLength() {
-        return c1.space.getDistanceTo(c2.space);
+        return c1.coordinate.getDistanceTo(c2.coordinate);
     }
 
-    public PolygonCoordinate getMiddlePoint() {
-        return new PolygonCoordinate(new Point3D().computeMiddlePoint(c1.space,
-                c2.space), new Point2D().getMiddle(c1.texture,
-                c2.texture));
+    public Vertex getMiddlePoint() {
+        return new Vertex(
+                new Point3D().computeMiddlePoint(c1.coordinate, c2.coordinate),
+                new Point2D().setToMiddle(c1.textureCoordinate, c2.textureCoordinate));
     }
 }