Updated readability of the code.
[sixth-3d.git] / src / main / java / eu / svjatoslav / sixth / e3d / renderer / octree / raytracer / Ray.java
index 02f21a7..659a989 100755 (executable)
@@ -4,37 +4,26 @@
  */
 package eu.svjatoslav.sixth.e3d.renderer.octree.raytracer;
 
+import eu.svjatoslav.sixth.e3d.geometry.Point3D;
+
 public class Ray {
 
     // ray origin
-    public double x, y, z;
+    public Point3D origin;
 
     // ray direction
-    public double xp, yp, zp;
+    public Point3D direction;
 
     // ray hit point
-    public double hitX, hitY, hitZ;
-
+    public Point3D hitPoint;
 
     public int hitCellSize;
 
     public int hitCellX, hitCellY, hitCellZ;
 
-    public Ray(final double X, final double Y, final double Z, final double Xp,
-               final double Yp, final double Zp) {
-        x = X;
-        y = Y;
-        z = Z;
-        xp = Xp;
-        yp = Yp;
-        zp = Zp;
+    public Ray(Point3D origin, Point3D direction) {
+        this.origin = origin;
+        this.direction = direction;
     }
 
-
-    @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";
-    }
 }