Elaztek Developer Hub
Blamite Game Engine - blam!  00367.02.08.23.1815.blamite
The core library for the Blamite Game Engine.
ogre_scene_editor.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../../debug_ui.h"
4 
5 #include <limits.h>
6 #include <OGRE/OgreSceneManager.h>
7 
10 
11 namespace Blam::DebugUI::Windows
12 {
17  {
18  private:
19 
20  public:
21  void Draw()
22  {
23  if (show)
24  {
25  if (ImGui::Begin("Ogre Scene Editor", &show))
26  {
28 
30  {
31  Ogre::SceneNode* root = ogre_graphics_system->getSceneManager()->getRootSceneNode();
32 
33  Ogre::Node::NodeVecIterator it = root->getChildIterator();
34 
35  while (it.current() != it.end())
36  {
37  Ogre::Node* node = it.getNext();
38 
39  if (!node)
40  {
41  continue;
42  }
43 
44  std::string entry_name = node->getName();
45 
46  if (ImGui::CollapsingHeader(entry_name.c_str()))
47  {
48  Ogre::Vector3 position = node->getPosition();
49  Ogre::Quaternion orientation = node->getOrientation();
50  Ogre::Vector3 scale = node->getScale();
51 
52  ImGui::DragFloat3("position", (float*)&position);
53  ImGui::DragFloat4("orientation", (float*)&orientation);
54  ImGui::DragFloat3("scale", (float*)&scale);
55 
56  node->setPosition(position);
57  node->setOrientation(orientation);
58  node->setScale(scale);
59  }
60  }
61  }
62  else
63  {
64  ImGui::Text("ogre graphics system was nullptr");
65  }
66  }
67  ImGui::End();
68  }
69  }
70  };
71 }
Blam::DebugUI::Windows::OgreSceneEditor::Draw
void Draw()
Draws the contents of the group.
Definition: ogre_scene_editor.hpp:21
BlamRendering::OGRE::GetGraphicsSystem
BLAM Demo::GraphicsSystem * GetGraphicsSystem()
Definition: ogre.cpp:310
ImGui::End
IMGUI_API void End()
Definition: imgui.cpp:6016
ogre_graphics_system
Demo::GraphicsSystem * ogre_graphics_system
Definition: ogre.cpp:48
imgui_stdlib.h
rendering.h
Demo::GraphicsSystem::getSceneManager
Ogre::SceneManager * getSceneManager(void) const
Definition: GraphicsSystem.h:146
ImGui::Begin
IMGUI_API bool Begin(const char *name, bool *p_open=NULL, ImGuiWindowFlags flags=0)
Definition: imgui.cpp:5397
ImGui::CollapsingHeader
IMGUI_API bool CollapsingHeader(const char *label, ImGuiTreeNodeFlags flags=0)
Definition: imgui_widgets.cpp:5422
ImGui::Text
IMGUI_API void Text(const char *fmt,...) IM_FMTARGS(1)
Definition: imgui_widgets.cpp:238
Blam::DebugUI::ImGUIDrawingGroup::show
bool show
Controls whether or not the group should be shown. May not be used in all groups.
Definition: debug_ui.h:362
Blam::DebugUI::ImGUIDrawingGroup
Class representing an ImGUI drawing group/draw list item.
Definition: debug_ui.h:359
ImGui::DragFloat3
IMGUI_API bool DragFloat3(const char *label, float v[3], float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
Definition: imgui_widgets.cpp:2174
Demo::GraphicsSystem
Definition: GraphicsSystem.h:26
ImGui::DragFloat4
IMGUI_API bool DragFloat4(const char *label, float v[4], float v_speed=1.0f, float v_min=0.0f, float v_max=0.0f, const char *format="%.3f", float power=1.0f)
Definition: imgui_widgets.cpp:2179
Blam::DebugUI::Windows
Legacy namespace to contain data for the legacy ImGUI console.
Definition: ui.h:19
Blam::DebugUI::Windows::OgreSceneEditor
Class for the Ogre Scene Editor utility.
Definition: ogre_scene_editor.hpp:16