+ ;
+ PostMessage(s.str());
+}
+
+void Interface::ToggleAudio() {
+ config.audio_disabled = !config.audio_disabled;
+ if (config.audio_disabled) {
+ PostMessage("audio off");
+ } else {
+ PostMessage("audio on");
+ }
+}
+
+void Interface::ToggleVisual() {
+ config.visual_disabled = !config.visual_disabled;
+ if (config.visual_disabled) {
+ PostMessage("visual off");
+ } else {
+ PostMessage("visual on");
+ }
+}
+
+void Interface::ToggleDebug() {
+ debug = !debug;
+ if (debug) {
+ UpdateCounter();
+ UpdatePosition();
+ UpdateOrientation();
+ }
+}
+
+void Interface::UpdateCounter() {
+ std::stringstream s;
+ s << std::setprecision(3) <<
+ "avg: " << env.counter.Average().running << "ms, "
+ "peak: " << env.counter.Peak().running << "ms";
+ std::string text = s.str();
+ counter_text.Set(env.assets.small_ui_font, text);
+}
+
+void Interface::UpdatePosition() {
+ std::stringstream s;
+ s << std::setprecision(3) << "pos: " << ctrl.Controlled().AbsolutePosition();
+ position_text.Set(env.assets.small_ui_font, s.str());
+}
+
+void Interface::UpdateOrientation() {
+ std::stringstream s;
+ s << std::setprecision(3) << "pitch: " << rad2deg(ctrl.Pitch())
+ << ", yaw: " << rad2deg(ctrl.Yaw());
+ orientation_text.Set(env.assets.small_ui_font, s.str());