projects
/
laserbrain_demo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
win32 fixes
[laserbrain_demo]
/
src
/
snode.cc
diff --git
a/src/snode.cc
b/src/snode.cc
index
ffb1d08
..
a1d41ae
100644
(file)
--- a/
src/snode.cc
+++ b/
src/snode.cc
@@
-3,6
+3,7
@@
#include <algorithm>
#include "snode.h"
#include "objmesh.h"
#include <algorithm>
#include "snode.h"
#include "objmesh.h"
+#include "dbg_gui.h"
SceneNode::SceneNode()
: scale(1, 1, 1)
SceneNode::SceneNode()
: scale(1, 1, 1)
@@
-194,12
+195,26
@@
void SceneNode::update_node(float dt)
void SceneNode::update(float dt)
{
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++) {
update_node(dt);
int num = children.size();
for(int i=0; i<num; i++) {
+ parent_expanded = expanded;
children[i]->update(dt);
}
children[i]->update(dt);
}
+
+ if(debug_gui && expanded) {
+ ImGui::TreePop();
+ }
}
void SceneNode::apply_xform()
}
void SceneNode::apply_xform()