MCPcopy Create free account
hub / github.com/RenderKit/embree / Tutorial

Class Tutorial

tutorials/voronoi/voronoi.cpp:19–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17 }
18
19 struct Tutorial : public TutorialApplication
20 {
21 Tutorial()
22 : TutorialApplication("voronoi", FEATURE_RTCORE) {}
23
24#if defined(USE_GLFW)
25
26 void drawGUI() override
27 {
28 ImGui::SliderInt ("Number of points", &g_num_points, 4, 4096);
29 ImGui::Checkbox ("Show Voronoi", &g_show_voronoi);
30 if (!g_show_voronoi)
31 {
32 ImGui::SliderInt ("Number of neighbours", &g_num_knn, 1, 128);
33 ImGui::Checkbox ("Simulate: Point repulsion", &g_point_repulsion);
34 ImGui::InputFloat("Max dist for NN query", &g_tmax);
35 }
36 }
37
38 void keypressed(int key) override
39 {
40 if (key == GLFW_KEY_RIGHT) g_query_point.x += 0.01f;
41 if (key == GLFW_KEY_LEFT) g_query_point.x -= 0.01f;
42 if (key == GLFW_KEY_UP) g_query_point.z -= 0.01f;
43 if (key == GLFW_KEY_DOWN) g_query_point.z += 0.01f;
44 g_query_point = max(g_query_point, Vec3fa(0.f));
45 g_query_point = min(g_query_point, Vec3fa(1.f));
46
47 TutorialApplication::keypressed(key);
48 }
49#endif
50 };
51}
52
53int main(int argc, char** argv) {

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected