#include <algorithm>
#include "snode.h"
#include "objmesh.h"
+#include "dbg_gui.h"
SceneNode::SceneNode()
: scale(1, 1, 1)
void SceneNode::update(float dt)
{
+ bool expanded = false;
+
+ if(debug_gui) {
+ if(parent_expanded) {
+ int flags = children.empty() ? ImGuiTreeNodeFlags_Leaf : 0;
+ expanded = ImGui::TreeNodeEx(name ? name : "<nameless node>", flags);
+ }
+ }
+
update_node(dt);
int num = children.size();
for(int i=0; i<num; i++) {
+ parent_expanded = expanded;
children[i]->update(dt);
}
+
+ if(debug_gui && expanded) {
+ ImGui::TreePop();
+ }
}
void SceneNode::apply_xform()