X-Git-Url: http://www2.svjatoslav.eu/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Feu%2Fsvjatoslav%2Fsixth%2Fe3d%2Frenderer%2Foctree%2FOctreeVolume.java;h=27b948888bbeb4fc18532bbac730d5c939945908;hb=ff13a51ec53b3d2ee1c9309152ed2b40366218b9;hp=9bcbc232971a3c109ceb50be741ad1f5110f66b9;hpb=197ac1b87328bb5b06ba52d3768af04b2007b087;p=sixth-3d.git diff --git a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/OctreeVolume.java b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/OctreeVolume.java index 9bcbc23..27b9488 100755 --- a/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/OctreeVolume.java +++ b/src/main/java/eu/svjatoslav/sixth/e3d/renderer/octree/OctreeVolume.java @@ -1,10 +1,7 @@ /* * Sixth 3D engine. Author: Svjatoslav Agejenko. * This project is released under Creative Commons Zero (CC0) license. - * -* */ - package eu.svjatoslav.sixth.e3d.renderer.octree; import eu.svjatoslav.sixth.e3d.renderer.octree.raytracer.Ray; @@ -29,13 +26,17 @@ import eu.svjatoslav.sixth.e3d.renderer.raster.shapes.basic.line.LineAppearance; public class OctreeVolume { + // cell is not hit by the ray public static final int TRACE_NO_HIT = -1; - /** - * Single solid color. - */ + + // solid cell (contains color and illumination) private static final int CELL_STATE_SOLID = -2; + + // unused cell private static final int CELL_STATE_UNUSED = -1; final LineAppearance factory = new LineAppearance(); + + public int ce1[]; public int ce2[]; public int ce3[]; @@ -409,8 +410,9 @@ public class OctreeVolume { } /** - * @return intersecting cell pointer or -1 if no cell in intersecting this - * ray. + * Trace ray through the world and return pointer to intersecting cell. + * + * @return pointer to intersecting cell or TRACE_NO_HIT if no intersection. */ public int traceCell(final int cellX, final int cellY, final int cellZ, final int cellSize, final int pointer, final Ray ray) {