void GameView::paintGL() { Core &core = application().core(); GBuffer &gbuffer = my_world->processors().video.get_gbuffer(); core.video_service().bind_write_framebuffer(gbuffer.get_render_framebuffer()); if (my_world == nullptr) { return; } core.resource_service().poll(); glClearColor(0.09, 0.17, 0.27, 1); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); if (my_is_free_look_enabled) { my_world->set_camera(current_camera()); } my_world->processors().video.render(my_world->camera()); if (my_has_intersection) { draw_intersection(); } my_world->processors().debug.draw(); core.video_service().unbind_write_framebuffer(); my_world->processors().video.get_gbuffer().blit(); }
void treeInterval(nodeptr p, int x1, int x2, int y){ if(p != &nil){ if(p->v.x >= x1 && p->v.x <= x2){ /*交点*/ draw_intersection(cv::Point2i(p->v.x, y)); //緑色の円を描画 std::cout << "(" << p->v.x << ", " << y << ") is intersection" << std::endl; treeInterval(p->lson, x1, x2, y); treeInterval(p->rson, x1, x2, y); } if(p->v.x <= x1) treeInterval(p->rson, x1, x2, y); if(p->v.x >= x2) treeInterval(p->lson, x1, x2, y); } }