X-Git-Url: http://www2.svjatoslav.eu/gitweb/?p=sixth-3d.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Frenderer%2Foctree%2Fraytracer%2FRay.java;fp=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Frenderer%2Foctree%2Fraytracer%2FRay.java;h=02f21a77c708c276f2d0b541f5846ca511d54998;hp=b0dec8227a93a929b64f4acee1d47bdd86f8fa12;hb=8aa50f568d2edcfe974ceed4192158951e7f3215;hpb=9d03f0af97129ee791c0b1a33703fe1e34e9c050 diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Ray.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Ray.java index b0dec82..02f21a7 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Ray.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/Ray.java @@ -6,35 +6,20 @@ package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer; public class Ray { + // ray origin public double x, y, z; + // ray direction public double xp, yp, zp; + // ray hit point public double hitX, hitY, hitZ; + public int hitCellSize; public int hitCellX, hitCellY, hitCellZ; - /* - * public int orientation; - * - * public static final int ORIENTATION_RIGHT = 0; - * - * public static final int ORIENTATION_LEFT = 1; - * - * public static final int ORIENTATION_DOWN = 2; - * - * public static final int ORIENTATION_UP = 3; - * - * public static final int ORIENTATION_FORWARD = 4; - * - * public static final int ORIENTATION_BACK = 5; - * - * public static final String orientations[] = { "RIGHT", "LEFT", "DOWN", - * "UP", "FORWARD", "BACK" }; - */ - public Ray(final double X, final double Y, final double Z, final double Xp, final double Yp, final double Zp) { x = X; @@ -43,30 +28,13 @@ public class Ray { xp = Xp; yp = Yp; zp = Zp; - // calculateOrientation(); } - /* - * public void calculateOrientation() { float axp = Math.abs(xp); float ayp - * = Math.abs(yp); float azp = Math.abs(zp); - * - * if (axp > ayp) { if (axp > azp) { if (xp > 0) { orientation = - * ORIENTATION_RIGHT; } else { orientation = ORIENTATION_LEFT; } } else { if - * (zp > 0) { orientation = ORIENTATION_FORWARD; } else { orientation = - * ORIENTATION_BACK; } } } else { if (ayp > azp) { if (yp > 0) { orientation - * = ORIENTATION_DOWN; } else { orientation = ORIENTATION_UP; } } else { if - * (zp > 0) { orientation = ORIENTATION_FORWARD; } else { orientation = - * ORIENTATION_BACK; } } } - * - * - * } - */ + @Override public String toString() { return "Ray \n" + " x " + x + "\n" + " y " + y + "\n" + " z " + z + "\n" + " xp " + xp + "\n" + " yp " + yp + "\n" + " zp " + zp - + "\n"; /* - * + " orientation " + orientations[orientation]; - */ + + "\n"; } }