RigsofRods
Soft-body Physics Simulation
OverlayWrapper.cpp
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2005-2012 Pierre-Michel Ricordel
4  Copyright 2007-2012 Thomas Fischer
5  Copyright 2013-2020 Petr Ohlidal
6 
7  For more information, see http://www.rigsofrods.org/
8 
9  Rigs of Rods is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License version 3, as
11  published by the Free Software Foundation.
12 
13  Rigs of Rods is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
25 
26 #include <Ogre.h>
27 #include <Overlay/OgreOverlayManager.h>
28 #include <Overlay/OgreOverlay.h>
29 #include <Overlay/OgreFontManager.h>
30 #include "OverlayWrapper.h"
31 
32 #include "AeroEngine.h"
33 #include "AppContext.h"
34 #include "AutoPilot.h"
35 #include "Actor.h"
36 #include "ActorManager.h"
37 #include "Character.h"
38 #include "DashBoardManager.h"
39 #include "ErrorUtils.h"
40 #include "FlexAirfoil.h"
41 #include "GameContext.h"
42 #include "GfxActor.h"
43 #include "GfxScene.h"
44 #include "Language.h"
45 #include "RoRVersion.h"
46 #include "ScrewProp.h"
47 #include "SoundScriptManager.h"
48 #include "Terrain.h"
49 #include "TurboProp.h"
50 #include "Utils.h"
51 
52 using namespace Ogre;
53 using namespace RoR;
54 
55 bool g_is_scaled = false;
56 
57 OverlayWrapper::OverlayWrapper()
58 {
60  init();
61 }
62 
63 OverlayWrapper::~OverlayWrapper()
64 {
65  showDashboardOverlays(false, nullptr);
66  HideRacingOverlay();
67 }
68 
69 void OverlayWrapper::resizePanel(OverlayElement* oe)
70 {
71  if (g_is_scaled)
72  return;
73  oe->setHeight(oe->getHeight() * (Real)win->getWidth() / (Real)win->getHeight());
74  oe->setTop(oe->getTop() * (Real)win->getWidth() / (Real)win->getHeight());
75 }
76 
77 void OverlayWrapper::reposPanel(OverlayElement* oe)
78 {
79  if (g_is_scaled)
80  return;
81  oe->setTop(oe->getTop() * (Real)win->getWidth() / (Real)win->getHeight());
82 }
83 
84 void OverlayWrapper::placeNeedle(SceneNode* node, float x, float y, float len)
85 {
86  node->setPosition((x - 640.0) / 444.0, (512 - y) / 444.0, -2.0);
87  node->setScale(0.0025, 0.007 * len, 0.007);
88 }
89 
90 Overlay* OverlayWrapper::loadOverlay(String name, bool autoResizeRation)
91 {
92  Overlay* o = OverlayManager::getSingleton().getByName(name);
93  if (!o)
94  return NULL;
95 
96  if (autoResizeRation)
97  {
98  struct LoadedOverlay lo;
99  lo.o = o;
100  lo.orgScaleX = o->getScaleX();
101  lo.orgScaleY = o->getScaleY();
102 
103  m_loaded_overlays.push_back(lo);
104  resizeOverlay(lo);
105  }
106  return o;
107 }
108 
109 void OverlayWrapper::resizeOverlay(LoadedOverlay& lo)
110 {
111  // enforce 4:3 for overlays
112  float w = win->getWidth();
113  float h = win->getHeight();
114  float s = (4.0f / 3.0f) / (w / h);
115 
116  // window is higher than wide
117  if (s > 1)
118  s = (3.0f / 4.0f) / (h / w);
119 
120  // originals
121  lo.o->setScale(lo.orgScaleX, lo.orgScaleY);
122  lo.o->setScroll(0, 0);
123 
124  // now the new values
125  lo.o->setScale(s, s);
126  lo.o->scroll(1 - s, s - 1);
127 }
128 
129 void OverlayWrapper::windowResized()
130 {
131  for (auto it = m_loaded_overlays.begin(); it != m_loaded_overlays.end(); it++)
132  {
133  resizeOverlay(*it);
134  }
135 }
136 
137 OverlayElement* OverlayWrapper::loadOverlayElement(String name)
138 {
139  return OverlayManager::getSingleton().getOverlayElement(name);
140 }
141 
142 Ogre::TextureUnitState* GetTexUnit(Ogre::String material_name) // Internal helper
143 {
144  return MaterialManager::getSingleton().getByName(material_name)->getTechnique(0)->getPass(0)->getTextureUnitState(0);
145 }
146 
147 int OverlayWrapper::init()
148 {
149  m_machine_dashboard_overlay = loadOverlay("tracks/MachineDashboardOverlay");
150  m_aerial_dashboard.dash_overlay = loadOverlay("tracks/AirDashboardOverlay", false);
151  m_aerial_dashboard.needles_overlay = loadOverlay("tracks/AirNeedlesOverlay", false);
152  m_marine_dashboard_overlay = loadOverlay("tracks/BoatDashboardOverlay");
153  m_marine_dashboard_needles_overlay = loadOverlay("tracks/BoatNeedlesOverlay");
154 
155 
156  //adjust dashboard size for screen ratio
157  resizePanel(loadOverlayElement("tracks/pressureo"));
158  resizePanel(loadOverlayElement("tracks/pressureneedle"));
159  MaterialPtr m = MaterialManager::getSingleton().getByName("tracks/pressureneedle_mat");
160  if (!m.isNull())
161  pressuretexture = m->getTechnique(0)->getPass(0)->getTextureUnitState(0);
162  else
163  pressuretexture = nullptr;
164 
165  resizePanel(loadOverlayElement("tracks/machineinstructions"));
166  resizePanel(loadOverlayElement("tracks/machinehelppanel"));
167 
168  resizePanel(OverlayManager::getSingleton().getOverlayElement("tracks/machinedashbar"));
169  resizePanel(OverlayManager::getSingleton().getOverlayElement("tracks/machinedashfiller"));
170 
171  resizePanel(OverlayManager::getSingleton().getOverlayElement("tracks/airdashbar"));
172  resizePanel(OverlayManager::getSingleton().getOverlayElement("tracks/airdashfiller"));
173 
174  OverlayElement* tempoe;
175  resizePanel(tempoe = OverlayManager::getSingleton().getOverlayElement("tracks/thrusttrack1"));
176 
177  resizePanel(OverlayManager::getSingleton().getOverlayElement("tracks/thrusttrack2"));
178  resizePanel(OverlayManager::getSingleton().getOverlayElement("tracks/thrusttrack3"));
179  resizePanel(OverlayManager::getSingleton().getOverlayElement("tracks/thrusttrack4"));
180 
181  resizePanel(m_aerial_dashboard.engines[0].thr_element = loadOverlayElement("tracks/thrust1"));
182  resizePanel(m_aerial_dashboard.engines[1].thr_element = loadOverlayElement("tracks/thrust2"));
183  resizePanel(m_aerial_dashboard.engines[2].thr_element = loadOverlayElement("tracks/thrust3"));
184  resizePanel(m_aerial_dashboard.engines[3].thr_element = loadOverlayElement("tracks/thrust4"));
185 
186  thrtop = 1.0f + tempoe->getTop() + m_aerial_dashboard.engines[0].thr_element->getHeight() * 0.5f;
187  thrheight = tempoe->getHeight() - m_aerial_dashboard.engines[0].thr_element->getHeight() * 2.0f;
188  throffset = m_aerial_dashboard.engines[0].thr_element->getHeight() * 0.5f;
189 
190  m_aerial_dashboard.thrust_track_top = thrtop;
191  m_aerial_dashboard.thrust_track_height = thrheight;
192 
193  m_aerial_dashboard.engines[0].engfire_element = loadOverlayElement("tracks/engfire1");
194  m_aerial_dashboard.engines[1].engfire_element = loadOverlayElement("tracks/engfire2");
195  m_aerial_dashboard.engines[2].engfire_element = loadOverlayElement("tracks/engfire3");
196  m_aerial_dashboard.engines[3].engfire_element = loadOverlayElement("tracks/engfire4");
197  m_aerial_dashboard.engines[0].engstart_element = loadOverlayElement("tracks/engstart1");
198  m_aerial_dashboard.engines[1].engstart_element = loadOverlayElement("tracks/engstart2");
199  m_aerial_dashboard.engines[2].engstart_element = loadOverlayElement("tracks/engstart3");
200  m_aerial_dashboard.engines[3].engstart_element = loadOverlayElement("tracks/engstart4");
201  resizePanel(loadOverlayElement("tracks/airrpm1"));
202  resizePanel(loadOverlayElement("tracks/airrpm2"));
203  resizePanel(loadOverlayElement("tracks/airrpm3"));
204  resizePanel(loadOverlayElement("tracks/airrpm4"));
205  resizePanel(loadOverlayElement("tracks/airpitch1"));
206  resizePanel(loadOverlayElement("tracks/airpitch2"));
207  resizePanel(loadOverlayElement("tracks/airpitch3"));
208  resizePanel(loadOverlayElement("tracks/airpitch4"));
209  resizePanel(loadOverlayElement("tracks/airtorque1"));
210  resizePanel(loadOverlayElement("tracks/airtorque2"));
211  resizePanel(loadOverlayElement("tracks/airtorque3"));
212  resizePanel(loadOverlayElement("tracks/airtorque4"));
213  resizePanel(loadOverlayElement("tracks/airspeed"));
214  resizePanel(loadOverlayElement("tracks/vvi"));
215  resizePanel(loadOverlayElement("tracks/altimeter"));
216  resizePanel(loadOverlayElement("tracks/altimeter_val"));
217  m_aerial_dashboard.alt_value_textarea = (TextAreaOverlayElement*)loadOverlayElement("tracks/altimeter_val");
218  boat_depth_value_taoe = (TextAreaOverlayElement*)loadOverlayElement("tracks/boatdepthmeter_val");
219  resizePanel(loadOverlayElement("tracks/adi-tape"));
220  resizePanel(loadOverlayElement("tracks/adi"));
221  resizePanel(loadOverlayElement("tracks/adi-bugs"));
222  m_aerial_dashboard.adibugstexture = GetTexUnit("tracks/adi-bugs");
223  m_aerial_dashboard.aditapetexture = GetTexUnit("tracks/adi-tape");
224  resizePanel(loadOverlayElement("tracks/aoa"));
225  resizePanel(loadOverlayElement("tracks/hsi"));
226  resizePanel(loadOverlayElement("tracks/hsi-rose"));
227  resizePanel(loadOverlayElement("tracks/hsi-bug"));
228  resizePanel(loadOverlayElement("tracks/hsi-v"));
229  resizePanel(loadOverlayElement("tracks/hsi-h"));
230  m_aerial_dashboard.hsirosetexture = GetTexUnit("tracks/hsi-rose");
231  m_aerial_dashboard.hsibugtexture = GetTexUnit("tracks/hsi-bug");
232  m_aerial_dashboard.hsivtexture = GetTexUnit("tracks/hsi-v");
233  m_aerial_dashboard.hsihtexture = GetTexUnit("tracks/hsi-h");
234  //autopilot
235  reposPanel(loadOverlayElement("tracks/ap_hdg_pack"));
236  reposPanel(loadOverlayElement("tracks/ap_wlv_but"));
237  reposPanel(loadOverlayElement("tracks/ap_nav_but"));
238  reposPanel(loadOverlayElement("tracks/ap_alt_pack"));
239  reposPanel(loadOverlayElement("tracks/ap_vs_pack"));
240  reposPanel(loadOverlayElement("tracks/ap_ias_pack"));
241  reposPanel(loadOverlayElement("tracks/ap_gpws_but"));
242  reposPanel(loadOverlayElement("tracks/ap_brks_but"));
243  m_aerial_dashboard.hdg.Setup("tracks/ap_hdg_but", "tracks/hdg-on", "tracks/hdg-off");
244  m_aerial_dashboard.hdg_trim.Setup("tracks/ap_hdg_up", "tracks/ap_hdg_dn", "tracks/ap_hdg_val");
245  m_aerial_dashboard.wlv.Setup("tracks/ap_wlv_but", "tracks/wlv-on", "tracks/wlv-off");
246  m_aerial_dashboard.nav.Setup("tracks/ap_nav_but", "tracks/nav-on", "tracks/nav-off");
247  m_aerial_dashboard.alt.Setup("tracks/ap_alt_but", "tracks/hold-on", "tracks/hold-off");
248  m_aerial_dashboard.alt_trim.Setup("tracks/ap_alt_up", "tracks/ap_alt_dn", "tracks/ap_alt_val");
249  m_aerial_dashboard.vs.Setup("tracks/ap_vs_but", "tracks/vs-on", "tracks/vs-off");
250  m_aerial_dashboard.vs_trim.Setup("tracks/ap_vs_up", "tracks/ap_vs_dn", "tracks/ap_vs_val");
251  m_aerial_dashboard.ias.Setup("tracks/ap_ias_but", "tracks/athr-on", "tracks/athr-off");
252  m_aerial_dashboard.ias_trim.Setup("tracks/ap_ias_up", "tracks/ap_ias_dn", "tracks/ap_ias_val");
253  m_aerial_dashboard.gpws.Setup("tracks/ap_gpws_but", "tracks/gpws-on", "tracks/gpws-off");
254  m_aerial_dashboard.brks.Setup("tracks/ap_brks_but", "tracks/brks-on", "tracks/brks-off");
255 
256  //boat
257  resizePanel(loadOverlayElement("tracks/boatdashbar"));
258  resizePanel(loadOverlayElement("tracks/boatdashfiller"));
259  resizePanel(loadOverlayElement("tracks/boatthrusttrack1"));
260  resizePanel(loadOverlayElement("tracks/boatthrusttrack2"));
261 
262  //resizePanel(boatmapo=loadOverlayElement("tracks/boatmap"));
263  //resizePanel(boatmapdot=loadOverlayElement("tracks/boatreddot"));
264 
265  resizePanel(bthro1 = loadOverlayElement("tracks/boatthrust1"));
266  resizePanel(bthro2 = loadOverlayElement("tracks/boatthrust2"));
267 
268  resizePanel(loadOverlayElement("tracks/boatspeed"));
269  resizePanel(loadOverlayElement("tracks/boatsteer"));
270  resizePanel(loadOverlayElement("tracks/boatspeedneedle"));
271  resizePanel(loadOverlayElement("tracks/boatsteer/fg"));
272  boatspeedtexture = ((MaterialPtr)(MaterialManager::getSingleton().getByName("tracks/boatspeedneedle_mat")))->getTechnique(0)->getPass(0)->getTextureUnitState(0);
273  boatsteertexture = ((MaterialPtr)(MaterialManager::getSingleton().getByName("tracks/boatsteer/fg_mat")))->getTechnique(0)->getPass(0)->getTextureUnitState(0);
274 
275  //prepare needles
276  speedotexture = ((MaterialPtr)(MaterialManager::getSingleton().getByName("tracks/speedoneedle_mat")))->getTechnique(0)->getPass(0)->getTextureUnitState(0); // Needed for dashboard-prop
277  tachotexture = ((MaterialPtr)(MaterialManager::getSingleton().getByName("tracks/tachoneedle_mat"))) ->getTechnique(0)->getPass(0)->getTextureUnitState(0); // Needed for dashboard-prop
278 
279  resizePanel(loadOverlayElement("tracks/airspeedneedle"));
280  m_aerial_dashboard.airspeedtexture = GetTexUnit("tracks/airspeedneedle_mat");
281 
282  resizePanel(loadOverlayElement("tracks/altimeterneedle"));
283  m_aerial_dashboard.altimetertexture = GetTexUnit("tracks/altimeterneedle_mat");
284 
285  resizePanel(loadOverlayElement("tracks/vvineedle"));
286  m_aerial_dashboard.vvitexture = GetTexUnit("tracks/vvineedle_mat");
287 
288  resizePanel(loadOverlayElement("tracks/aoaneedle"));
289  m_aerial_dashboard.aoatexture = GetTexUnit("tracks/aoaneedle_mat");
290 
291  resizePanel(loadOverlayElement("tracks/airrpm1needle"));
292  m_aerial_dashboard.engines[0].rpm_texture = GetTexUnit("tracks/airrpm1needle_mat");
293  resizePanel(loadOverlayElement("tracks/airrpm2needle"));
294  m_aerial_dashboard.engines[1].rpm_texture = GetTexUnit("tracks/airrpm2needle_mat");
295  resizePanel(loadOverlayElement("tracks/airrpm3needle"));
296  m_aerial_dashboard.engines[2].rpm_texture = GetTexUnit("tracks/airrpm3needle_mat");
297  resizePanel(loadOverlayElement("tracks/airrpm4needle"));
298  m_aerial_dashboard.engines[3].rpm_texture = GetTexUnit("tracks/airrpm4needle_mat");
299 
300  resizePanel(loadOverlayElement("tracks/airpitch1needle"));
301  m_aerial_dashboard.engines[0].pitch_texture = GetTexUnit("tracks/airpitch1needle_mat");
302  resizePanel(loadOverlayElement("tracks/airpitch2needle"));
303  m_aerial_dashboard.engines[1].pitch_texture = GetTexUnit("tracks/airpitch2needle_mat");
304  resizePanel(loadOverlayElement("tracks/airpitch3needle"));
305  m_aerial_dashboard.engines[2].pitch_texture = GetTexUnit("tracks/airpitch3needle_mat");
306  resizePanel(loadOverlayElement("tracks/airpitch4needle"));
307  m_aerial_dashboard.engines[3].pitch_texture = GetTexUnit("tracks/airpitch4needle_mat");
308 
309  resizePanel(loadOverlayElement("tracks/airtorque1needle"));
310  m_aerial_dashboard.engines[0].torque_texture = GetTexUnit("tracks/airtorque1needle_mat");
311  resizePanel(loadOverlayElement("tracks/airtorque2needle"));
312  m_aerial_dashboard.engines[1].torque_texture = GetTexUnit("tracks/airtorque2needle_mat");
313  resizePanel(loadOverlayElement("tracks/airtorque3needle"));
314  m_aerial_dashboard.engines[2].torque_texture = GetTexUnit("tracks/airtorque3needle_mat");
315  resizePanel(loadOverlayElement("tracks/airtorque4needle"));
316  m_aerial_dashboard.engines[3].torque_texture = GetTexUnit("tracks/airtorque4needle_mat");
317 
318  guiGear = loadOverlayElement("tracks/Gear");
319  guiGear3D = loadOverlayElement("tracks/3DGear");
320 
321  guiAuto[0] = (TextAreaOverlayElement*)loadOverlayElement("tracks/AGearR");
322  guiAuto[1] = (TextAreaOverlayElement*)loadOverlayElement("tracks/AGearN");
323  guiAuto[2] = (TextAreaOverlayElement*)loadOverlayElement("tracks/AGearD");
324  guiAuto[3] = (TextAreaOverlayElement*)loadOverlayElement("tracks/AGear2");
325  guiAuto[4] = (TextAreaOverlayElement*)loadOverlayElement("tracks/AGear1");
326 
327  guiAuto3D[0] = (TextAreaOverlayElement*)loadOverlayElement("tracks/3DAGearR");
328  guiAuto3D[1] = (TextAreaOverlayElement*)loadOverlayElement("tracks/3DAGearN");
329  guiAuto3D[2] = (TextAreaOverlayElement*)loadOverlayElement("tracks/3DAGearD");
330  guiAuto3D[3] = (TextAreaOverlayElement*)loadOverlayElement("tracks/3DAGear2");
331  guiAuto3D[4] = (TextAreaOverlayElement*)loadOverlayElement("tracks/3DAGear1");
332 
333  m_truck_pressure_overlay = loadOverlay("tracks/PressureOverlay");
334  m_truck_pressure_needle_overlay = loadOverlay("tracks/PressureNeedleOverlay");
335 
336  m_racing_overlay = loadOverlay("tracks/Racing", false);
337  laptime = (TextAreaOverlayElement*)loadOverlayElement("tracks/Racing/LapTime");
338  bestlaptime = (TextAreaOverlayElement*)loadOverlayElement("tracks/Racing/BestLapTime");
339 
340  g_is_scaled = true;
341 
342  return 0;
343 }
344 
345 void OverlayWrapper::update(float dt)
346 {
347  if (mTimeUntilNextToggle > 0)
348  mTimeUntilNextToggle -= dt;
349 }
350 
351 void OverlayWrapper::showPressureOverlay(bool show)
352 {
353  if (m_truck_pressure_overlay)
354  {
355  if (show)
356  {
357  m_truck_pressure_overlay->show();
358  m_truck_pressure_needle_overlay->show();
359  BITMASK_SET_1(m_visible_overlays, VisibleOverlays::TRUCK_TIRE_PRESSURE_OVERLAY);
360  }
361  else
362  {
363  m_truck_pressure_overlay->hide();
364  m_truck_pressure_needle_overlay->hide();
365  BITMASK_SET_0(m_visible_overlays, VisibleOverlays::TRUCK_TIRE_PRESSURE_OVERLAY);
366  }
367  }
368 }
369 
370 void OverlayWrapper::ToggleDashboardOverlays(ActorPtr actor)
371 {
372  showDashboardOverlays(!m_dashboard_visible, actor);
373 }
374 
375 void OverlayWrapper::showDashboardOverlays(bool show, ActorPtr actor)
376 {
377  m_dashboard_visible = show;
378 
379  // check if we use the new style dashboards
380  if (actor && actor->ar_dashboard && actor->ar_dashboard->WasDashboardLoaded())
381  {
382  actor->ar_dashboard->setVisible(show);
383  return;
384  }
385 
386  if (show)
387  {
388  int mode = actor ? actor->ar_driveable : -1;
389 
390  if (mode == AIRPLANE)
391  {
392  m_aerial_dashboard.needles_overlay->show();
393  m_aerial_dashboard.dash_overlay->show();
394  }
395  else if (mode == BOAT)
396  {
397  m_marine_dashboard_needles_overlay->show();
398  m_marine_dashboard_overlay->show();
399  }
400  else if (mode == MACHINE)
401  {
402  Ogre::OverlayElement* help_elem = OverlayManager::getSingleton().getOverlayElement("tracks/machinehelppanel");
403  if (actor->GetGfxActor()->GetHelpMat())
404  {
405  help_elem->setMaterial(actor->GetGfxActor()->GetHelpMat());
406  }
407  else
408  {
409  help_elem->setMaterialName("tracks/black");
410  }
411  m_machine_dashboard_overlay->show();
412  }
413  }
414  else
415  {
416  m_aerial_dashboard.needles_overlay->hide();
417  m_aerial_dashboard.dash_overlay->hide();
418 
419  m_marine_dashboard_needles_overlay->hide();
420  m_marine_dashboard_overlay->hide();
421 
422  m_machine_dashboard_overlay->hide();
423  }
424 }
425 
426 void OverlayWrapper::updateStats(bool detailed)
427 {
428  static UTFString currFps = _L("Current FPS: ");
429  static UTFString avgFps = _L("Average FPS: ");
430  static UTFString bestFps = _L("Best FPS: ");
431  static UTFString worstFps = _L("Worst FPS: ");
432  static UTFString tris = _L("Triangle Count: ");
433  const RenderTarget::FrameStats& stats = win->getStatistics();
434 
435  // update stats when necessary
436  try
437  {
438  OverlayElement* guiAvg = OverlayManager::getSingleton().getOverlayElement("Core/AverageFps");
439  OverlayElement* guiCurr = OverlayManager::getSingleton().getOverlayElement("Core/CurrFps");
440  OverlayElement* guiBest = OverlayManager::getSingleton().getOverlayElement("Core/BestFps");
441  OverlayElement* guiWorst = OverlayManager::getSingleton().getOverlayElement("Core/WorstFps");
442 
443  guiAvg->setCaption(avgFps + TOSTRING(stats.avgFPS));
444  guiCurr->setCaption(currFps + TOSTRING(stats.lastFPS));
445  guiBest->setCaption(bestFps + TOSTRING(stats.bestFPS) + U(" ") + TOSTRING(stats.bestFrameTime) + U(" ms"));
446  guiWorst->setCaption(worstFps + TOSTRING(stats.worstFPS) + U(" ") + TOSTRING(stats.worstFrameTime) + U(" ms"));
447 
448  OverlayElement* guiTris = OverlayManager::getSingleton().getOverlayElement("Core/NumTris");
449  UTFString triss = tris + TOSTRING(stats.triangleCount);
450  if (stats.triangleCount > 1000000)
451  triss = tris + TOSTRING(stats.triangleCount/1000000.0f) + U(" M");
452  else if (stats.triangleCount > 1000)
453  triss = tris + TOSTRING(stats.triangleCount/1000.0f) + U(" k");
454  guiTris->setCaption(triss);
455 
456  // create some memory texts
457  UTFString memoryText;
458  if (TextureManager::getSingleton().getMemoryUsage() > 1)
459  memoryText = memoryText + _L("Textures: ") + formatBytes(TextureManager::getSingleton().getMemoryUsage()) + U(" / ") + formatBytes(TextureManager::getSingleton().getMemoryBudget()) + U("\n");
460  if (CompositorManager::getSingleton().getMemoryUsage() > 1)
461  memoryText = memoryText + _L("Compositors: ") + formatBytes(CompositorManager::getSingleton().getMemoryUsage()) + U(" / ") + formatBytes(CompositorManager::getSingleton().getMemoryBudget()) + U("\n");
462  if (FontManager::getSingleton().getMemoryUsage() > 1)
463  memoryText = memoryText + _L("Fonts: ") + formatBytes(FontManager::getSingleton().getMemoryUsage()) + U(" / ") + formatBytes(FontManager::getSingleton().getMemoryBudget()) + U("\n");
464  if (GpuProgramManager::getSingleton().getMemoryUsage() > 1)
465  memoryText = memoryText + _L("GPU Program: ") + formatBytes(GpuProgramManager::getSingleton().getMemoryUsage()) + U(" / ") + formatBytes(GpuProgramManager::getSingleton().getMemoryBudget()) + U("\n");
466  if (HighLevelGpuProgramManager::getSingleton().getMemoryUsage() > 1)
467  memoryText = memoryText + _L("HL GPU Program: ") + formatBytes(HighLevelGpuProgramManager::getSingleton().getMemoryUsage()) + U(" / ") + formatBytes(HighLevelGpuProgramManager::getSingleton().getMemoryBudget()) + U("\n");
468  if (MaterialManager::getSingleton().getMemoryUsage() > 1)
469  memoryText = memoryText + _L("Materials: ") + formatBytes(MaterialManager::getSingleton().getMemoryUsage()) + U(" / ") + formatBytes(MaterialManager::getSingleton().getMemoryBudget()) + U("\n");
470  if (MeshManager::getSingleton().getMemoryUsage() > 1)
471  memoryText = memoryText + _L("Meshes: ") + formatBytes(MeshManager::getSingleton().getMemoryUsage()) + U(" / ") + formatBytes(MeshManager::getSingleton().getMemoryBudget()) + U("\n");
472  if (SkeletonManager::getSingleton().getMemoryUsage() > 1)
473  memoryText = memoryText + _L("Skeletons: ") + formatBytes(SkeletonManager::getSingleton().getMemoryUsage()) + U(" / ") + formatBytes(SkeletonManager::getSingleton().getMemoryBudget()) + U("\n");
474  if (MaterialManager::getSingleton().getMemoryUsage() > 1)
475  memoryText = memoryText + _L("Materials: ") + formatBytes(MaterialManager::getSingleton().getMemoryUsage()) + U(" / ") + formatBytes(MaterialManager::getSingleton().getMemoryBudget()) + U("\n");
476  memoryText = memoryText + U("\n");
477 
478  OverlayElement* memoryDbg = OverlayManager::getSingleton().getOverlayElement("Core/MemoryText");
479  memoryDbg->setCaption(memoryText);
480 
481  float sumMem = TextureManager::getSingleton().getMemoryUsage() + CompositorManager::getSingleton().getMemoryUsage() + FontManager::getSingleton().getMemoryUsage() + GpuProgramManager::getSingleton().getMemoryUsage() + HighLevelGpuProgramManager::getSingleton().getMemoryUsage() + MaterialManager::getSingleton().getMemoryUsage() + MeshManager::getSingleton().getMemoryUsage() + SkeletonManager::getSingleton().getMemoryUsage() + MaterialManager::getSingleton().getMemoryUsage();
482  String sumMemoryText = _L("Memory (Ogre): ") + formatBytes(sumMem) + U("\n");
483 
484  OverlayElement* memorySumDbg = OverlayManager::getSingleton().getOverlayElement("Core/CurrMemory");
485  memorySumDbg->setCaption(sumMemoryText);
486  }
487  catch (...)
488  {
489  // ignore
490  }
491 }
492 
493 bool OverlayWrapper::handleMouseMoved()
494 {
495  if (!m_aerial_dashboard.needles_overlay->isVisible())
496  return false;
497  bool res = false;
498 
499  // IMPORTANT: get mouse button state from InputEngine, not from OIS directly
500  // - that state may be dirty, see commentary in `InputEngine::getMouseState()`
501  const OIS::MouseState ms = App::GetInputEngine()->getMouseState();
502 
503  ActorPtr player_actor = App::GetGameContext()->GetPlayerActor();
504 
505  if (!player_actor)
506  return res;
507 
508  float mouseX = ms.X.abs / (float)ms.width;
509  float mouseY = ms.Y.abs / (float)ms.height;
510 
511  // TODO: fix: when the window is scaled, the findElementAt doesn not seem to pick up the correct element :-\
512 
513  if (player_actor->ar_driveable == AIRPLANE && ms.buttonDown(OIS::MB_Left))
514  {
515  const int num_engines = std::min(4, player_actor->ar_num_aeroengines);
516 
517  OverlayElement* element = m_aerial_dashboard.needles_overlay->findElementAt(mouseX, mouseY);
518  if (element)
519  {
520  res = true;
521  float thr_value = 1.0f - ((mouseY - thrtop - throffset) / thrheight);
522  for (int i = 0; i < num_engines; ++i)
523  {
524  if (element == m_aerial_dashboard.engines[i].thr_element)
525  {
526  player_actor->ar_aeroengines[i]->setThrottle(thr_value);
527  }
528  }
529  }
530 
531  element = m_aerial_dashboard.dash_overlay->findElementAt(mouseX, mouseY);
532  if (element)
533  {
534  res = true;
535  for (int i = 0; i < num_engines; ++i)
536  {
537  if (element == m_aerial_dashboard.engines[i].engstart_element)
538  {
539  player_actor->ar_aeroengines[i]->flipStart();
540  }
541  }
542  if (player_actor->ar_autopilot && mTimeUntilNextToggle <= 0)
543  {
544  //heading group
545  if (element == m_aerial_dashboard.hdg.element)
546  {
547  mTimeUntilNextToggle = 0.2;
548  player_actor->ar_autopilot->toggleHeading(Autopilot::HEADING_FIXED);
549  }
550  if (element == m_aerial_dashboard.wlv.element)
551  {
552  mTimeUntilNextToggle = 0.2;
553  player_actor->ar_autopilot->toggleHeading(Autopilot::HEADING_WLV);
554  }
555  if (element == m_aerial_dashboard.nav.element)
556  {
557  mTimeUntilNextToggle = 0.2;
558  player_actor->ar_autopilot->toggleHeading(Autopilot::HEADING_NAV);
559  }
560  //altitude group
561  if (element == m_aerial_dashboard.alt.element)
562  {
563  mTimeUntilNextToggle = 0.2;
564  player_actor->ar_autopilot->toggleAlt(Autopilot::ALT_FIXED);
565  }
566  if (element == m_aerial_dashboard.vs.element)
567  {
568  mTimeUntilNextToggle = 0.2;
569  player_actor->ar_autopilot->toggleAlt(Autopilot::ALT_VS);
570  }
571  //IAS
572  if (element == m_aerial_dashboard.ias.element)
573  {
574  mTimeUntilNextToggle = 0.2;
575  player_actor->ar_autopilot->toggleIAS();
576  }
577  //GPWS
578  if (element == m_aerial_dashboard.gpws.element)
579  {
580  mTimeUntilNextToggle = 0.2;
581  player_actor->ar_autopilot->toggleGPWS();
582  }
583  //BRKS
584  if (element == m_aerial_dashboard.brks.element)
585  {
586  mTimeUntilNextToggle = 0.2;
587  player_actor->parkingbrakeToggle();
588  }
589  //trims
590  if (element == m_aerial_dashboard.hdg_trim.up_button)
591  {
592  mTimeUntilNextToggle = 0.1;
593  player_actor->ar_autopilot->adjHDG(1);
594  }
595  if (element == m_aerial_dashboard.hdg_trim.dn_button)
596  {
597  mTimeUntilNextToggle = 0.1;
598  player_actor->ar_autopilot->adjHDG(-1);
599  }
600  if (element == m_aerial_dashboard.alt_trim.up_button)
601  {
602  mTimeUntilNextToggle = 0.1;
603  player_actor->ar_autopilot->adjALT(100);
604  }
605  if (element == m_aerial_dashboard.alt_trim.dn_button)
606  {
607  mTimeUntilNextToggle = 0.1;
608  player_actor->ar_autopilot->adjALT(-100);
609  }
610  if (element == m_aerial_dashboard.vs_trim.up_button)
611  {
612  mTimeUntilNextToggle = 0.1;
613  player_actor->ar_autopilot->adjVS(100);
614  }
615  if (element == m_aerial_dashboard.vs_trim.dn_button)
616  {
617  mTimeUntilNextToggle = 0.1;
618  player_actor->ar_autopilot->adjVS(-100);
619  }
620  if (element == m_aerial_dashboard.ias_trim.up_button)
621  {
622  mTimeUntilNextToggle = 0.1;
623  player_actor->ar_autopilot->adjIAS(1);
624  }
625  if (element == m_aerial_dashboard.ias_trim.dn_button)
626  {
627  mTimeUntilNextToggle = 0.1;
628  player_actor->ar_autopilot->adjIAS(-1);
629  }
630  }
631  }
632  }
633  return res;
634 }
635 
636 bool OverlayWrapper::handleMousePressed()
637 {
638  return handleMouseMoved();
639 }
640 
641 bool OverlayWrapper::handleMouseReleased()
642 {
643  return handleMouseMoved();
644 }
645 
646 void OverlayWrapper::UpdatePressureOverlay(RoR::GfxActor* ga)
647 {
649  {
650  this->showPressureOverlay(true);
651  const float pressure = ga->GetSimDataBuffer().simbuf_tyre_pressure;
652  Real angle = 135.0 - pressure * 2.7;
653  pressuretexture->setTextureRotate(Degree(angle));
654  }
655  else
656  {
657  this->showPressureOverlay(false);
658  }
659 }
660 
661 void OverlayWrapper::UpdateLandVehicleHUD(RoR::GfxActor* ga)
662 {
663  // gears
664  int vehicle_getgear = ga->GetSimDataBuffer().simbuf_gear;
665  if (vehicle_getgear > 0)
666  {
667  size_t numgears = ga->GetSimDataBuffer().simbuf_num_gears;
668  String gearstr = TOSTRING(vehicle_getgear) + "/" + TOSTRING(numgears);
669  guiGear->setCaption(gearstr);
670  guiGear3D->setCaption(gearstr);
671  }
672  else if (vehicle_getgear == 0)
673  {
674  guiGear->setCaption("N");
675  guiGear3D->setCaption("N");
676  }
677  else
678  {
679  guiGear->setCaption("R");
680  guiGear3D->setCaption("R");
681  }
682 
683  //autogears
684  int cg = ga->GetSimDataBuffer().simbuf_autoshift;
685  for (int i = 0; i < 5; i++)
686  {
687  if (i == cg)
688  {
689  if (i == 1)
690  {
691  guiAuto[i]->setColourTop(ColourValue(1.0, 0.2, 0.2, 1.0));
692  guiAuto[i]->setColourBottom(ColourValue(0.8, 0.1, 0.1, 1.0));
693  guiAuto3D[i]->setColourTop(ColourValue(1.0, 0.2, 0.2, 1.0));
694  guiAuto3D[i]->setColourBottom(ColourValue(0.8, 0.1, 0.1, 1.0));
695  }
696  else
697  {
698  guiAuto[i]->setColourTop(ColourValue(1.0, 1.0, 1.0, 1.0));
699  guiAuto[i]->setColourBottom(ColourValue(0.8, 0.8, 0.8, 1.0));
700  guiAuto3D[i]->setColourTop(ColourValue(1.0, 1.0, 1.0, 1.0));
701  guiAuto3D[i]->setColourBottom(ColourValue(0.8, 0.8, 0.8, 1.0));
702  }
703  }
704  else
705  {
706  if (i == 1)
707  {
708  guiAuto[i]->setColourTop(ColourValue(0.4, 0.05, 0.05, 1.0));
709  guiAuto[i]->setColourBottom(ColourValue(0.3, 0.02, 0.2, 1.0));
710  guiAuto3D[i]->setColourTop(ColourValue(0.4, 0.05, 0.05, 1.0));
711  guiAuto3D[i]->setColourBottom(ColourValue(0.3, 0.02, 0.2, 1.0));
712  }
713  else
714  {
715  guiAuto[i]->setColourTop(ColourValue(0.4, 0.4, 0.4, 1.0));
716  guiAuto[i]->setColourBottom(ColourValue(0.3, 0.3, 0.3, 1.0));
717  guiAuto3D[i]->setColourTop(ColourValue(0.4, 0.4, 0.4, 1.0));
718  guiAuto3D[i]->setColourBottom(ColourValue(0.3, 0.3, 0.3, 1.0));
719  }
720  }
721  }
722 
723  // speedo / calculate speed
724  Real guiSpeedFactor = 7.0 * (140.0 / ga->GetSimDataBuffer().simbuf_speedo_highest_kph);
725  Real angle = 140 - fabs(ga->GetSimDataBuffer().simbuf_wheel_speed * guiSpeedFactor);
726  angle = std::max(-140.0f, angle);
727  speedotexture->setTextureRotate(Degree(angle));
728 
729  // calculate tach stuff
730  Real tachoFactor = 0.072;
732  {
733  tachoFactor = 0.072 * (3500 / ga->GetSimDataBuffer().simbuf_engine_max_rpm);
734  }
735  angle = 126.0 - fabs(ga->GetSimDataBuffer().simbuf_engine_rpm * tachoFactor);
736  angle = std::max(-120.0f, angle);
737  angle = std::min(angle, 121.0f);
738  tachotexture->setTextureRotate(Degree(angle));
739 }
740 
741 void OverlayWrapper::UpdateAerialHUD(RoR::GfxActor* gfx_actor)
742 {
743  RoR::ActorSB& simbuf = gfx_actor->GetSimDataBuffer();
744  RoR::NodeSB* nodes = gfx_actor->GetSimNodeBuffer();
745 
746  auto const& simbuf_ae = simbuf.simbuf_aeroengines;
747  int num_ae = static_cast<int>( simbuf_ae.size() );
748 
749  //throttles
750  m_aerial_dashboard.SetThrottle(0, true, simbuf_ae[0].simbuf_ae_throttle);
751  m_aerial_dashboard.SetThrottle(1, (num_ae > 1), (num_ae > 1) ? simbuf_ae[1].simbuf_ae_throttle : 0.f);
752  m_aerial_dashboard.SetThrottle(2, (num_ae > 2), (num_ae > 2) ? simbuf_ae[2].simbuf_ae_throttle : 0.f);
753  m_aerial_dashboard.SetThrottle(3, (num_ae > 3), (num_ae > 3) ? simbuf_ae[3].simbuf_ae_throttle : 0.f);
754 
755  //fire
756  m_aerial_dashboard.SetEngineFailed(0, simbuf_ae[0].simbuf_ae_failed);
757  m_aerial_dashboard.SetEngineFailed(1, num_ae > 1 && simbuf_ae[1].simbuf_ae_failed);
758  m_aerial_dashboard.SetEngineFailed(2, num_ae > 2 && simbuf_ae[2].simbuf_ae_failed);
759  m_aerial_dashboard.SetEngineFailed(3, num_ae > 3 && simbuf_ae[3].simbuf_ae_failed);
760 
761  //airspeed
762  float angle = 0.0;
763  float ground_speed_kt = simbuf.simbuf_node0_velo.length() * 1.9438; // 1.943 = m/s in knots/s
764 
765  //tropospheric model valid up to 11.000m (33.000ft)
766  float altitude = nodes[0].AbsPosition.y;
767  //float sea_level_temperature=273.15+15.0; //in Kelvin
768  float sea_level_pressure = 101325; //in Pa
769  //float airtemperature=sea_level_temperature-altitude*0.0065; //in Kelvin
770  float airpressure = sea_level_pressure * pow(1.0 - 0.0065 * altitude / 288.15, 5.24947); //in Pa
771  float airdensity = airpressure * 0.0000120896;//1.225 at sea level
772 
773  float kt = ground_speed_kt * sqrt(airdensity / 1.225); //KIAS
774  if (kt > 23.0)
775  {
776  if (kt < 50.0)
777  angle = ((kt - 23.0) / 1.111);
778  else if (kt < 100.0)
779  angle = (24.0 + (kt - 50.0) / 0.8621);
780  else if (kt < 300.0)
781  angle = (82.0 + (kt - 100.0) / 0.8065);
782  else
783  angle = 329.0;
784  }
785  m_aerial_dashboard.airspeedtexture->setTextureRotate(Degree(-angle));
786 
787  // AOA
788  angle = simbuf.simbuf_wing4_aoa;
789  if (kt < 10.0)
790  angle = 0;
791  float absangle = angle;
792  if (absangle < 0)
793  absangle = -absangle;
794 
795  const int actor_id = gfx_actor->GetActorId();
796  SOUND_MODULATE(actor_id, SS_MOD_AOA, absangle);
797  if (absangle > 18.0) // TODO: magicccc
798  SOUND_START(actor_id, SS_TRIG_AOA);
799  else
800  SOUND_STOP(actor_id, SS_TRIG_AOA);
801 
802  if (angle > 25.0)
803  angle = 25.0;
804  if (angle < -25.0)
805  angle = -25.0;
806  m_aerial_dashboard.aoatexture->setTextureRotate(Degree(-angle * 4.7 + 90.0));
807 
808  // altimeter
809  angle = nodes[0].AbsPosition.y * 1.1811;
810  m_aerial_dashboard.altimetertexture->setTextureRotate(Degree(-angle));
811  char altc[10];
812  sprintf(altc, "%03u", (int)(nodes[0].AbsPosition.y / 30.48));
813  m_aerial_dashboard.alt_value_textarea->setCaption(altc);
814 
815  //adi
816  //roll
817  Vector3 rollv = nodes[simbuf.simbuf_camera0_pos_node].AbsPosition - nodes[simbuf.simbuf_camera0_roll_node].AbsPosition;
818  rollv.normalise();
819  float rollangle = asin(rollv.dotProduct(Vector3::UNIT_Y));
820 
821  //pitch
822  Vector3 dirv = simbuf.simbuf_direction;
823  float pitchangle = asin(dirv.dotProduct(Vector3::UNIT_Y));
824  Vector3 upv = dirv.crossProduct(-rollv);
825  if (upv.y < 0)
826  rollangle = 3.14159 - rollangle;
827  m_aerial_dashboard.adibugstexture->setTextureRotate(Radian(-rollangle));
828  m_aerial_dashboard.aditapetexture->setTextureVScroll(-pitchangle * 0.25);
829  m_aerial_dashboard.aditapetexture->setTextureRotate(Radian(-rollangle));
830 
831  //hsi
832  float dirangle = atan2(dirv.dotProduct(Vector3::UNIT_X), dirv.dotProduct(-Vector3::UNIT_Z));
833  m_aerial_dashboard.hsirosetexture->setTextureRotate(Radian(dirangle));
834 
835  //autopilot
836  m_aerial_dashboard.hsibugtexture->setTextureRotate(Radian(dirangle) - Degree(simbuf.simbuf_ap_heading_value));
837 
838  float vdev = 0;
839  float hdev = 0;
840  if (simbuf.simbuf_ap_ils_available)
841  {
842  vdev = simbuf.simbuf_ap_ils_vdev;
843  hdev = simbuf.simbuf_ap_ils_hdev;
844  }
845  if (hdev > 15)
846  hdev = 15;
847  if (hdev < -15)
848  hdev = -15;
849  m_aerial_dashboard.hsivtexture->setTextureUScroll(-hdev * 0.02);
850  if (vdev > 15)
851  vdev = 15;
852  if (vdev < -15)
853  vdev = -15;
854  m_aerial_dashboard.hsihtexture->setTextureVScroll(-vdev * 0.02);
855 
856  //vvi
857  float vvi = simbuf.simbuf_node0_velo.y * 196.85;
858  if (vvi < 1000.0 && vvi > -1000.0)
859  angle = vvi * 0.047;
860  if (vvi > 1000.0 && vvi < 6000.0)
861  angle = 47.0 + (vvi - 1000.0) * 0.01175;
862  if (vvi > 6000.0)
863  angle = 105.75;
864  if (vvi < -1000.0 && vvi > -6000.0)
865  angle = -47.0 + (vvi + 1000.0) * 0.01175;
866  if (vvi < -6000.0)
867  angle = -105.75;
868  m_aerial_dashboard.vvitexture->setTextureRotate(Degree(-angle + 90.0));
869 
870  const bool is_prop = simbuf_ae[0].simbuf_ae_type == AeroEngineType::AE_XPROP;
871 
872  //rpm
873  m_aerial_dashboard.SetEngineRpm(0, simbuf_ae[0].simbuf_ae_rpmpc);
874  m_aerial_dashboard.SetEngineRpm(1, (num_ae > 1) ? simbuf_ae[1].simbuf_ae_rpmpc : 0.f);
875  m_aerial_dashboard.SetEngineRpm(2, (num_ae > 2) ? simbuf_ae[2].simbuf_ae_rpmpc : 0.f);
876  m_aerial_dashboard.SetEngineRpm(3, (num_ae > 3) ? simbuf_ae[3].simbuf_ae_rpmpc : 0.f);
877 
878  //turboprops - pitch
879  m_aerial_dashboard.SetEnginePitch(0, (is_prop) ? simbuf_ae[0].simbuf_tp_aepitch : 0.f);
880  m_aerial_dashboard.SetEnginePitch(1, (num_ae > 1 && is_prop) ? simbuf_ae[1].simbuf_tp_aepitch : 0.f);
881  m_aerial_dashboard.SetEnginePitch(2, (num_ae > 2 && is_prop) ? simbuf_ae[2].simbuf_tp_aepitch : 0.f);
882  m_aerial_dashboard.SetEnginePitch(3, (num_ae > 3 && is_prop) ? simbuf_ae[3].simbuf_tp_aepitch : 0.f);
883 
884  //turboprops - torque
885  m_aerial_dashboard.SetEngineTorque(0, (is_prop) ? simbuf_ae[0].simbuf_tp_aetorque : 0.f);
886  m_aerial_dashboard.SetEngineTorque(1, (num_ae > 1 && is_prop) ? simbuf_ae[1].simbuf_tp_aetorque : 0.f);
887  m_aerial_dashboard.SetEngineTorque(2, (num_ae > 2 && is_prop) ? simbuf_ae[2].simbuf_tp_aetorque : 0.f);
888  m_aerial_dashboard.SetEngineTorque(3, (num_ae > 3 && is_prop) ? simbuf_ae[3].simbuf_tp_aetorque : 0.f);
889 
890  //starters
891  m_aerial_dashboard.SetIgnition(0, true, simbuf_ae[0].simbuf_ae_ignition);
892  m_aerial_dashboard.SetIgnition(1, num_ae > 1, num_ae > 1 && simbuf_ae[1].simbuf_ae_ignition);
893  m_aerial_dashboard.SetIgnition(2, num_ae > 2, num_ae > 2 && simbuf_ae[2].simbuf_ae_ignition);
894  m_aerial_dashboard.SetIgnition(3, num_ae > 3, num_ae > 3 && simbuf_ae[3].simbuf_ae_ignition);
895 
896  //autopilot - heading
897  m_aerial_dashboard.hdg.SetActive(simbuf.simbuf_ap_heading_mode == Autopilot::HEADING_FIXED);
898  m_aerial_dashboard.wlv.SetActive(simbuf.simbuf_ap_heading_mode == Autopilot::HEADING_WLV);
899  m_aerial_dashboard.nav.SetActive(simbuf.simbuf_ap_heading_mode == Autopilot::HEADING_NAV);
900 
901  //autopilot - altitude
902  m_aerial_dashboard.alt.SetActive(simbuf.simbuf_ap_alt_mode == Autopilot::ALT_FIXED);
903  m_aerial_dashboard.vs.SetActive(simbuf.simbuf_ap_alt_mode == Autopilot::ALT_VS);
904 
905  //autopilot - other buttons
906  m_aerial_dashboard.ias.SetActive(simbuf.simbuf_ap_ias_mode);
907  m_aerial_dashboard.gpws.SetActive(simbuf.simbuf_ap_gpws_mode);
908  m_aerial_dashboard.brks.SetActive(simbuf.simbuf_parking_brake);
909 
910  //autopilot - trims
911  m_aerial_dashboard.hdg_trim.DisplayFormat("%.3u", simbuf.simbuf_ap_heading_value);
912  m_aerial_dashboard.alt_trim.DisplayFormat("%i00", simbuf.simbuf_ap_alt_value / 100);
913  m_aerial_dashboard.ias_trim.DisplayFormat("%.3u", simbuf.simbuf_ap_ias_value);
914  if (simbuf.simbuf_ap_vs_value == 0)
915  m_aerial_dashboard.vs_trim.display->setCaption("000");
916  else if (simbuf.simbuf_ap_vs_value < 0)
917  m_aerial_dashboard.vs_trim.DisplayFormat("%i00", simbuf.simbuf_ap_vs_value / 100);
918  else
919  m_aerial_dashboard.vs_trim.DisplayFormat("+%i00", simbuf.simbuf_ap_vs_value / 100);
920 }
921 
922 void OverlayWrapper::UpdateMarineHUD(ActorPtr vehicle)
923 {
924  // throttles
925  bthro1->setTop(thrtop + thrheight * (0.5 - vehicle->ar_screwprops[0]->getThrottle() / 2.0) - 1.0);
926  if (vehicle->ar_num_screwprops > 1)
927  {
928  bthro2->setTop(thrtop + thrheight * (0.5 - vehicle->ar_screwprops[1]->getThrottle() / 2.0) - 1.0);
929  }
930 
931  // depth
932  char tmp[50] = "";
933  float height = vehicle->getHeightAboveGround();
934  if (height > 0.1 && height < 99.9)
935  {
936  sprintf(tmp, "%2.1f", height);
937  boat_depth_value_taoe->setCaption(tmp);
938  }
939  else
940  {
941  boat_depth_value_taoe->setCaption("--.-");
942  }
943 
944  // water speed
945  Vector3 cam_dir = vehicle->getDirection();
946  Vector3 velocity = vehicle->ar_nodes[vehicle->ar_main_camera_node_pos].Velocity;
947  float kt = cam_dir.dotProduct(velocity) * 1.9438;
948  float angle = kt * 4.2;
949  boatspeedtexture->setTextureRotate(Degree(-angle));
950  boatsteertexture->setTextureRotate(Degree(vehicle->ar_screwprops[0]->getRudder() * 170));
951 }
952 
953 void OverlayWrapper::ShowRacingOverlay()
954 {
955  m_racing_overlay->show();
956  BITMASK_SET_1(m_visible_overlays, VisibleOverlays::RACING);
957 }
958 
959 void OverlayWrapper::HideRacingOverlay()
960 {
961  m_racing_overlay->hide();
962  BITMASK_SET_0(m_visible_overlays, VisibleOverlays::RACING);
963 }
964 
965 void OverlayWrapper::UpdateRacingGui(RoR::GfxScene* gs)
966 {
967  float time = gs->GetSimDataBuffer().simbuf_race_time;
968  UTFString txt = StringUtil::format("%.2i'%.2i.%.2i", (int)(time) / 60, (int)(time) % 60, (int)(time * 100.0) % 100);
969  this->laptime->setCaption(txt);
970  if (gs->GetSimDataBuffer().simbuf_race_best_time > 0.0f)
971  {
973  txt = StringUtil::format("%.2i'%.2i.%.2i", (int)(time) / 60, (int)(time) % 60, (int)(time * 100.0) % 100);
974  this->bestlaptime->setCaption(txt);
975  this->bestlaptime->show();
976  }
977  else
978  {
979  this->bestlaptime->hide();
980  }
981 
982  float time_diff = gs->GetSimDataBuffer().simbuf_race_time_diff;
983  Ogre::ColourValue colour = Ogre::ColourValue::White;
984  if (time_diff > 0.0f)
985  {
986  colour = ColourValue(0.8, 0.0, 0.0);
987  }
988  else if (time_diff < 0.0f)
989  {
990  colour = ColourValue(0.0, 0.8, 0.0);
991  }
992  this->laptime->setColourTop(colour);
993  this->laptime->setColourBottom(colour);
994 }
995 
996 void AeroDashOverlay::SetThrottle(int engine, bool visible, float value)
997 {
998  if (visible)
999  {
1000  engines[engine].thr_element->show();
1001  engines[engine].thr_element->setTop(
1002  thrust_track_top + thrust_track_height * (1.0 - value) - 1.0);
1003  }
1004  else
1005  {
1006  engines[engine].thr_element->hide();
1007  }
1008 }
1009 
1010 void AeroDashOverlay::SetEngineFailed(int engine, bool value)
1011 {
1012  engines[engine].engfire_element->setMaterialName(
1013  value ? "tracks/engfire-on" : "tracks/engfire-off");
1014 }
1015 
1016 void AeroDashOverlay::SetEngineRpm(int engine, float pcent)
1017 {
1018  float angle;
1019  if (pcent < 60.0)
1020  angle = -5.0 + pcent * 1.9167;
1021  else if (pcent < 110.0)
1022  angle = 110.0 + (pcent - 60.0) * 4.075;
1023  else
1024  angle = 314.0;
1025  engines[engine].rpm_texture->setTextureRotate(Ogre::Degree(-angle));
1026 }
1027 
1028 void AeroDashOverlay::SetEnginePitch(int engine, float value)
1029 {
1030  engines[engine].pitch_texture->setTextureRotate(Degree(-value * 2.0));
1031 }
1032 
1033 void AeroDashOverlay::SetEngineTorque(int engine, float pcent)
1034 {
1035  float angle;
1036  if (pcent < 60.0)
1037  angle = -5.0 + pcent * 1.9167;
1038  else if (pcent < 110.0)
1039  angle = 110.0 + (pcent - 60.0) * 4.075;
1040  else
1041  angle = 314.0;
1042  engines[engine].torque_texture->setTextureRotate(Degree(-angle));
1043 }
1044 
1045 void AeroDashOverlay::SetIgnition(int engine, bool visible, bool ignited)
1046 {
1047  if (visible)
1048  {
1049  engines[engine].engstart_element->show();
1050  engines[engine].engstart_element->setMaterialName(
1051  ignited ? "tracks/engstart-on" : "tracks/engstart-off");
1052  }
1053  else
1054  {
1055  engines[engine].engstart_element->hide();
1056  }
1057 }
1058 
1059 void AeroSwitchOverlay::SetActive(bool value)
1060 {
1061  element->setMaterial(value ? on_material : off_material);
1062 }
1063 
1064 void AeroSwitchOverlay::Setup(std::string const & elem_name, std::string const & mat_on, std::string const & mat_off)
1065 {
1066  element = Ogre::OverlayManager::getSingleton().getOverlayElement(elem_name);
1067  on_material = Ogre::MaterialManager::getSingleton().getByName(mat_on);
1068  off_material = Ogre::MaterialManager::getSingleton().getByName(mat_off);
1069 }
1070 
1071 void AeroTrimOverlay::Setup(std::string const & up, std::string const & dn, std::string const & disp)
1072 {
1073  display = Ogre::OverlayManager::getSingleton().getOverlayElement(disp);
1074  up_button = Ogre::OverlayManager::getSingleton().getOverlayElement(up);
1075  dn_button = Ogre::OverlayManager::getSingleton().getOverlayElement(dn);
1076 }
1077 
1078 void AeroTrimOverlay::DisplayFormat(const char* fmt, ...)
1079 {
1080  char buffer[500] = {};
1081 
1082  va_list args;
1083  va_start(args, fmt);
1084  vsprintf(buffer, fmt, args);
1085  va_end(args);
1086 
1087  display->setCaption(buffer);
1088 }
GameContext.h
Game state manager and message-queue provider.
set
set(SOURCE_FILES main.cpp Application.{h, cpp} ForwardDeclarations.h AppContext.{h, cpp} GameContext.{h, cpp} audio/MumbleIntegration.{h, cpp} audio/Sound.{h, cpp} audio/SoundManager.{h, cpp} audio/SoundScriptManager.{h, cpp} gameplay/AutoPilot.{h, cpp} gameplay/Character.{h, cpp} gameplay/CharacterFactory.{h, cpp} gameplay/ChatSystem.{h, cpp} gameplay/CruiseControl.cpp gameplay/EngineSim.{h, cpp} gameplay/Landusemap.{h, cpp} gameplay/RaceSystem.{h, cpp} gameplay/RepairMode.{h, cpp} gameplay/Replay.{h, cpp} gameplay/SceneMouse.{h, cpp} gameplay/ScriptEvents.h gameplay/TorqueCurve.{h, cpp} gameplay/TyrePressure.{h, cpp} gameplay/VehicleAI.{h, cpp} gfx/AdvancedScreen.h gfx/ColoredTextAreaOverlayElement.{h, cpp} gfx/ColoredTextAreaOverlayElementFactory.h gfx/DustPool.{h, cpp} gfx/EnvironmentMap.{h, cpp} gfx/GfxActor.{h, cpp} gfx/GfxData.{h, cpp} gfx/GfxScene.{h, cpp} gfx/HydraxWater.{h, cpp} gfx/IWater.h gfx/MovableText.{h, cpp} gfx/Renderdash.{h, cpp} gfx/ShadowManager.{h, cpp} gfx/SimBuffers.{h, cpp} gfx/Skidmark.{h, cpp} gfx/SkyManager.{h, cpp} gfx/SkyXManager.{h, cpp} gfx/SurveyMapTextureCreator.{h, cpp} gfx/Water.{h, cpp} gfx/camera/CameraManager.{h, cpp} gfx/camera/PerVehicleCameraContext.h gfx/hydrax/CfgFileManager.{h, cpp} gfx/hydrax/DecalsManager.{h, cpp} gfx/hydrax/Enums.{h, cpp} gfx/hydrax/FFT.{h, cpp} gfx/hydrax/GodRaysManager.{h, cpp} gfx/hydrax/GPUNormalMapManager.{h, cpp} gfx/hydrax/Help.{h, cpp} gfx/hydrax/Hydrax.{h, cpp} gfx/hydrax/Image.{h, cpp} gfx/hydrax/MaterialManager.{h, cpp} gfx/hydrax/Mesh.{h, cpp} gfx/hydrax/Module.{h, cpp} gfx/hydrax/Noise.{h, cpp} gfx/hydrax/Perlin.{h, cpp} gfx/hydrax/Prerequisites.{h, cpp} gfx/hydrax/PressurePoint.{h, cpp} gfx/hydrax/ProjectedGrid.{h, cpp} gfx/hydrax/RadialGrid.{h, cpp} gfx/hydrax/Real.{h, cpp} gfx/hydrax/RttManager.{h, cpp} gfx/hydrax/SimpleGrid.{h, cpp} gfx/hydrax/TextureManager.{h, cpp} gfx/hydrax/Wave.{h, cpp} gfx/particle/ExtinguishableFireAffector.{h, cpp} gfx/particle/ExtinguishableFireAffectorFactory.h gfx/particle/FireExtinguisherAffector.{h, cpp} gfx/particle/FireExtinguisherAffectorFactory.h gfx/particle/OgreParticleCustomParam.h gfx/particle/OgreShaderParticleRenderer.{h, cpp} gfx/skyx/AtmosphereManager.{h, cpp} gfx/skyx/BasicController.{h, cpp} gfx/skyx/CloudsManager.{h, cpp} gfx/skyx/ColorGradient.{h, cpp} gfx/skyx/Controller.h gfx/skyx/GPUManager.{h, cpp} gfx/skyx/MeshManager.{h, cpp} gfx/skyx/MoonManager.{h, cpp} gfx/skyx/Prerequisites.{h, cpp} gfx/skyx/SCfgFileManager.{h, cpp} gfx/skyx/SkyX.{h, cpp} gfx/skyx/VCloudsManager.{h, cpp} gfx/skyx/VClouds/DataManager.{h, cpp} gfx/skyx/VClouds/Ellipsoid.{h, cpp} gfx/skyx/VClouds/FastFakeRandom.{h, cpp} gfx/skyx/VClouds/GeometryBlock.{h, cpp} gfx/skyx/VClouds/GeometryManager.{h, cpp} gfx/skyx/VClouds/Lightning.{h, cpp} gfx/skyx/VClouds/LightningManager.{h, cpp} gfx/skyx/VClouds/VClouds.{h, cpp} gui/DashBoardManager.{h, cpp} gui/GUIManager.{h, cpp} gui/GUIUtils.{h, cpp} gui/OverlayWrapper.{h, cpp} gui/RTTLayer.{h, cpp} gui/imgui/imgui.{h, cpp} gui/imgui/imgui_demo.cpp gui/imgui/imgui_draw.cpp gui/imgui/imgui_widgets.cpp gui/imgui/OgreImGuiOverlay.{h, cpp} gui/imgui/OgreImGui.{h, cpp} gui/imgui/imconfig.h gui/imgui/imgui_internal.h gui/imgui/imstb_rectpack.h gui/imgui/imstb_textedit.h gui/imgui/imstb_truetype.h gui/panels/GUI_AngelScriptExamples.{h, cpp} gui/panels/GUI_CollisionsDebug.{h, cpp} gui/panels/GUI_ConsoleView.{h, cpp} gui/panels/GUI_ConsoleWindow.{h, cpp} gui/panels/GUI_DirectionArrow.{h, cpp} gui/panels/GUI_LoadingWindow.{h, cpp} gui/panels/GUI_FlexbodyDebug.{h, cpp} gui/panels/GUI_FrictionSettings.{h, cpp} gui/panels/GUI_TopMenubar.{h, cpp} gui/panels/GUI_TextureToolWindow.{h, cpp} gui/panels/GUI_RepositorySelector.{h, cpp} gui/panels/GUI_GameControls.{h, cpp} gui/panels/GUI_GameAbout.{h, cpp} gui/panels/GUI_GameChatBox.{h, cpp} gui/panels/GUI_GameMainMenu.{h, cpp} gui/panels/GUI_GameSettings.{h, cpp} gui/panels/GUI_MainSelector.{h, cpp} gui/panels/GUI_MessageBox.{h, cpp} gui/panels/GUI_MultiplayerSelector.{h, cpp} gui/panels/GUI_MultiplayerClientList.{h, cpp} gui/panels/GUI_NodeBeamUtils.{h, cpp} gui/panels/GUI_VehicleInfoTPanel.{h, cpp} gui/panels/GUI_ScriptMonitor.{h, cpp} gui/panels/GUI_SimPerfStats.{h, cpp} gui/panels/GUI_SurveyMap.{h, cpp} network/CurlHelpers.{h, cpp} network/DiscordRpc.{h, cpp} network/Network.{h, cpp} network/OutGauge.{h, cpp} network/RoRnet.h physics/Actor.{h, cpp} physics/ApproxMath.h physics/ActorForcesEuler.cpp physics/ActorManager.{h, cpp} physics/ActorSlideNode.cpp physics/ActorSpawner.{h, cpp} physics/ActorSpawnerFlow.cpp physics/CmdKeyInertia.{h, cpp} physics/Differentials.{h, cpp} physics/Savegame.cpp physics/SimConstants.h physics/SimData.{h, cpp} physics/SlideNode.{h, cpp} physics/air/AeroEngine.h physics/air/AirBrake.{h, cpp} physics/air/Airfoil.{h, cpp} physics/air/TurboJet.{h, cpp} physics/air/TurboProp.{h, cpp} physics/collision/CartesianToTriangleTransform.h physics/collision/Collisions.{h, cpp} physics/collision/DynamicCollisions.{h, cpp} physics/collision/PointColDetector.{h, cpp} physics/collision/Triangle.h physics/flex/Flexable.h physics/flex/FlexAirfoil.{h, cpp} physics/flex/FlexBody.{h, cpp} physics/flex/FlexFactory.{h, cpp} physics/flex/FlexMesh.{h, cpp} physics/flex/FlexMeshWheel.{h, cpp} physics/flex/FlexObj.{h, cpp} physics/flex/Locator_t.h physics/water/Buoyance.{h, cpp} physics/water/ScrewProp.{h, cpp} resources/CacheSystem.{h, cpp} resources/ContentManager.{h, cpp} resources/addonpart_fileformat/AddonPartFileFormat.{h, cpp} resources/otc_fileformat/OTCFileFormat.{h, cpp} resources/odef_fileformat/ODefFileFormat.{h, cpp} resources/rig_def_fileformat/RigDef_File.{h, cpp} resources/rig_def_fileformat/RigDef_Node.{h, cpp} resources/rig_def_fileformat/RigDef_Parser.{h, cpp} resources/rig_def_fileformat/RigDef_Prerequisites.h resources/rig_def_fileformat/RigDef_Regexes.h resources/rig_def_fileformat/RigDef_SequentialImporter.{h, cpp} resources/rig_def_fileformat/RigDef_Serializer.{h, cpp} resources/rig_def_fileformat/RigDef_Validator.{h, cpp} resources/skin_fileformat/SkinFileFormat.{h, cpp} resources/terrn2_fileformat/Terrn2FileFormat.{h, cpp} resources/tobj_fileformat/TObjFileFormat.{h, cpp} resources/tuneup_fileformat/TuneupFileFormat.{h, cpp} system/AppCommandLine.cpp system/AppConfig.cpp system/Console.{h, cpp} system/ConsoleCmd.{h, cpp} system/CVar.{h, cpp} terrain/OgreTerrainPSSMMaterialGenerator.{h, cpp} terrain/ProceduralManager.{h, cpp} terrain/ProceduralRoad.{h, cpp} terrain/SurveyMapEntity.h terrain/TerrainEditor.{h, cpp} terrain/TerrainGeometryManager.{h, cpp} terrain/Terrain.{h, cpp} terrain/TerrainObjectManager.{h, cpp} threadpool/ThreadPool.h utils/ConfigFile.{h, cpp} utils/ErrorUtils.{h, cpp} utils/ForceFeedback.{h, cpp} utils/GenericFileFormat.{h, cpp} utils/ImprovedConfigFile.h utils/InputEngine.{h, cpp} utils/InterThreadStoreVector.h utils/Language.{h, cpp} utils/MeshObject.{h, cpp} utils/PlatformUtils.{h, cpp} utils/SHA1.{h, cpp} utils/Utils.{h, cpp} utils/WriteTextToTexture.{h, cpp} utils/memory/RefCountingObject.h utils/memory/RefCountingObjectPtr.h) if(ROR_USE_ANGELSCRIPT) list(APPEND SOURCE_FILES scripting/GameScript.
Definition: CMakeLists.txt:5
colon
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible colon
Definition: ReadMe.txt:20
RoR::Actor::ar_main_camera_node_pos
NodeNum_t ar_main_camera_node_pos
Sim attr; ar_camera_node_pos[0] >= 0 ? ar_camera_node_pos[0] : 0.
Definition: Actor.h:388
RoR::node_t::Velocity
Ogre::Vector3 Velocity
Definition: SimData.h:295
y
float y
Definition: (ValueTypes) quaternion.h:6
Keyword
Keyword
Definition: Bench_TruckParser_IdentifyKeyword.cpp:6
RoR::MACHINE
@ MACHINE
its a machine
Definition: SimData.h:96
OverlayWrapper.h
RoR::NodeSB
Definition: SimBuffers.h:67
RoR::GfxScene::GetSimDataBuffer
GameContextSB & GetSimDataBuffer()
Definition: GfxScene.h:61
RoR::GameContextSB::simbuf_race_time
float simbuf_race_time
Definition: SimBuffers.h:209
RoR::ActorSB::simbuf_ap_ias_value
int simbuf_ap_ias_value
Definition: SimBuffers.h:183
DashBoardManager.h
RoR::GfxActor::GetSimNodeBuffer
NodeSB * GetSimNodeBuffer()
Definition: GfxActor.h:120
file
This is a raw Ogre binding for Imgui No project cmake file
Definition: README-OgreImGui.txt:3
RoR::AppContext::GetRenderWindow
Ogre::RenderWindow * GetRenderWindow()
Definition: AppContext.h:67
RoR::InputEngine::getMouseState
OIS::MouseState getMouseState()
Definition: InputEngine.cpp:603
RoR::Actor::getHeightAboveGround
float getHeightAboveGround(bool skip_virtual_nodes=true)
Definition: Actor.cpp:1537
RoR::App::GetAppContext
AppContext * GetAppContext()
Definition: Application.cpp:266
format
Truck file format(technical spec)
RoR::ActorSB::simbuf_ap_ias_mode
bool simbuf_ap_ias_mode
Definition: SimBuffers.h:182
AutoPilot.h
RoR::ActorSB::simbuf_ap_alt_mode
int simbuf_ap_alt_mode
Definition: SimBuffers.h:180
benchmarks
Rigs of Rods Micro benchmarks
Definition: README.txt:3
Example
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive Example
Definition: ReadMe.txt:58
RoR::ActorSB::simbuf_node0_velo
Ogre::Vector3 simbuf_node0_velo
Definition: SimBuffers.h:124
RoR::OverlayWrapper::LoadedOverlay::orgScaleX
float orgScaleX
Definition: OverlayWrapper.h:120
AppContext.h
System integration layer; inspired by OgreBites::ApplicationContext.
RoR::ActorSB::simbuf_num_gears
int simbuf_num_gears
Gearbox.
Definition: SimBuffers.h:156
RoR::ActorSB::simbuf_aeroengines
std::vector< AeroEngineSB > simbuf_aeroengines
Definition: SimBuffers.h:138
RoR::DashBoardManager::WasDashboardLoaded
bool WasDashboardLoaded() const
Definition: DashBoardManager.h:236
RoR::ActorSB::simbuf_speedo_use_engine_max_rpm
bool simbuf_speedo_use_engine_max_rpm
Definition: SimBuffers.h:192
RoR::SS_MOD_AOA
@ SS_MOD_AOA
Definition: SoundScriptManager.h:152
RoR::Actor::GetGfxActor
GfxActor * GetGfxActor()
Definition: Actor.h:269
g_is_scaled
bool g_is_scaled
Definition: OverlayWrapper.cpp:55
Utils.h
Language.h
RoR::OverlayWrapper::LoadedOverlay
Definition: OverlayWrapper.h:118
U
#define U(str)
Definition: Language.h:36
RoR::ActorSB::simbuf_direction
Ogre::Vector3 simbuf_direction
Output of Actor::getDirection()
Definition: SimBuffers.h:126
RoR::Actor::ar_dashboard
DashBoardManager * ar_dashboard
Definition: Actor.h:433
RefCountingObjectPtr< Actor >
example
And voilĂ  ! You can then use imgui just like you want You ll also need to transfer input events from your OIS Input listener to the Imgui manager For example
Definition: README-OgreImGui.txt:75
ActorManager.h
Actor.h
w
float w
Definition: (ValueTypes) quaternion.h:4
RoR::GfxActor::GetHelpMat
Ogre::MaterialPtr GetHelpMat()
Definition: GfxActor.h:142
RoR::AeroEngine::flipStart
virtual void flipStart()=0
RoR::GfxScene
Provides a 3D graphical representation of the simulation Idea: simulation runs at it's own constant r...
Definition: GfxScene.h:45
RoR::ActorSB::simbuf_parking_brake
bool simbuf_parking_brake
Definition: SimBuffers.h:166
RoR::GameContextSB::simbuf_race_best_time
float simbuf_race_best_time
Definition: SimBuffers.h:210
RoR::Autopilot::toggleHeading
int toggleHeading(int mode)
Definition: AutoPilot.cpp:256
tabulator
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible tabulator
Definition: ReadMe.txt:20
forms
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") bad trailing chars are silently ignored no space at the end Items delimited On each side of there is max item Empty invalid string parses as node num items Acceptable item forms
Definition: ReadMe.txt:295
BITMASK_SET_0
#define BITMASK_SET_0(VAR, FLAGS)
Definition: BitFlags.h:16
TOSTRING
#define TOSTRING(x)
Definition: Application.h:56
RoR::Actor::ar_aeroengines
AeroEngine * ar_aeroengines[MAX_AEROENGINES]
Definition: Actor.h:329
ScrewProp.h
RoR::Autopilot::toggleAlt
int toggleAlt(int mode)
Definition: AutoPilot.cpp:265
RoR::Actor::ar_screwprops
Screwprop * ar_screwprops[MAX_SCREWPROPS]
Definition: Actor.h:331
RoR::OverlayWrapper::LoadedOverlay::o
Ogre::Overlay * o
Definition: OverlayWrapper.h:122
RoR::ActorSB::simbuf_wing4_aoa
float simbuf_wing4_aoa
Definition: SimBuffers.h:174
RoR::ActorSB::simbuf_ap_heading_mode
int simbuf_ap_heading_mode
Definition: SimBuffers.h:178
RoR::Actor::ar_num_aeroengines
int ar_num_aeroengines
Definition: Actor.h:330
RoR::OverlayWrapper::LoadedOverlay::orgScaleY
float orgScaleY
Definition: OverlayWrapper.h:121
Syntax
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used Syntax
Definition: ReadMe.txt:79
RoR::formatBytes
Ogre::UTFString formatBytes(double bytes)
Definition: Utils.cpp:64
RoR::Autopilot::adjVS
int adjVS(int d)
Definition: AutoPilot.cpp:302
keyword
static int keyword
Definition: Bench_TruckParser_IdentifyKeyword.cpp:1448
ErrorUtils.h
RoR::GameContextSB::simbuf_race_time_diff
float simbuf_race_time_diff
Definition: SimBuffers.h:211
BITMASK_SET_1
#define BITMASK_SET_1(VAR, FLAGS)
Definition: BitFlags.h:17
RoR::Autopilot::adjHDG
int adjHDG(int d)
Definition: AutoPilot.cpp:286
comment
or anywhere else will not be considered a comment
Definition: ReadMe.txt:17
forset1
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") bad trailing chars are silently ignored no space at the end Items delimited On each side of there is max item Empty invalid string parses as node num items Acceptable item the node is the others When a node range has more than they re ignored forset1
Definition: ReadMe.txt:304
RoR::ActorSB::simbuf_ap_gpws_mode
bool simbuf_ap_gpws_mode
Definition: SimBuffers.h:184
parsed
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") bad trailing chars are silently ignored no space at the end Items delimited On each side of there is max item Empty invalid string parses as node num items Acceptable item the node is parsed
Definition: ReadMe.txt:302
GfxScene.h
Character.h
RoR::ActorSB::simbuf_ap_heading_value
int simbuf_ap_heading_value
Definition: SimBuffers.h:179
SOUND_START
#define SOUND_START(_ACTOR_, _TRIG_)
Definition: SoundScriptManager.h:35
RoR::ActorSB::simbuf_wheel_speed
float simbuf_wheel_speed
Definition: SimBuffers.h:127
RoR::ActorSB::simbuf_ap_ils_hdev
float simbuf_ap_ils_hdev
Definition: SimBuffers.h:187
SoundScriptManager.h
RoR::Autopilot::adjALT
int adjALT(int d)
Definition: AutoPilot.cpp:296
RoR::App::GetGameContext
GameContext * GetGameContext()
Definition: Application.cpp:280
each
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") bad trailing chars are silently ignored no space at the end Items delimited On each side of each
Definition: ReadMe.txt:293
files
This is a raw Ogre binding for Imgui No project cmake no just four source files
Definition: README-OgreImGui.txt:3
RoR::Autopilot::toggleIAS
bool toggleIAS()
Definition: AutoPilot.cpp:274
RoR::GfxActor::GetActorId
int GetActorId() const
Definition: GfxActor.cpp:1958
RoR::AIRPLANE
@ AIRPLANE
its an airplane
Definition: SimData.h:94
RoR::Actor::ar_autopilot
Autopilot * ar_autopilot
Definition: Actor.h:382
GetTexUnit
Ogre::TextureUnitState * GetTexUnit(Ogre::String material_name)
Definition: OverlayWrapper.cpp:142
RoR::Actor::ar_num_screwprops
int ar_num_screwprops
Definition: Actor.h:332
RoR::Actor::getDirection
Ogre::Vector3 getDirection()
average actor velocity, calculated using the actor positions of the last two frames
Definition: Actor.cpp:418
RoR::ActorSB::simbuf_engine_rpm
float simbuf_engine_rpm
Definition: SimBuffers.h:147
RoRVersion.h
SOUND_STOP
#define SOUND_STOP(_ACTOR_, _TRIG_)
Definition: SoundScriptManager.h:36
RoR::ActorSB::simbuf_ap_alt_value
int simbuf_ap_alt_value
Definition: SimBuffers.h:181
RoR::Screwprop::getRudder
float getRudder()
Definition: ScrewProp.cpp:106
use
The MIT free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: LICENSE-ImGui.txt:8
RoR::ActorSB::simbuf_ap_ils_vdev
float simbuf_ap_ils_vdev
Definition: SimBuffers.h:186
RoR::ActorSB::simbuf_ap_vs_value
int simbuf_ap_vs_value
Definition: SimBuffers.h:188
FlexAirfoil.h
RoR::ActorSB::simbuf_tyre_pressure
float simbuf_tyre_pressure
Definition: SimBuffers.h:160
RoR::Actor::parkingbrakeToggle
void parkingbrakeToggle()
Definition: Actor.cpp:3762
SOUND_MODULATE
#define SOUND_MODULATE(_ACTOR_, _MOD_, _VALUE_)
Definition: SoundScriptManager.h:40
RoR::ActorSB::simbuf_ap_ils_available
bool simbuf_ap_ils_available
Definition: SimBuffers.h:185
RoR::Autopilot::adjIAS
int adjIAS(int d)
Definition: AutoPilot.cpp:312
RoR::Autopilot::toggleGPWS
bool toggleGPWS()
Definition: AutoPilot.cpp:280
TurboProp.h
RoR::Actor::ar_nodes
node_t * ar_nodes
Definition: Actor.h:279
instance
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single instance
Definition: ReadMe.txt:53
RoR::ActorSB::simbuf_engine_max_rpm
float simbuf_engine_max_rpm
Definition: SimBuffers.h:157
RoR::ActorSB::simbuf_camera0_roll_node
NodeNum_t simbuf_camera0_roll_node
Definition: SimBuffers.h:131
RoR::ActorSB::simbuf_gear
int simbuf_gear
Definition: SimBuffers.h:145
RoR::Actor::ar_driveable
ActorType ar_driveable
Sim attr; marks vehicle type and features.
Definition: Actor.h:378
_L
#define _L
Definition: ErrorUtils.cpp:34
Examples
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") bad trailing chars are silently ignored no space at the end Items delimited On each side of there is max item Empty invalid string parses as node num Examples
Definition: ReadMe.txt:295
RoR::Screwprop::getThrottle
float getThrottle()
Definition: ScrewProp.cpp:98
nodes
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") bad trailing chars are silently ignored no space at the end Items delimited On each side of there is max item Empty invalid string parses as node num items Acceptable item the node is the others When a node range has more than nodes
Definition: ReadMe.txt:302
by
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") bad trailing chars are silently ignored no space at the end Items delimited by
Definition: ReadMe.txt:293
RoR::App::GetInputEngine
InputEngine * GetInputEngine()
Definition: Application.cpp:271
RoR::ActorSB::simbuf_speedo_highest_kph
float simbuf_speedo_highest_kph
Definition: SimBuffers.h:191
RoR::ActorSB
Definition: SimBuffers.h:110
RoR::AeroEngine::setThrottle
virtual void setThrottle(float val)=0
Terrain.h
demo
This is a raw Ogre binding for Imgui No project cmake no demo
Definition: README-OgreImGui.txt:3
slash
or slash(documented as '//') are comments. Placing '
AeroEngine.h
RoR::GfxActor
Definition: GfxActor.h:52
ELSE
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") ELSE
Definition: ReadMe.txt:282
RoR::ActorSB::simbuf_camera0_pos_node
NodeNum_t simbuf_camera0_pos_node
Definition: SimBuffers.h:130
Ogre
Definition: ExtinguishableFireAffector.cpp:35
GfxActor.h
Manager for all visuals belonging to a single actor.
are
dr free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to and or sell copies of the and to permit persons to whom the Software is furnished to do subject to the following WITHOUT WARRANTY OF ANY EXPRESS OR INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER WHETHER IN AN ACTION OF TORT OR ARISING OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE *Ogre *IMGUI *OIS This binding is compatible with both Ogre x and Render systems supported are
Definition: README-OgreImGui.txt:57
none
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If none
Definition: ReadMe.txt:68
RoR::ActorSB::simbuf_autoshift
int simbuf_autoshift
Definition: SimBuffers.h:146
RoR::DashBoardManager::setVisible
void setVisible(bool visibility)
Definition: DashBoardManager.cpp:214
rules
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") bad trailing chars are silently ignored no space at the end Items delimited On each side of there is max item Empty invalid string parses as node num items Acceptable item the node is the others When a node range has more than they re ignored Hyphen rules
Definition: ReadMe.txt:304
comma
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible comma
Definition: ReadMe.txt:20
items
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") bad trailing chars are silently ignored no space at the end Items delimited On each side of there is max item Empty invalid string parses as node num items
Definition: ReadMe.txt:295
RoR::ActorSB::simbuf_tyre_pressurizing
bool simbuf_tyre_pressurizing
Definition: SimBuffers.h:161
ignored
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") bad trailing chars are silently ignored no space at the end Items delimited On each side of there is max item Empty invalid string parses as node num items Acceptable item the node is the others ignored
Definition: ReadMe.txt:302
RoR::events
events
Definition: InputEngine.h:74
RoR::BOAT
@ BOAT
its a boat
Definition: SimData.h:95
separators
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible separators
Definition: ReadMe.txt:20
RoR::GameContext::GetPlayerActor
const ActorPtr & GetPlayerActor()
Definition: GameContext.h:134
RoR::GfxActor::GetSimDataBuffer
ActorSB & GetSimDataBuffer()
Definition: GfxActor.h:119
RoR
Definition: AppContext.h:36
forset
or anywhere else will not be considered a but parsed as regular data ! Each line is treated as values separated by separators Possible i e animators Multiline description Single does not affect it Directive usualy set global attributes or change behavior of the parsing Directive may appear in any block section Modularity The elements can be grouped into modules Each module must belong to one or more configurations Directives sectionconfig specify truck configurations the user can choose from Exactly one must be selected If the first defined is used lettercase matches original docs(parsing is insensitive). NAME TYPE NOTES advdrag BLOCK add_animation DIRECTIVE Special syntax airbrakes BLOCK animators BLOCK Special syntax IF(values[0]=="") bad trailing chars are silently ignored no space at the end Items delimited On each side of there is max item Empty invalid string parses as node num forset
Definition: ReadMe.txt:295
x
float x
Definition: (ValueTypes) quaternion.h:5
OIS
Definition: ForceFeedback.h:25
RoR::SS_TRIG_AOA
@ SS_TRIG_AOA
Definition: SoundScriptManager.h:97
semicolon
Truck file discontinued See also fileformatversion Syntax The format is line based Empty lines and comments are skipped Lines starting with semicolon
Definition: ReadMe.txt:8