src/kdtree.cc
branchpyrit
changeset 30 33f95441790e
parent 29 574c34441a1c
child 34 28f6e8b9d5d1
equal deleted inserted replaced
29:574c34441a1c 30:33f95441790e
   268 	children[1].subdivide(rbb, maxdepth-1);
   268 	children[1].subdivide(rbb, maxdepth-1);
   269 }
   269 }
   270 
   270 
   271 void KdTree::build()
   271 void KdTree::build()
   272 {
   272 {
   273 	infomsg("* building kd-tree\n");
   273 	dbgmsg(1, "* building kd-tree\n");
   274 	root = new KdNode();
   274 	root = new KdNode();
   275 	ShapeList::iterator shape;
   275 	ShapeList::iterator shape;
   276 	for (shape = shapes.begin(); shape != shapes.end(); shape++)
   276 	for (shape = shapes.begin(); shape != shapes.end(); shape++)
   277 		root->addShape(*shape);
   277 		root->addShape(*shape);
   278 	root->subdivide(bbox, max_depth);
   278 	root->subdivide(bbox, max_depth);