diff --git a/build/bin/imgui.ini b/build/bin/imgui.ini index 65cdfba..b6aae43 100644 --- a/build/bin/imgui.ini +++ b/build/bin/imgui.ini @@ -23,8 +23,8 @@ Pos=68,96 Size=740,472 [Window][Set data position] -Pos=0,765 -Size=856,50 +Pos=0,589 +Size=780,30 [Window][Dear ImGui Demo/ResizableChild_478B81A3] IsChild=1 @@ -39,6 +39,6 @@ Pos=60,60 Size=353,1005 [Window][Set visualization plane] -Pos=418,11 -Size=347,56 +Pos=380,0 +Size=400,30 diff --git a/build/bin/mainV5.exe b/build/bin/mainV5.exe new file mode 100644 index 0000000..ede25fe Binary files /dev/null and b/build/bin/mainV5.exe differ diff --git a/src/pieces/headers/piece_interface.hpp b/src/pieces/headers/piece_interface.hpp index 7b261e3..f3cb4cd 100644 --- a/src/pieces/headers/piece_interface.hpp +++ b/src/pieces/headers/piece_interface.hpp @@ -8,9 +8,9 @@ enum class ReferencePlane { - XY, + XZ, YZ, - XZ + XZN }; //classi diff --git a/src/sfml_util.cpp b/src/sfml_util.cpp index be9de71..9159ee3 100644 --- a/src/sfml_util.cpp +++ b/src/sfml_util.cpp @@ -43,7 +43,7 @@ struct State State(unsigned w, unsigned h, std::string title, unsigned int* maj, unsigned int* min, unsigned int* pos) { window = sf::RenderWindow(sf::VideoMode({w, h}), title); - ImGui::SFML::Init(window); + if (ImGui::SFML::Init(window)); // L'if รจ solo per togliere il warning, va aggiustato gestendo le eccezioni clock.restart(); intervalMajLimit = maj; intervalMinLimit = min; @@ -63,13 +63,15 @@ struct State void State::update(){ - - for(PieceInterface* p : pieces){ - p->update(clock); + if (play){ + for(PieceInterface* p : pieces){ + p->update(clock); + } } for(JointInterface* j : joints){ j->movechild(); } + } /// @@ -242,8 +244,8 @@ void doGUI(State &gs) //Finestra gestione piano visualizzazione - ImGui::Begin("Set visualization plane"); - const char* MyEnumNames[] = { "Basso", "Medio", "Alto" }; + ImGui::Begin("Set visualization plane",0,sdp_flags); + const char* MyEnumNames[] = { "XZ", "YZ", "-XZ" }; int currentPlane = (int)gs.selectedPlane; ImGui::SliderInt("Selected Plane", ¤tPlane,0,2,MyEnumNames[currentPlane]); gs.selectedPlane = (ReferencePlane)currentPlane; @@ -251,9 +253,10 @@ void doGUI(State &gs) sf::Vector2u wsize = gs.window.getSize(); - ImGui::SetWindowPos("Set data position",ImVec2(0,wsize.y - 50)); - ImGui::SetWindowSize("Set data position",ImVec2(wsize.x,50)); - + ImGui::SetWindowPos("Set data position",ImVec2(0,wsize.y - 30)); + ImGui::SetWindowSize("Set data position",ImVec2(wsize.x,30)); + ImGui::SetWindowPos("Set visualization plane",ImVec2(wsize.x-400,0)); + ImGui::SetWindowSize("Set visualization plane",ImVec2(400,30)); ImGui::SFML::Render(gs.window); } diff --git a/src/testMain.cpp b/src/testMain.cpp index 796d80a..241ddc5 100755 --- a/src/testMain.cpp +++ b/src/testMain.cpp @@ -59,8 +59,8 @@ int main() { gs.pieces.push_back(new Torso(rb::Vector3{300,400,150},2)); // modifico la rotazione relativa della gamba - gs.pieces[1]->body.setRot({_Float16 (1.3),_Float16 (1.5),0}); - gs.pieces[3]->body.setRot({_Float16 (1.8),_Float16 (1.5),0}); + gs.pieces[1]->body.setRot({_Float16 (1.3),_Float16 (1.7),0}); + gs.pieces[3]->body.setRot({_Float16 (1.8),_Float16 (1.7),0});