Update the GUI values with the engine settings from the current scene
| 102 | |
| 103 | // Update the GUI values with the engine settings from the current scene |
| 104 | void Gui::resetWithValuesFromCurrentScene() { |
| 105 | |
| 106 | auto test = mApp->getCurrentSceneEngineSettings(); |
| 107 | mCheckboxSleeping->set_checked(mApp->getCurrentSceneEngineSettings().isSleepingEnabled); |
| 108 | mCheckboxGravity->set_checked(mApp->getCurrentSceneEngineSettings().isGravityEnabled); |
| 109 | |
| 110 | std::ostringstream out; |
| 111 | out << std::setprecision(1) << std::fixed << (mApp->getCurrentSceneEngineSettings().timeStep.count() * 1000); |
| 112 | mTextboxTimeStep->set_value(out.str()); |
| 113 | |
| 114 | mTextboxVelocityIterations->set_value(std::to_string(mApp->getCurrentSceneEngineSettings().nbVelocitySolverIterations)); |
| 115 | mTextboxPositionIterations->set_value(std::to_string(mApp->getCurrentSceneEngineSettings().nbPositionSolverIterations)); |
| 116 | |
| 117 | out.str(""); |
| 118 | out << std::setprecision(0) << std::fixed << (mApp->getCurrentSceneEngineSettings().timeBeforeSleep * 1000); |
| 119 | mTextboxTimeSleep->set_value(out.str()); |
| 120 | |
| 121 | out.str(""); |
| 122 | out << std::setprecision(2) << std::fixed << (mApp->getCurrentSceneEngineSettings().sleepLinearVelocity); |
| 123 | mTextboxSleepLinearVel->set_value(out.str()); |
| 124 | |
| 125 | out.str(""); |
| 126 | out << std::setprecision(2) << std::fixed << (mApp->getCurrentSceneEngineSettings().sleepAngularVelocity); |
| 127 | mTextboxSleepAngularVel->set_value(out.str()); |
| 128 | } |
| 129 | |
| 130 | // Update the GUI |
| 131 | void Gui::update() { |