X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Fgui%2FUserRelativityTracker.java;h=06363ea56f998cdb08fc54885d5766def5175cfd;hb=de8fb260a5e99922231b1d0f437916e796ec6ccb;hp=67e6b28bc4a29bafd8e2bc51f64e1fd38b30d495;hpb=b1e8d7bd8c9d0905e9fe3c46fc84a11779b95982;p=sixth-3d.git 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 67e6b28..06363ea 100644 --- a/src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/gui/UserRelativityTracker.java @@ -1,31 +1,25 @@ /* - * Sixth 3D engine. Copyright ©2012-2017, 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.gui; -import eu.svjatoslav.sixth.e3d.geometry.GeometryCoordinate; import eu.svjatoslav.sixth.e3d.geometry.Point3D; -import eu.svjatoslav.sixth.e3d.geometry.TransformPipe; +import eu.svjatoslav.sixth.e3d.math.Vertex; +import eu.svjatoslav.sixth.e3d.math.TransformsPipeline; public class UserRelativityTracker { - public final static int minimalSliceFactor = 5; - public GeometryCoordinate center = new GeometryCoordinate(); - public GeometryCoordinate right; - public GeometryCoordinate down; + private final static int minimalSliceFactor = 5; + public Vertex center = new Vertex(); + public Vertex right; + public Vertex down; public UserRelativityTracker() { } - public void analyze(final TransformPipe transformPipe, + public void analyze(final TransformsPipeline transformPipe, final RenderingContext renderingContext) { center.transform(transformPipe, renderingContext); @@ -37,8 +31,8 @@ public class UserRelativityTracker { } public void enableOrientationTracking() { - right = new GeometryCoordinate(new Point3D(10, 0, 0)); - down = new GeometryCoordinate(new Point3D(0, 10, 0)); + right = new Vertex(new Point3D(10, 0, 0)); + down = new Vertex(new Point3D(0, 10, 0)); } public double getAngleXY() { @@ -57,8 +51,7 @@ public class UserRelativityTracker { } public double getDistanceToUser() { - return center.transformedCoordinate - .getDistanceTo(Point3D.ZERO); + return center.transformedCoordinate.getVectorLength(); } public double proposeSliceFactor() {