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%2FRayTracer.java;h=8f7923fe6c1e7487f84deead715fd602c2836bce;hp=ed6c937a6067d767311b0c532f17de203dcfb5b2;hb=cad5276b56cfbd0b194dbacb894fea20b9dd5b15;hpb=6b9b5a6b70397f3cea7b965a54aaacc03cdae4f7 diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java index ed6c937..8f7923f 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/raytracer/RayTracer.java @@ -122,9 +122,9 @@ public class RayTracer implements Runnable { float red = 30, green = 30, blue = 30; for (final LightSource l : lights) { - final int xDist = (l.x - ray.hitCellX); - final int yDist = (l.y - ray.hitCellY); - final int zDist = (l.z - ray.hitCellZ); + final double xDist = (l.location.x - ray.hitCellX); + final double yDist = (l.location.y - ray.hitCellY); + final double zDist = (l.location.z - ray.hitCellZ); double newRed = 0, newGreen = 0, newBlue = 0; double tempRed, tempGreen, tempBlue; @@ -136,8 +136,8 @@ public class RayTracer implements Runnable { final Ray r1 = new Ray(ray.hitCellX, ray.hitCellY - (float) 1.5, ray.hitCellZ, - (float) l.x - (float) ray.hitCellX, l.y - - (ray.hitCellY - (float) 1.5), (float) l.z + (float) l.location.x - (float) ray.hitCellX, l.location.y + - (ray.hitCellY - (float) 1.5), (float) l.location.z - (float) ray.hitCellZ); final int rt1 = octreeVolume.traceCell(0, 0, 0, @@ -152,8 +152,8 @@ public class RayTracer implements Runnable { final Ray r2 = new Ray(ray.hitCellX - (float) 1.5, ray.hitCellY, ray.hitCellZ, - l.x - (ray.hitCellX - (float) 1.5), (float) l.y - - (float) ray.hitCellY, (float) l.z + l.location.x - (ray.hitCellX - (float) 1.5), (float) l.location.y + - (float) ray.hitCellY, (float) l.location.z - (float) ray.hitCellZ); final int rt2 = octreeVolume.traceCell(0, 0, 0, @@ -175,8 +175,8 @@ public class RayTracer implements Runnable { final Ray r3 = new Ray(ray.hitCellX, ray.hitCellY, ray.hitCellZ - (float) 1.5, - (float) l.x - (float) ray.hitCellX, (float) l.y - - (float) ray.hitCellY, l.z + (float) l.location.x - (float) ray.hitCellX, (float) l.location.y + - (float) ray.hitCellY, l.location.z - (ray.hitCellZ - (float) 1.5)); final int rt3 = octreeVolume.traceCell(0, 0, 0, @@ -197,8 +197,8 @@ public class RayTracer implements Runnable { final Ray r4 = new Ray(ray.hitCellX, ray.hitCellY + (float) 1.5, ray.hitCellZ, - (float) l.x - (float) ray.hitCellX, l.y - - (ray.hitCellY + (float) 1.5), (float) l.z + (float) l.location.x - (float) ray.hitCellX, l.location.y + - (ray.hitCellY + (float) 1.5), (float) l.location.z - (float) ray.hitCellZ); final int rt4 = octreeVolume.traceCell(0, 0, 0, @@ -219,8 +219,8 @@ public class RayTracer implements Runnable { final Ray r5 = new Ray(ray.hitCellX + (float) 1.5, ray.hitCellY, ray.hitCellZ, - l.x - (ray.hitCellX + (float) 1.5), (float) l.y - - (float) ray.hitCellY, (float) l.z + l.location.x - (ray.hitCellX + (float) 1.5), (float) l.location.y + - (float) ray.hitCellY, (float) l.location.z - (float) ray.hitCellZ); final int rt5 = octreeVolume.traceCell(0, 0, 0, @@ -241,8 +241,8 @@ public class RayTracer implements Runnable { final Ray r6 = new Ray(ray.hitCellX, ray.hitCellY, ray.hitCellZ + (float) 1.5, - (float) l.x - (float) ray.hitCellX, (float) l.y - - (float) ray.hitCellY, l.z + (float) l.location.x - (float) ray.hitCellX, (float) l.location.y + - (float) ray.hitCellY, l.location.z - (ray.hitCellZ + (float) 1.5)); final int rt6 = octreeVolume.traceCell(0, 0, 0,