equal
deleted
inserted
replaced
181 { |
181 { |
182 setLeaf(); |
182 setLeaf(); |
183 return; |
183 return; |
184 } |
184 } |
185 |
185 |
186 #if 0 |
186 #if 1 |
187 // export kd-tree as .obj for visualization |
187 // export kd-tree as .obj for visualization |
188 // this would be hard to reconstruct later |
188 // this would be hard to reconstruct later |
189 static ofstream F("kdtree.obj"); |
189 static ofstream F("kdtree.obj"); |
190 Vector3 v; |
190 Vector3 v; |
191 static int f=0; |
191 static int f=0; |
192 v.cell[axis] = splitpos->pos; |
192 v.cell[axis] = split; |
193 v.cell[(axis+1)%3] = bbox.L.cell[(axis+1)%3]; |
193 v.cell[(axis+1)%3] = bbox.L.cell[(axis+1)%3]; |
194 v.cell[(axis+2)%3] = bbox.L.cell[(axis+2)%3]; |
194 v.cell[(axis+2)%3] = bbox.L.cell[(axis+2)%3]; |
195 F << "v " << v.x << " " << v.y << " " << v.z << endl; |
195 F << "v " << v.x << " " << v.y << " " << v.z << endl; |
196 v.cell[(axis+1)%3] = bbox.L.cell[(axis+1)%3]; |
196 v.cell[(axis+1)%3] = bbox.L.cell[(axis+1)%3]; |
197 v.cell[(axis+2)%3] = bbox.H.cell[(axis+2)%3]; |
197 v.cell[(axis+2)%3] = bbox.H.cell[(axis+2)%3]; |