Formatting update
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / renderer / octree / raytracer / Ray.java
1 /*
2  * Sixth 3D engine. Author: Svjatoslav Agejenko. 
3  * This project is released under Creative Commons Zero (CC0) license.
4  */
5 package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
6
7 public class Ray {
8
9     public double x, y, z;
10
11     public double xp, yp, zp;
12
13     public double hitX, hitY, hitZ;
14
15     public int hitCellSize;
16
17     public int hitCellX, hitCellY, hitCellZ;
18
19     /*
20      * public int orientation;
21      *
22      * public static final int ORIENTATION_RIGHT = 0;
23      *
24      * public static final int ORIENTATION_LEFT = 1;
25      *
26      * public static final int ORIENTATION_DOWN = 2;
27      *
28      * public static final int ORIENTATION_UP = 3;
29      *
30      * public static final int ORIENTATION_FORWARD = 4;
31      *
32      * public static final int ORIENTATION_BACK = 5;
33      *
34      * public static final String orientations[] = { "RIGHT", "LEFT", "DOWN",
35      * "UP", "FORWARD", "BACK" };
36      */
37
38     public Ray(final double X, final double Y, final double Z, final double Xp,
39                final double Yp, final double Zp) {
40         x = X;
41         y = Y;
42         z = Z;
43         xp = Xp;
44         yp = Yp;
45         zp = Zp;
46         // calculateOrientation();
47     }
48
49     /*
50      * public void calculateOrientation() { float axp = Math.abs(xp); float ayp
51      * = Math.abs(yp); float azp = Math.abs(zp);
52      *
53      * if (axp > ayp) { if (axp > azp) { if (xp > 0) { orientation =
54      * ORIENTATION_RIGHT; } else { orientation = ORIENTATION_LEFT; } } else { if
55      * (zp > 0) { orientation = ORIENTATION_FORWARD; } else { orientation =
56      * ORIENTATION_BACK; } } } else { if (ayp > azp) { if (yp > 0) { orientation
57      * = ORIENTATION_DOWN; } else { orientation = ORIENTATION_UP; } } else { if
58      * (zp > 0) { orientation = ORIENTATION_FORWARD; } else { orientation =
59      * ORIENTATION_BACK; } } }
60      *
61      *
62      * }
63      */
64     @Override
65     public String toString() {
66         return "Ray \n" + "     x " + x + "\n" + "      y " + y + "\n" + "      z " + z
67                 + "\n" + "      xp " + xp + "\n" + "    yp " + yp + "\n" + "    zp " + zp
68                 + "\n"; /*
69          * + "  orientation " + orientations[orientation];
70          */
71     }
72 }