X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Frenderer%2Fraster%2Fslicer%2FBorderLine.java;h=b21e5ed2524c6d3f46a7735ff77cf560e29010ff;hb=HEAD;hp=f36406828738071c58c2d5a3b8e65524711d83b6;hpb=6b39de1e9e80433b78ae731845551e742718d613;p=sixth-3d.git 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 f364068..b21e5ed 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,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 { 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 { } 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)); } }