40 ImGuiWindowFlags flags = ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoCollapse |
41 ImGuiWindowFlags_NoMove | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar;
44 ImGui::Begin(
"SimActorStats",
nullptr, flags);
47 ImGui::Dummy(ImGui::GetStyle().FramePadding);
55 ImGui::Text(
"%.2f%%", value);
65 const float num_beams_f =
static_cast<float>(num_beams_i);
68 ImGui::Text(
"%d", num_beams_i);
83 ImGui::Text(
"%.2f", avg_deform);
88 ImGui::Text(
"%+08.0f", avg_stress);
96 ImGui::Text(
"%d (%s%d)", num_nodes,
"wheels: ", num_wheelnodes);
107 const double PI = 3.14159265358979323846;
117 ImVec4 rpm_color = (cur_rpm > max_rpm) ? theme.
value_red_text_color : ImGui::GetStyle().Colors[ImGuiCol_Text];
118 ImGui::TextColored(rpm_color,
"%.2f / %.2f", cur_rpm, max_rpm);
123 ImGui::TextColored(rpm_color,
"%.0f", inputshaft_rpm);
127 ImGui::Text(
"%.0f Nm",
Round(torque));
129 const float currentKw = (((cur_rpm * (torque + ((turbo_psi * 6.8) * torque) / 100) * ( PI / 30)) / 1000));
132 ImGui::Text(
"%.0fhp (%.0fKw)",
static_cast<float>(
Round(currentKw *1.34102209)),
static_cast<float>(
Round(currentKw)));
142 float velocityKPH = wheel_speed * 3.6f;
143 float velocityMPH = wheel_speed * 2.23693629f;
144 float carSpeedKPH = n0_velo_len * 3.6f;
145 float carSpeedMPH = n0_velo_len * 2.23693629f;
148 if (fabs(wheel_speed) < 1.0f)
150 velocityKPH = velocityMPH = 0.0f;
152 if (fabs(n0_velo_len) < 1.0f)
154 carSpeedKPH = carSpeedMPH = 0.0f;
159 ImGui::Text(
"%.0fKm/h (%.0f mph)",
Round(velocityKPH),
Round(velocityMPH));
163 ImGui::Text(
"%.0fKm/h (%.0f mph)",
Round(carSpeedKPH),
Round(carSpeedMPH));
167 float speedKN = n0_velo_len * 1.94384449f;
170 ImGui::Text(
"%.0f kn (%.0f Km/h; %.0f mph)",
Round(speedKN),
Round(speedKN * 1.852),
Round(speedKN * 1.151));
177 ImGui::Text(
"%.0f feet (%.0f meters)",
Round(altitude),
Round(altitude * 0.30480));
186 ImGui::Text(
"%.2f RPM", ae.simbuf_ae_rpm);
190 ImGui::Text(
"%.2f", ae.simbuf_ae_rpm);
202 ImGui::Text(
"%f%", screw.simbuf_sp_throttle);
214 ImGui::Text(
"%.0f km/h (%.0f mph)",
Round(speedKPH),
Round(speedMPH));
225 ImGui::PopStyleColor(1);
232 float average_deformation = 0.0f;
233 float beamstress = 0.0f;
236 int beamdeformed = 0;
246 beamstress += std::abs(beam->
stress);
247 float current_deformation = fabs(beam->
L - beam->
refL);
252 average_deformation += current_deformation;