erebus

diff liberebus/src/snode.cc @ 8:e2d9bf168a41

semi-works ...
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 24 May 2014 06:12:57 +0300
parents 93894c232d65
children e9da2916bc79
line diff
     1.1 --- a/liberebus/src/snode.cc	Sat May 24 02:27:08 2014 +0300
     1.2 +++ b/liberebus/src/snode.cc	Sat May 24 06:12:57 2014 +0300
     1.3 @@ -158,6 +158,15 @@
     1.4  		}
     1.5  	}
     1.6  
     1.7 +	for(size_t i=0; i<children.size(); i++) {
     1.8 +		if(children[i]->intersect(ray, hit)) {
     1.9 +			if(!hit) return true;
    1.10 +			if(hit->dist < nearest.dist) {
    1.11 +				nearest = *hit;
    1.12 +			}
    1.13 +		}
    1.14 +	}
    1.15 +
    1.16  	if(nearest.dist < FLT_MAX) {
    1.17  		*hit = nearest;
    1.18  		hit->local_ray = local_ray;