Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void octree::create_node(node*& cur_node, node* parent, G3D::AABox const& node_box, boost::uint32_t cur_height)
- {
- cur_node = new octree::node(node_box, parent, (cur_height == 0));
- if (cur_height == 0)
- return;
- for (int i = 0; i < 2; ++i)
- {
- for (int j = 0; j < 2; ++j)
- {
- for (int k = 0; k < 2; ++k)
- {
- G3D::Vector3 lo = node_box.low() + (node_box.high() - node_box.low()) * G3D::Vector3(i, j, k) / 2;
- G3D::Vector3 hi = node_box.low() + (node_box.high() - node_box.low()) * G3D::Vector3(i + 1, j + 1, k + 1) / 2;
- create_node(cur_node->child_[i][j][k], cur_node, G3D::AABox(lo, hi), cur_height - 1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement