reflection geometry finally correct
[laserbrain_demo] / src / snode.cc
index fb2877d..2484e6e 100644 (file)
@@ -224,6 +224,10 @@ void SceneNode::update(float dt)
                        if(ImGui::Button("xform")) {
                                ImGui::OpenPopup("xform_popup");
                        }
+                       ImGui::SameLine();
+                       if(ImGui::Button("bbox")) {
+                               ImGui::OpenPopup("bbox_popup");
+                       }
                        if(ImGui::BeginPopup("xform_popup")) {
                                ImGui::Text("Local transform");
                                Vec3 p = get_node_position();
@@ -250,6 +254,28 @@ void SceneNode::update(float dt)
 
                                ImGui::EndPopup();
                        }
+                       if(ImGui::BeginPopup("bbox_popup")) {
+                               AABox bloc = get_local_bounds();
+                               ImGui::Text("Local bounds:");
+                               if(bloc.max.x < bloc.min.x || bloc.max.y < bloc.min.y || bloc.max.z < bloc.min.z) {
+                                       ImGui::BulletText("invalid");
+                               } else {
+                                       ImGui::BulletText("X: %f - %f", bloc.min.x, bloc.max.x);
+                                       ImGui::BulletText("Y: %f - %f", bloc.min.y, bloc.max.y);
+                                       ImGui::BulletText("Z: %f - %f", bloc.min.z, bloc.max.z);
+                               }
+                               ImGui::Separator();
+                               AABox bbox = get_bounds();
+                               ImGui::Text("Global bounds:");
+                               if(bbox.max.x < bbox.min.x || bbox.max.y < bbox.min.y || bbox.max.z < bbox.min.z) {
+                                       ImGui::BulletText("invalid");
+                               } else {
+                                       ImGui::BulletText("X: %f - %f", bbox.min.x, bbox.max.x);
+                                       ImGui::BulletText("Y: %f - %f", bbox.min.y, bbox.max.y);
+                                       ImGui::BulletText("Z: %f - %f", bbox.min.z, bbox.max.z);
+                               }
+                               ImGui::EndPopup();
+                       }
                        ImGui::NextColumn();
                        ImGui::PopID();
                }