| 9 | using namespace octomath; |
| 10 | |
| 11 | OcTree* generateSphereTree(point3d origin, float radius){ |
| 12 | OcTree* tree = new OcTree(0.05); |
| 13 | |
| 14 | point3d point_on_surface = origin; |
| 15 | point_on_surface.x() += radius; |
| 16 | for (int i=0; i<360; i++) { |
| 17 | for (int j=0; j<360; j++) { |
| 18 | if (!tree->insertRay(origin, origin+point_on_surface)) { |
| 19 | cout << "ERROR while inserting ray from " << origin << " to " << point_on_surface << endl; |
| 20 | } |
| 21 | point_on_surface.rotate_IP (0,0,DEG2RAD(1.)); |
| 22 | } |
| 23 | point_on_surface.rotate_IP (0,DEG2RAD(1.),0); |
| 24 | } |
| 25 | return tree; |
| 26 | } |
| 27 | |
| 28 | int main(int /*argc*/, char** argv) { |
| 29 | |