X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fgeometry%2FPoint3D.java;h=3b8ad225a005a81cbab0a2c05c3ef64e50463aa5;hb=d493b94b0d7840799692bbaa16754d342363e9df;hp=6bf2dd3f45b4ea08191cf70167ef85a5c7a99086;hpb=6b9b5a6b70397f3cea7b965a54aaacc03cdae4f7;p=sixth-3d.git 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..3b8ad22 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/geometry/Point3D.java @@ -1,9 +1,11 @@ /* - * 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; +import eu.svjatoslav.sixth.e3d.renderer.octree.IntegerPoint; + import static java.lang.Math.*; /** @@ -36,6 +38,13 @@ public class Point3D implements Cloneable { this.z = z; } + public Point3D(IntegerPoint point) { + this.x = point.x; + this.y = point.y; + this.z = point.z; + } + + /** * Creates new current point by cloning coordinates from parent point. */ @@ -60,9 +69,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 +167,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 +239,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.