Oxygen Engine
Modern C++ 3D Engine using OpenGL
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages Concepts
debug.h
1#ifndef OE_SCENE_COMPONENT_SCENE_DEBUG_H
2#define OE_SCENE_COMPONENT_SCENE_DEBUG_H
3
4#include "../../../common.h"
5
6#ifndef OXYGEN_ENGINE_DEBUG_TOOLS
7 #error Debug tools are not included in this build, please enable then with OE_DEBUG_TOOLS CMake option
8#endif
9
10#include "../../../core/device.h"
11#include "../../../gui/manager.h"
12
13#include "../../manager.h"
14
16{
81 {
82 public:
89 {
90 std::uint32_t forward = core::KeyboardKey::KEY_W;
91 std::uint32_t backward = core::KeyboardKey::KEY_S;
92 std::uint32_t left = core::KeyboardKey::KEY_A;
93 std::uint32_t right = core::KeyboardKey::KEY_D;
94 std::uint32_t up = core::KeyboardKey::KEY_Q;
95 std::uint32_t down = core::KeyboardKey::KEY_Z;
96 std::uint32_t walk = core::KeyboardKey::KEY_LEFT_SHIFT;
97 std::uint32_t run = core::KeyboardKey::KEY_LEFT_CONTROL;
98 };
99
109 oe::scene::Manager& scene_manager,
110 core::Device& device,
111 core::Window& window,
112 oe::core::EventHandler& event_handler
113 );
114
122 void update(const std::chrono::nanoseconds delta);
123
131 virtual void onNodeRemove(oe::scene::Node& node) override;
132
138 void render();
139
145 void dumpSceneToFile(const std::string& filename) const;
146
152 void loadSceneFromFile(const std::string& filename);
153
157 bool show_help_tooltips = false;
158
162 bool show_origin = true;
163
168
173
178
183
184 #ifdef OXYGEN_ENGINE_DEBUG_VALIDATE_ORDERED_OPERATIONS
185 bool is_between_update_render = false;
186 #endif
187
188 private:
189 gui::Manager _gui;
190
191 core::Device& _device;
192 core::Window& _window;
193 oe::core::EventHandler& _event_handler;
194
195 int32_t _last_id = 0;
196
197 int _frame_count = 0;
198 double _render_time = 0;
199
200 int _last_fps = 0;
201
202 bool _fps_camera_mode = false;
203
204 void _move_fps_camera(const std::chrono::nanoseconds delta, oe::scene::Camera& camera);
205 void _generate_gui(nk_context* context);
206
207 void _treat_node(nk_context* context, oe::scene::Node& node);
208 void _node_tooltip(nk_context* context, oe::scene::Node& node);
209
210 void _node_details(nk_context* context, oe::scene::Node& node);
211 void _node_transforms(nk_context* context, oe::scene::Node& node);
212 void _camera_settings(nk_context* context);
213 };
214}
215
216#endif
Show extensive debugging informations about the scene.
Definition debug.h:81
void render()
Render the Debug GUI.
void dumpSceneToFile(const std::string &filename) const
Save all scene transform into a json file.
float fps_camera_sensitivity
FPS Camera mouse sensitivity.
Definition debug.h:182
virtual void onNodeRemove(oe::scene::Node &node) override
Run actions on node removal.
FPSCameraKeyBindings fps_camera_controls
Keybindings to control the FPS Camera.
Definition debug.h:172
float fps_camera_default_speed
FPS Camera Speed.
Definition debug.h:177
void update(const std::chrono::nanoseconds delta)
Update the component.
oe::scene::Node * current_node_details
The node in the detail window.
Definition debug.h:167
void loadSceneFromFile(const std::string &filename)
Load all scene transforms from a json file.
bool show_help_tooltips
Toggle to add tooltips to help understand some widget meaning.
Definition debug.h:157
bool show_origin
Toggle to show world origin.
Definition debug.h:162
Debug(oe::scene::Manager &scene_manager, core::Device &device, core::Window &window, oe::core::EventHandler &event_handler)
Constructor.
The OxygenEngine device that will manage events, windows, scene, etc...
Definition device.h:18
Event handler.
Definition event_handler.h:22
Definition window.h:24
Definition manager.h:39
The "eye of the scene".
Definition camera.h:33
Scene manager.
Definition manager.h:21
Definition node.h:31
Parent class of components that can be bound to a scene::Manager.
Definition scene.h:15
Components bound to the scene.
Definition debug.h:16
Controls to move the FPS Camera.
Definition debug.h:89