-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGUICamera.cpp
More file actions
69 lines (57 loc) · 1.9 KB
/
Copy pathGUICamera.cpp
File metadata and controls
69 lines (57 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include "GUICamera.h"
#include "Application.h"
#include "ModuleCamera.h"
#include "ModuleRender.h"
#include "ModuleScene.h"
#include "Skybox.h"
void GUICamera::Draw(const char * title)
{
if (isEnabled)
{
ImGui::SetNextWindowSize(ImVec2(300, 200), ImGuiCond_FirstUseEver);
ImGui::Begin(title, &isEnabled);
ImGui::SliderFloat("FOV", &App->camera->editorCamera->frustum->verticalFov, 0.100f, 3.000f, "%.3f");
App->camera->SetFOV();
ImGui::Text("Camera Position: (%.3f,%.3f,%.3f)", App->camera->editorCamera->frustum->pos.x, App->camera->editorCamera->frustum->pos.y, App->camera->editorCamera->frustum->pos.z);
ImGui::Text("Camera near distance: %.3f", App->camera->editorCamera->frustum->nearPlaneDistance);
ImGui::Text("Camera far distance: %.3f", App->camera->editorCamera->frustum->farPlaneDistance);
ImGui::Text("Time for building iterative quadtree: %f", App->scene->timeIterative);
ImGui::Checkbox("Show Grid", &App->renderer->showGrid);
ImGui::Checkbox("Show Bounding Box", &App->renderer->showBoundingBox);
//Load Skybox only if is activated
if(ImGui::Checkbox("Show Skybox", &App->renderer->showSkybox))
{
if(App->renderer->showSkybox)
{
App->renderer->skybox = new Skybox();
}
else
{
if(App->renderer->skybox != nullptr)
{
delete App->renderer->skybox;
App->renderer->skybox = nullptr;
}
}
}
ImGui::Checkbox("Show QuadTree", &App->renderer->showQuadTree);
ImGui::Checkbox("Show AABBTree", &App->renderer->showAABBTree);
ImGui::Checkbox("Show Frustum", &App->renderer->showFrustum);
//ImGui::Checkbox("Move Objects", &App->scene->moveObjectsArround);
/*
if(ImGui::Button("Generate Cubes"))
{
App->scene->CreateCubesScript();
}
if (ImGui::Button("Generate Shapes"))
{
App->scene->CreateShapesScript();
}
if (ImGui::Button("Generate 1000 Houses"))
{
App->scene->CreateHousesScript();
}
*/
ImGui::End();
}
}