void WaterQuadTree::draw(const Camera &camera, double delta_time) { if (!setup_done()) { return; } if (!camera.intersects_box(_patch->get_center(), _patch->get_extents())) { remove_children(); return; } // Get LOD metric to see if we should draw child quads or just draw this one double rho = compute_level_metric(camera, distance_to_patch(camera, _patch->get_center())); if (rho >= 0.0 || _level > _deepest_level) { _patch->draw(camera, delta_time); remove_children(); } else { // If we already have created the children then just draw them if (_has_children) { if (_northwest->setup_done() && _northeast->setup_done() && _southwest->setup_done() && _southeast->setup_done()) { _northwest->draw(camera, delta_time); _northeast->draw(camera, delta_time); _southwest->draw(camera, delta_time); _southeast->draw(camera, delta_time); } else { // Draw this tile until all children is setup _patch->draw(camera, delta_time); } } else { // Else create children and draw this tile subdivide(); _patch->draw(camera, delta_time); } } }
static int f1 (int f1arg) { int f1loc; f1loc = f1arg - 1; setup_done (); return f1loc; }
static void setup (char arg_c, int arg_i, int arg_j) { char loc_arg_c = arg_c; int loc_arg_i = arg_i; int loc_arg_j = arg_j; info_qt_inc += loc_arg_c + loc_arg_i + loc_arg_j; setup_done (); }