src/kdtree.cc
branchpyrit
changeset 25 b8232edee786
parent 24 d0d76e8a5203
child 28 ffe83ca074f3
equal deleted inserted replaced
24:d0d76e8a5203 25:b8232edee786
   355 			/* signed distance to the splitting plane */
   355 			/* signed distance to the splitting plane */
   356 			t = (splitVal - ray.o.cell[axis]) / ray.dir.cell[axis];
   356 			t = (splitVal - ray.o.cell[axis]) / ray.dir.cell[axis];
   357 
   357 
   358 			/* setup the new exit point and push it onto stack */
   358 			/* setup the new exit point and push it onto stack */
   359 			exPt = new StackElem(farchild, t, Vector3());
   359 			exPt = new StackElem(farchild, t, Vector3());
   360 			exPt->pb[axis] = splitVal;
   360 			exPt->pb.cell[axis] = splitVal;
   361 			exPt->pb[(axis+1)%3] = ray.o.cell[(axis+1)%3] + t * ray.dir.cell[(axis+1)%3];
   361 			exPt->pb.cell[(axis+1)%3] = ray.o.cell[(axis+1)%3] + t * ray.dir.cell[(axis+1)%3];
   362 			exPt->pb[(axis+2)%3] = ray.o.cell[(axis+2)%3] + t * ray.dir.cell[(axis+2)%3];
   362 			exPt->pb.cell[(axis+2)%3] = ray.o.cell[(axis+2)%3] + t * ray.dir.cell[(axis+2)%3];
   363 			st.push_back(exPt);
   363 			st.push_back(exPt);
   364 		} /* while */
   364 		} /* while */
   365 
   365 
   366 		/* current node is the leaf . . . empty or full */
   366 		/* current node is the leaf . . . empty or full */
   367 		/* "intersect ray with each object in the object list, discarding "
   367 		/* "intersect ray with each object in the object list, discarding "