RigsofRods
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GameContext.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 
22 #include "GameContext.h"
23 
24 #include "AppContext.h"
25 #include "Actor.h"
26 #include "AeroEngine.h"
27 #include "CacheSystem.h"
28 #include "Collisions.h"
29 #include "Console.h"
30 #include "DashBoardManager.h"
31 #include "Engine.h"
32 #include "GfxScene.h"
33 #include "GUIManager.h"
34 #include "GUI_FrictionSettings.h"
35 #include "GUI_MainSelector.h"
36 #include "GUI_TopMenubar.h"
37 #include "InputEngine.h"
38 #include "OverlayWrapper.h"
39 #include "Replay.h"
40 #include "ScrewProp.h"
41 #include "ScriptEngine.h"
42 #include "SkyManager.h"
43 #include "SkyXManager.h"
44 #include "SoundScriptManager.h"
45 #include "Terrain.h"
46 #include "Terrn2FileFormat.h"
47 #include "TuneupFileFormat.h"
48 #include "Utils.h"
49 #include "VehicleAI.h"
50 
51 using namespace RoR;
52 
54 {
55  // Constructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
56 }
57 
59 {
60  // Destructs `ActorPtr` - doesn't compile without `#include Actor.h` - not pretty if in header (even if auto-generated by C++).
61 }
62 
63 // --------------------------------
64 // Message queue
65 
67 {
68  std::lock_guard<std::mutex> lock(m_msg_mutex);
69  m_msg_queue.push(m);
70  m_msg_chain_end = &m_msg_queue.back();
71 }
72 
74 {
75  std::lock_guard<std::mutex> lock(m_msg_mutex);
76  if (m_msg_chain_end)
77  {
78 
79  m_msg_chain_end->chain.push_back(m);
81  }
82  else
83  {
84  // Regular `PushMessage()`, just without the lock.
85  m_msg_queue.push(m);
86  m_msg_chain_end = &m_msg_queue.back();
87  }
88 }
89 
91 {
92  std::lock_guard<std::mutex> lock(m_msg_mutex);
93  return !m_msg_queue.empty();
94 }
95 
97 {
98  std::lock_guard<std::mutex> lock(m_msg_mutex);
99  ROR_ASSERT(m_msg_queue.size() > 0);
100  if (m_msg_chain_end == &m_msg_queue.front())
101  {
102  m_msg_chain_end = nullptr;
103  }
104  Message m = m_msg_queue.front();
105  m_msg_queue.pop();
106  return m;
107 }
108 
109 // --------------------------------
110 // Terrain
111 
112 bool GameContext::LoadTerrain(std::string const& filename_part)
113 {
114  m_last_spawned_actor = nullptr;
115 
116  // Find terrain in modcache
117  CacheEntryPtr terrn_entry = App::GetCacheSystem()->FindEntryByFilename(LT_Terrain, /*partial=*/true, filename_part);
118  if (!terrn_entry)
119  {
120  Str<200> msg; msg << _L("Terrain not found: ") << filename_part;
121  RoR::Log(msg.ToCStr());
122  App::GetGuiManager()->ShowMessageBox(_L("Terrain loading error"), msg.ToCStr());
123  return false;
124  }
125 
126  // Init resources
127  App::GetCacheSystem()->LoadResource(terrn_entry);
128 
129  // Load the terrain def file
130  Terrn2DocumentPtr terrn2;
131  std::string const& filename = terrn_entry->fname;
132  try
133  {
134  Ogre::DataStreamPtr stream = Ogre::ResourceGroupManager::getSingleton().openResource(filename);
135  LOG(" ===== LOADING TERRAIN " + filename);
136  Terrn2Parser parser;
137  terrn2 = parser.LoadTerrn2(stream);
138  if (!terrn2)
139  {
140  return false; // Errors already logged to console
141  }
142  }
143  catch (Ogre::Exception& e)
144  {
145  App::GetGuiManager()->ShowMessageBox(_L("Terrain loading error"), e.getFullDescription().c_str());
146  return false;
147  }
148  terrn_entry->terrn2_def = terrn2;
149 
150  for (std::string const& assetpack_filename: terrn2->assetpack_files)
151  {
152  App::GetCacheSystem()->LoadAssetPack(terrn_entry, assetpack_filename);
153  }
154 
155  // CAUTION - the global instance must be set during init! Needed by:
156  // * GameScript::spawnObject()
157  // * ProceduralManager
158  // * Landusemap
159  // * SurveyMapTextureCreator
160  // * Collisions (debug visualization)
161  m_terrain = new RoR::Terrain(terrn_entry, terrn2);
162  if (!m_terrain->initialize())
163  {
164  m_terrain = nullptr; // release local reference - object will be deleted when all references are released.
165  return false; // Message box already displayed
166  }
167 
168  // Initialize envmap textures by rendering center of map
169  Ogre::Vector3 center = m_terrain->getMaxTerrainSize() / 2;
170  center.y = m_terrain->GetHeightAt(center.x, center.z) + 1.0f;
171  App::GetGfxScene()->GetEnvMap().UpdateEnvMap(center, /*gfx_actor:*/nullptr, /*full:*/true);
172 
173  // Scan groundmodels
175 
176  return true;
177 }
178 
180 {
181  if (m_terrain != nullptr)
182  {
183  // dispose(), do not `delete` - script may still hold reference to the object.
184  m_terrain->dispose();
185  // release local reference - object will be deleted when all references are released.
186  m_terrain = nullptr;
187  }
188 }
189 
190 // --------------------------------
191 // Actors (physics and netcode)
192 
194 {
196  {
201 
202  if (rq.asr_spawnbox == nullptr)
203  {
204  if (m_player_actor != nullptr)
205  {
206  float h = m_player_actor->getMaxHeight(true);
207  rq.asr_rotation = Ogre::Quaternion(Ogre::Degree(270) - Ogre::Radian(m_player_actor->getRotation()), Ogre::Vector3::UNIT_Y);
210  rq.asr_position.y += m_player_actor->getHeightAboveGroundBelow(h, true); // retain height above ground
211  }
212  else
213  {
214  Character* player_character = this->GetPlayerCharacter();
215  rq.asr_rotation = Ogre::Quaternion(Ogre::Degree(180) - player_character->getRotation(), Ogre::Vector3::UNIT_Y);
216  rq.asr_position = player_character->getPosition();
217  }
218  }
219  }
220 
221  LOG(" ===== LOADING VEHICLE: " + rq.asr_filename);
222 
223  if (rq.asr_cache_entry)
224  {
226  }
227  else
228  {
230  }
231 
233  if (def == nullptr)
234  {
235  return nullptr; // Error already reported
236  }
237 
238  if (rq.asr_skin_entry)
239  {
240  App::GetCacheSystem()->LoadResource(rq.asr_skin_entry); // Also loads associated .skin file.
241  if (!rq.asr_skin_entry->skin_def) // Make sure .skin was loaded OK.
242  {
243  rq.asr_skin_entry = nullptr; // Error already logged
244  }
245  }
246 
247  if (App::sim_tuning_enabled->getBool() && (App::mp_state->getEnum<MpState>() != MpState::CONNECTED))
248  {
249  if (rq.asr_tuneup_entry)
250  {
251  App::GetCacheSystem()->LoadResource(rq.asr_tuneup_entry); // Also loads associated .tuneup file.
252  if (!rq.asr_tuneup_entry->tuneup_def)
253  {
254  rq.asr_tuneup_entry = nullptr; // Error already logged
255  }
256  }
257  }
258  else
259  {
260  rq.asr_working_tuneup = nullptr; // Make sure no tuneup is used
261  }
262 
263 #ifdef USE_SOCKETW
265  {
266  if (App::mp_state->getEnum<MpState>() == MpState::CONNECTED)
267  {
270  rq.asr_net_color = info.colournum;
271  }
272  }
273 #endif //SOCKETW
274 
275  ActorPtr fresh_actor = m_actor_manager.CreateNewActor(rq, def);
276  bool fresh_actor_seat_player = false;
277 
278  // lock slide nodes after spawning the actor?
279  if (def->slide_nodes_connect_instantly)
280  {
281  fresh_actor->toggleSlideNodeLock(); // OK to invoke here - processing MSG_SIM_ACTOR_SPAWN_REQUESTED
282  }
283 
285  {
286  m_last_spawned_actor = fresh_actor;
287  if (fresh_actor->ar_driveable != NOT_DRIVEABLE)
288  {
289  fresh_actor_seat_player = true;
290  }
291  if (rq.asr_spawnbox == nullptr)
292  {
293  // Try to resolve collisions with other actors
294  fresh_actor->resolveCollisions(50.0f, m_player_actor == nullptr);
295  }
296  }
298  {
299  if (fresh_actor->ar_driveable != NOT_DRIVEABLE &&
300  fresh_actor->ar_num_nodes > 0 &&
302  {
303  fresh_actor_seat_player = true;
304  }
305  }
307  {
308  if (rq.asr_terrn_machine)
309  {
310  fresh_actor->ar_driveable = MACHINE;
311  }
312  }
314  {
315  fresh_actor->ar_driveable = AI;
316  fresh_actor->ar_state = ActorState::LOCAL_SIMULATED;
317 
318  if (fresh_actor->ar_engine)
319  {
321  fresh_actor->ar_engine->autoShiftSet(Engine::DRIVE);
322  }
323  }
325  {
326  fresh_actor->ar_net_source_id = rq.net_source_id;
327  fresh_actor->ar_net_stream_id = rq.net_stream_id;
328 
330  {
332  }
334  {
336  }
337  }
339  {
340  if (rq.asr_saved_state)
341  {
343  req->amr_actor = fresh_actor->ar_instance_id;
347  }
348  }
349  else
350  {
351  if (fresh_actor->ar_driveable != NOT_DRIVEABLE &&
353  rq.asr_enter)
354  {
355  fresh_actor_seat_player = true;
356  }
357  }
358 
359  if (fresh_actor_seat_player)
360  {
361  this->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, new ActorPtr(fresh_actor)));
362  // Loading all addonparts to resolve conflicts is slow and would cause huge UI lag if not forced now. Do it right after player was seated in the actor.
364  }
365 
366  return fresh_actor;
367 }
368 
370 {
372 
373  if (!actor)
374  {
375  return;
376  }
377 
379  {
380  actor->SoftReset();
381  }
383  {
384  actor->SyncReset(/*reset_position:*/false);
385  }
387  {
388  actor->SyncReset(/*reset_position:*/true);
389  }
391  {
393  }
396  {
398  actor->ar_sleep_counter = 0.0f;
399  }
401  {
402  CacheEntryPtr entry = App::GetCacheSystem()->FindEntryByFilename(LT_AllBeam, /*partial=*/false, actor->ar_filename);
403  if (!entry)
404  {
405  Str<500> msg; msg <<"Cannot reload vehicle; file '" << actor->ar_filename << "' not found in ModCache.";
407  return;
408  }
409 
410  // Create spawn request while actor still exists
412  srq->asr_position = Ogre::Vector3(actor->getPosition().x, actor->getMinHeight(), actor->getPosition().z);
413  srq->asr_rotation = Ogre::Quaternion(Ogre::Degree(270) - Ogre::Radian(actor->getRotation()), Ogre::Vector3::UNIT_Y);
414  srq->asr_config = actor->getSectionConfig();
415  srq->asr_skin_entry = actor->getUsedSkinEntry();
416  srq->asr_working_tuneup = actor->getWorkingTuneupDef();
417  srq->asr_cache_entry= entry;
418  srq->asr_debugview = (int)actor->GetGfxActor()->GetDebugView();
420 
421  // This deletes all actors using the resource bundle, including the one we're reloading.
423 
424  // Load our actor again, but only after all actors are deleted.
426  }
428  {
430  }
432  {
433  actor->GetGfxActor()->UpdateSimDataBuffer();
435  }
436 }
437 
439 {
440  if (actor == m_player_actor)
441  {
442  Ogre::Vector3 center = m_player_actor->getRotationCenter();
443  this->ChangePlayerActor(nullptr); // Get out of the vehicle
444  this->GetPlayerCharacter()->setPosition(center);
445  // Update scene SimBuffer immediatelly to prevent having dangling pointer.
447  }
448 
449  if (actor == m_prev_player_actor)
450  {
451  m_prev_player_actor = nullptr;
452  }
453 
454  if (actor == m_last_spawned_actor)
455  {
456  m_last_spawned_actor = nullptr;
457  }
458 
459  // Find linked actors and un-tie if tied
460  for (auto actorx : m_actor_manager.GetLocalActors())
461  {
462  if (actorx->isTied() && std::find(actor->ar_linked_actors.begin(), actor->ar_linked_actors.end(), actorx) != actor->ar_linked_actors.end())
463  {
464  actorx->tieToggle(); // OK to invoke here - processing MSG_SIM_DELETE_ACTOR_REQUESTED
465  }
466 
467  if (actorx->isLocked() && std::find(actor->ar_linked_actors.begin(), actor->ar_linked_actors.end(), actorx) != actor->ar_linked_actors.end())
468  {
469  actorx->hookToggle(); // OK to invoke here - processing MSG_SIM_DELETE_ACTOR_REQUESTED
470  }
471  }
472 
474 
475 #ifdef USE_SOCKETW
476  if (App::mp_state->getEnum<MpState>() == MpState::CONNECTED)
477  {
479  }
480 #endif //SOCKETW
481 
483 
485 }
486 
488 {
489  ActorPtr prev_player_actor = m_player_actor;
490  m_player_actor = actor;
491 
492  // hide any old dashes
493  if (prev_player_actor && prev_player_actor->ar_dashboard)
494  {
495  prev_player_actor->ar_dashboard->setVisible3d(false);
496  }
497  // show new
499  {
501  }
502 
503  if (prev_player_actor)
504  {
505  App::GetOverlayWrapper()->showDashboardOverlays(false, prev_player_actor);
506 
507  prev_player_actor->GetGfxActor()->SetRenderdashActive(false);
508 
509  SOUND_STOP(prev_player_actor, SS_TRIG_AIR);
510  SOUND_STOP(prev_player_actor, SS_TRIG_PUMP);
511  }
512 
513  if (m_player_actor == nullptr)
514  {
515  // getting outside
516 
517  if (prev_player_actor)
518  {
520  {
522  }
523 
524  prev_player_actor->prepareInside(false);
525 
526  // get player out of the vehicle
527  float h = prev_player_actor->getMinCameraRadius();
528  float rotation = prev_player_actor->getRotation() - Ogre::Math::HALF_PI;
529  Ogre::Vector3 position = prev_player_actor->getPosition();
530  if (prev_player_actor->ar_cinecam_node[0] != NODENUM_INVALID)
531  {
532  // actor has a cinecam (find optimal exit position)
533  Ogre::Vector3 l = position - 2.0f * prev_player_actor->GetCameraRoll();
534  Ogre::Vector3 r = position + 2.0f * prev_player_actor->GetCameraRoll();
535  float l_h = m_terrain->GetCollisions()->getSurfaceHeightBelow(l.x, l.z, l.y + h);
536  float r_h = m_terrain->GetCollisions()->getSurfaceHeightBelow(r.x, r.z, r.y + h);
537  position = std::abs(r.y - r_h) * 1.2f < std::abs(l.y - l_h) ? r : l;
538  }
539  position.y = m_terrain->GetCollisions()->getSurfaceHeightBelow(position.x, position.z, position.y + h);
540 
541  Character* player_character = this->GetPlayerCharacter();
542  if (player_character)
543  {
544  player_character->SetActorCoupling(false, nullptr);
545  player_character->setRotation(Ogre::Radian(rotation));
546  player_character->setPosition(position);
547  }
548  }
549 
551 
552  TRIGGER_EVENT_ASYNC(SE_TRUCK_EXIT, prev_player_actor?prev_player_actor->ar_instance_id:-1);
553  }
554  else
555  {
556  // getting inside
558  !App::GetGuiManager()->IsGuiHidden(), m_player_actor);
559 
561  {
563  }
564 
566 
567  // force feedback
569 
570  // attach player to vehicle
571  Character* player_character = this->GetPlayerCharacter();
572  if (player_character)
573  {
574  player_character->SetActorCoupling(true, m_player_actor);
575  }
576 
578 
580  }
581 
582  if (prev_player_actor != nullptr || m_player_actor != nullptr)
583  {
585  }
586 
588 }
589 
591 {
593 }
594 
596 {
598 }
599 
601 {
603 }
604 
605 ActorPtr GameContext::FindActorByCollisionBox(std::string const & ev_src_instance_name, std::string const & box_name)
606 {
608  ev_src_instance_name, box_name);
609 }
610 
612 {
613  if (m_last_cache_selection != nullptr)
614  {
621  }
622 }
623 
624 void GameContext::SpawnPreselectedActor(std::string const& preset_vehicle, std::string const& preset_veh_config)
625 {
627  LT_AllBeam, /*partial=*/true, preset_vehicle);
628 
629  if (!entry)
630  return;
631 
633  rq->asr_cache_entry = entry;
635  rq->asr_rotation = Ogre::Quaternion(Ogre::Degree(180) - this->GetPlayerCharacter()->getRotation(), Ogre::Vector3::UNIT_Y);
637 
638  RoR::LogFormat("[RoR|Diag] Preselected Truck: %s (%s)", entry->dname.c_str(), entry->fname.c_str());
639 
640  // Section config lookup
641  if (!entry->sectionconfigs.empty())
642  {
643  if (std::find(entry->sectionconfigs.begin(), entry->sectionconfigs.end(),
644  preset_veh_config)
645  == entry->sectionconfigs.end())
646  {
647  // Preselected config doesn't exist -> use first available one
648  rq->asr_config = entry->sectionconfigs[0];
649  }
650  else
651  {
652  rq->asr_config = preset_veh_config;
653  }
654  RoR::LogFormat("[RoR|Diag] Preselected Truck Config: %s", rq->asr_config.c_str());
655  }
656 
658 }
659 
660 void GameContext::ShowLoaderGUI(int type, const Ogre::String& instance, const Ogre::String& box)
661 {
662  // first, test if the place if clear, BUT NOT IN MULTIPLAYER
663  if (!(App::mp_state->getEnum<MpState>() == MpState::CONNECTED))
664  {
665  collision_box_t* spawnbox = m_terrain->GetCollisions()->getBox(instance, box);
666  for (ActorPtr& actor : this->GetActorManager()->GetActors())
667  {
668  for (int i = 0; i < actor->ar_num_nodes; i++)
669  {
670  if (m_terrain->GetCollisions()->isInside(actor->ar_nodes[i].AbsPosition, spawnbox))
671  {
672  App::GetConsole()->putMessage(Console::CONSOLE_MSGTYPE_INFO, Console::CONSOLE_SYSTEM_NOTICE, _L("Please clear the place first"), "error.png");
673  return;
674  }
675  }
676  }
677  }
678 
682 
684  m.payload = reinterpret_cast<void*>(new LoaderType(LoaderType(type)));
686 }
687 
689 {
691 
692  if (App::GetGuiManager()->TopMenubar.ai_select)
693  {
696  }
697  if (App::GetGuiManager()->TopMenubar.ai_select2)
698  {
701  }
702 }
703 
704 void GameContext::OnLoaderGuiApply(LoaderType type, CacheEntryPtr entry, std::string sectionconfig)
705 {
706  bool spawn_now = false;
707  switch (type)
708  {
709  case LT_AddonPart:
710  if (m_player_actor)
711  {
714  req->mpr_subject = entry->fname;
717  }
718  break;
719 
720  case LT_Skin:
721  if (entry != m_dummy_cache_selection)
722  {
724  if (App::GetGuiManager()->TopMenubar.ai_select)
725  {
727  }
728  if (App::GetGuiManager()->TopMenubar.ai_select2)
729  {
731  }
732  }
733  spawn_now = true;
734  break;
735 
736  case LT_Vehicle:
737  case LT_Truck:
738  case LT_Car:
739  case LT_Boat:
740  case LT_Airplane:
741  case LT_Trailer:
742  case LT_Train:
743  case LT_Load:
744  case LT_Extension:
745  case LT_AllBeam:
747  m_current_selection.asr_config = sectionconfig;
748  if (App::GetGuiManager()->TopMenubar.ai_select)
749  {
751  }
752  if (App::GetGuiManager()->TopMenubar.ai_select2)
753  {
755  }
757  // Look for extra skins
758  if (!entry->guid.empty())
759  {
760  CacheQuery skin_query;
761  skin_query.cqy_filter_guid = entry->guid;
762  skin_query.cqy_filter_type = LT_Skin;
763  size_t num_skins = App::GetCacheSystem()->Query(skin_query);
764  // Determine default skin
765  CacheEntryPtr default_skin_entry = nullptr;
766  if (entry->default_skin != "")
767  {
768  for (CacheQueryResult& res : skin_query.cqy_results)
769  {
770  if (res.cqr_entry->dname == entry->default_skin)
771  default_skin_entry = res.cqr_entry;
772  }
773  if (!default_skin_entry)
774  {
776  fmt::format(_L("Default skin '{}' for actor '{}' not found!"), entry->default_skin, entry->dname));
777  }
778  if (default_skin_entry && num_skins == 1)
779  {
780  m_current_selection.asr_skin_entry = default_skin_entry;
781  }
782  }
783  else
784  {
785  default_skin_entry = m_dummy_cache_selection;
786  default_skin_entry->dname = "Default skin";
787  default_skin_entry->description = "Original, unmodified skin";
788  }
789 
790  if (!m_current_selection.asr_skin_entry && num_skins > 0)
791  {
792  App::GetGuiManager()->MainSelector.Show(LT_Skin, entry->guid, default_skin_entry); // Intentionally not using MSG_
793  }
794  else
795  {
796  spawn_now = true;
797  }
798  }
799  else
800  {
801  spawn_now = true;
802  }
803  break;
804 
805  default:;
806  }
807 
808  if (spawn_now)
809  {
810  if (App::GetGuiManager()->TopMenubar.ai_select)
811  {
816  }
817  else if (App::GetGuiManager()->TopMenubar.ai_select2)
818  {
823  }
824  else
825  {
827  *rq = m_current_selection;
829  }
830 
832  }
833 }
834 
836 
837 // --------------------------------
838 // Characters
839 
841 {
843 
844  // Adjust character position
845  Ogre::Vector3 spawn_pos = m_terrain->getSpawnPos();
846  float spawn_rot = 0.0f;
847 
848  // Classic behavior, retained for compatibility.
849  // Required for maps like N-Labs or F1 Track.
851  {
852  spawn_rot = 180.0f;
853  }
854 
855  // Preset position - commandline has precedence
856  if (App::cli_preset_spawn_pos->getStr() != "")
857  {
858  spawn_pos = Ogre::StringConverter::parseVector3(App::cli_preset_spawn_pos->getStr(), spawn_pos);
860  }
861  else if (App::diag_preset_spawn_pos->getStr() != "")
862  {
863  spawn_pos = Ogre::StringConverter::parseVector3(App::diag_preset_spawn_pos->getStr(), spawn_pos);
865  }
866 
867  // Preset rotation - commandline has precedence
868  if (App::cli_preset_spawn_rot->getStr() != "")
869  {
870  spawn_rot = Ogre::StringConverter::parseReal(App::cli_preset_spawn_rot->getStr(), spawn_rot);
872  }
873  else if (App::diag_preset_spawn_rot->getStr() != "")
874  {
875  spawn_rot = Ogre::StringConverter::parseReal(App::diag_preset_spawn_rot->getStr(), spawn_rot);
877  }
878 
879  spawn_pos.y = m_terrain->GetCollisions()->getSurfaceHeightBelow(spawn_pos.x, spawn_pos.z, spawn_pos.y + 1.8f);
880 
881  this->GetPlayerCharacter()->setPosition(spawn_pos);
882  this->GetPlayerCharacter()->setRotation(Ogre::Degree(spawn_rot));
883 
884  App::GetCameraManager()->GetCameraNode()->setPosition(this->GetPlayerCharacter()->getPosition());
885 
886  // Small hack to improve the spawn experience
887  for (int i = 0; i < 100; i++)
888  {
890  }
891 }
892 
893 Character* GameContext::GetPlayerCharacter() // Convenience ~ counterpart of `GetPlayerActor()`
894 {
896 }
897 
898 // --------------------------------
899 // Gameplay feats
900 
901 void GameContext::TeleportPlayer(float x, float z)
902 {
904  if (!this->GetPlayerActor())
905  {
906  this->GetPlayerCharacter()->setPosition(Ogre::Vector3(x, y, z));
907  return;
908  }
909 
910  TRIGGER_EVENT_ASYNC(SE_TRUCK_TELEPORT, this->GetPlayerActor()->ar_instance_id);
911 
912  Ogre::Vector3 translation = Ogre::Vector3(x, y, z) - this->GetPlayerActor()->ar_nodes[0].AbsPosition;
913 
914  std::vector<ActorPtr> actorsToBeamUp;
915  actorsToBeamUp.assign(this->GetPlayerActor()->ar_linked_actors.begin(), this->GetPlayerActor()->ar_linked_actors.end());
916  actorsToBeamUp.push_back(this->GetPlayerActor());
917 
918  float src_agl = std::numeric_limits<float>::max();
919  float dst_agl = std::numeric_limits<float>::max();
920  for (ActorPtr& actor : actorsToBeamUp)
921  {
922  for (int i = 0; i < actor->ar_num_nodes; i++)
923  {
924  Ogre::Vector3 pos = actor->ar_nodes[i].AbsPosition;
925  src_agl = std::min(pos.y - m_terrain->GetCollisions()->getSurfaceHeight(pos.x, pos.z), src_agl);
926  pos += translation;
927  dst_agl = std::min(pos.y - m_terrain->GetCollisions()->getSurfaceHeight(pos.x, pos.z), dst_agl);
928  }
929  }
930 
931  translation += Ogre::Vector3::UNIT_Y * (std::max(0.0f, src_agl) - dst_agl);
932 
933  for (ActorPtr& actor : actorsToBeamUp)
934  {
935  actor->resetPosition(actor->ar_nodes[0].AbsPosition + translation, false);
936  }
937 }
938 
940 {
941  // Generic escape key event
942  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_QUIT_GAME))
943  {
944  if (App::app_state->getEnum<AppState>() == AppState::MAIN_MENU)
945  {
946  if (App::GetGuiManager()->GameAbout.IsVisible())
947  {
949  }
950  else if (App::GetGuiManager()->MainSelector.IsVisible())
951  {
953  }
954  else if (App::GetGuiManager()->GameSettings.IsVisible())
955  {
957  }
958  else if (App::GetGuiManager()->GameControls.IsVisible())
959  {
961  }
962  else if (App::GetGuiManager()->MultiplayerSelector.IsVisible())
963  {
965  }
966  else if (App::GetGuiManager()->RepositorySelector.IsVisible())
967  {
969  }
970  else
971  {
973  }
974  }
975  else if (App::app_state->getEnum<AppState>() == AppState::SIMULATION)
976  {
977  if (App::GetGuiManager()->MainSelector.IsVisible())
978  {
980  }
981  else if (App::GetGuiManager()->GameControls.IsVisible())
982  {
984  }
985  else if (App::sim_state->getEnum<SimState>() == SimState::RUNNING)
986  {
988  if (App::mp_state->getEnum<MpState>() != MpState::CONNECTED)
989  {
991  }
992  }
993  else if (App::sim_state->getEnum<SimState>() == SimState::PAUSED)
994  {
997  }
998  }
999  }
1000 
1001  // screenshot
1002  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_SCREENSHOT, 0.25f))
1003  {
1005  }
1006 
1007  // fullscreen toggle
1008  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_FULLSCREEN_TOGGLE, 2.0f))
1009  {
1010  if (App::GetAppContext()->GetRenderWindow()->isFullScreen())
1012  else
1014  }
1015 
1016  // render mode
1017  switch (App::gfx_polygon_mode->getEnum<Ogre::PolygonMode>())
1018  {
1019  case 1: App::GetCameraManager()->GetCamera()->setPolygonMode(Ogre::PM_SOLID); break;
1020  case 2: App::GetCameraManager()->GetCamera()->setPolygonMode(Ogre::PM_WIREFRAME); break;
1021  case 3: App::GetCameraManager()->GetCamera()->setPolygonMode(Ogre::PM_POINTS); break;
1022  }
1023 
1024  // Write player position to log
1025  if (App::app_state->getEnum<AppState>() == AppState::SIMULATION &&
1026  App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_OUTPUT_POSITION))
1027  {
1028  Ogre::Vector3 position(Ogre::Vector3::ZERO);
1029  Ogre::Radian rotation(0);
1030  if (this->GetPlayerActor() == nullptr)
1031  {
1032  position = this->GetPlayerCharacter()->getPosition();
1033  rotation = this->GetPlayerCharacter()->getRotation() + Ogre::Radian(Ogre::Math::PI);
1034  }
1035  else
1036  {
1037  position = this->GetPlayerActor()->getPosition();
1038  rotation = this->GetPlayerActor()->getRotation();
1039  }
1040  Ogre::String pos = Ogre::StringUtil::format("%8.3f, %8.3f, %8.3f" , position.x, position.y, position.z);
1041  Ogre::String rot = Ogre::StringUtil::format("% 6.1f, % 6.1f, % 6.1f", 0.0f, rotation.valueDegrees() , 0.0f);
1042  LOG("Position: " + pos + ", " + rot);
1043  }
1044 
1045  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_RESET_MODE))
1046  {
1050  (App::sim_soft_reset_mode->getBool()) ? _L("Enabled soft reset mode") : _L("Enabled hard reset mode"));
1051  }
1052 }
1053 
1055 {
1056  // get new vehicle
1057  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_GET_NEW_VEHICLE))
1058  {
1060  m.payload = reinterpret_cast<void*>(new LoaderType(LT_AllBeam));
1062  }
1063 
1064  // Enter/exit truck - With a toggle delay
1065  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_ENTER_OR_EXIT_TRUCK, 0.5f))
1066  {
1067  if (this->GetPlayerActor() == nullptr) // no vehicle
1068  {
1069  // find the nearest vehicle
1070  float mindist = 1000.0;
1071  ActorPtr nearest_actor = nullptr;
1072  for (ActorPtr& actor : this->GetActorManager()->GetActors())
1073  {
1074  if (!actor->ar_driveable)
1075  continue;
1076  if (actor->ar_cinecam_node[0] == NODENUM_INVALID)
1077  {
1078  LOG("cinecam missing, cannot enter the actor!");
1079  continue;
1080  }
1081  float len = 0.0f;
1082  if (this->GetPlayerCharacter())
1083  {
1084  len = actor->ar_nodes[actor->ar_cinecam_node[0]].AbsPosition.distance(this->GetPlayerCharacter()->getPosition() + Ogre::Vector3(0.0, 2.0, 0.0));
1085  }
1086  if (len < mindist)
1087  {
1088  mindist = len;
1089  nearest_actor = actor;
1090  }
1091  }
1092 
1093  if (mindist < 20.0)
1094  {
1095  this->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, static_cast<void*>(new ActorPtr(nearest_actor))));
1096  }
1097  }
1098  else // We're in a vehicle -> If moving slowly enough, get out
1099  {
1100  if (this->GetPlayerActor()->ar_nodes[0].Velocity.squaredLength() < 1.0f ||
1101  this->GetPlayerActor()->ar_state == ActorState::NETWORKED_OK || this->GetPlayerActor()->ar_state == ActorState::NETWORKED_HIDDEN ||
1102  this->GetPlayerActor()->ar_driveable == AI)
1103  {
1104  this->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, static_cast<void*>(new ActorPtr())));
1105  }
1106  }
1107  }
1108 
1109  // enter next truck
1110  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_ENTER_NEXT_TRUCK, 0.25f))
1111  {
1112  ActorPtr actor = this->FetchNextVehicleOnList();
1113  if (actor != this->GetPlayerActor())
1114  {
1115  this->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
1116  }
1117  }
1118 
1119  // enter previous truck
1120  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_ENTER_PREVIOUS_TRUCK, 0.25f))
1121  {
1122  ActorPtr actor = this->FetchPrevVehicleOnList();
1123  if (actor != this->GetPlayerActor())
1124  {
1125  this->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, static_cast<void*>(new ActorPtr(actor))));
1126  }
1127  }
1128 
1129  // respawn last truck
1130  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_RESPAWN_LAST_TRUCK, 0.25f))
1131  {
1132  this->RespawnLastActor();
1133  }
1134 
1135  // terrain editor toggle
1137  {
1139  }
1140 
1141  // forward commands from character
1142  if (!m_player_actor)
1143  {
1144  // Find nearest actor
1145  const Ogre::Vector3 position = App::GetGameContext()->GetPlayerCharacter()->getPosition();
1146  ActorPtr nearest_actor = nullptr;
1147  float min_squared_distance = std::numeric_limits<float>::max();
1148  for (ActorPtr& actor : App::GetGameContext()->GetActorManager()->GetActors())
1149  {
1150  float squared_distance = position.squaredDistance(actor->ar_nodes[0].AbsPosition);
1151  if (squared_distance < min_squared_distance)
1152  {
1153  min_squared_distance = squared_distance;
1154  nearest_actor = actor;
1155  }
1156  }
1157 
1158  // Evaluate
1159  if (nearest_actor != nullptr &&
1160  nearest_actor->ar_import_commands &&
1161  min_squared_distance < (nearest_actor->getMinCameraRadius()*nearest_actor->getMinCameraRadius()))
1162  {
1163  // get commands
1164  for (int i = 1; i <= MAX_COMMANDS; i++) // BEWARE: commandkeys are indexed 1-MAX_COMMANDS!
1165  {
1166  int eventID = EV_COMMANDS_01 + (i - 1);
1167 
1168  nearest_actor->ar_command_key[i].playerInputValue = RoR::App::GetInputEngine()->getEventValue(eventID);
1169  }
1170  }
1171  }
1172 
1173  // AI waypoint recording
1174  if (App::GetGuiManager()->TopMenubar.ai_rec)
1175  {
1176  if (m_timer.getMilliseconds() > 1000) // Don't spam it, record every 1 sec
1177  {
1178  if (App::GetGameContext()->GetPlayerActor()) // We are in vehicle
1179  {
1180  if (App::GetGameContext()->GetPlayerActor()->getPosition().distance(prev_pos) >= 5) // Skip very close positions
1181  {
1182  ai_events waypoint;
1184  waypoint.speed = App::GetGameContext()->GetPlayerActor()->getWheelSpeed() * 3.6;
1185  if (waypoint.speed < 5)
1186  {
1187  waypoint.speed = -1;
1188  }
1189  App::GetGuiManager()->TopMenubar.ai_waypoints.push_back(waypoint);
1190  }
1192  }
1193  else // We are in feet
1194  {
1195  if (App::GetGameContext()->GetPlayerCharacter()->getPosition() != prev_pos) // Skip same positions
1196  {
1197  ai_events waypoint;
1199  App::GetGuiManager()->TopMenubar.ai_waypoints.push_back(waypoint);
1200  }
1202  }
1203  m_timer.reset();
1204  }
1205  }
1206  else
1207  {
1208  prev_pos = Ogre::Vector3::ZERO;
1209  }
1210 }
1211 
1213 {
1214 #ifdef USE_CAELUM
1215  if (App::gfx_sky_mode->getEnum<GfxSkyMode>() == GfxSkyMode::CAELUM &&
1217  {
1218  float time_factor = 1.0f;
1219 
1220  if (RoR::App::GetInputEngine()->getEventBoolValue(EV_SKY_INCREASE_TIME))
1221  {
1222  time_factor = 1000.0f;
1223  }
1224  else if (RoR::App::GetInputEngine()->getEventBoolValue(EV_SKY_INCREASE_TIME_FAST))
1225  {
1226  time_factor = 10000.0f;
1227  }
1228  else if (RoR::App::GetInputEngine()->getEventBoolValue(EV_SKY_DECREASE_TIME))
1229  {
1230  time_factor = -1000.0f;
1231  }
1232  else if (RoR::App::GetInputEngine()->getEventBoolValue(EV_SKY_DECREASE_TIME_FAST))
1233  {
1234  time_factor = -10000.0f;
1235  }
1236  else if (App::gfx_sky_time_cycle->getBool())
1237  {
1238  time_factor = App::gfx_sky_time_speed->getInt();
1239  }
1240 
1241  if (m_terrain->getSkyManager()->GetSkyTimeFactor() != time_factor)
1242  {
1243  m_terrain->getSkyManager()->SetSkyTimeFactor(time_factor);
1244  Str<200> msg; msg << _L("Time set to ") << m_terrain->getSkyManager()->GetPrettyTime();
1246  }
1247  }
1248 
1249 #endif // USE_CAELUM
1250  if (App::gfx_sky_mode->getEnum<GfxSkyMode>() == GfxSkyMode::SKYX &&
1252  {
1253  if (RoR::App::GetInputEngine()->getEventBoolValue(EV_SKY_INCREASE_TIME))
1254  {
1256  }
1257  else if (RoR::App::GetInputEngine()->getEventBoolValue(EV_SKY_INCREASE_TIME_FAST))
1258  {
1260  }
1261  else if (RoR::App::GetInputEngine()->getEventBoolValue(EV_SKY_DECREASE_TIME))
1262  {
1264  }
1265  else if (RoR::App::GetInputEngine()->getEventBoolValue(EV_SKY_DECREASE_TIME_FAST))
1266  {
1268  }
1269  else
1270  {
1272  }
1273  }
1274 }
1275 
1277 {
1279 
1280  // reload current truck
1281  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCKEDIT_RELOAD, 0.5f))
1282  {
1287  }
1288 
1289  // remove current truck
1290  if (App::GetInputEngine()->getEventBoolValue(EV_COMMON_REMOVE_CURRENT_TRUCK))
1291  {
1293  }
1294 
1295  // Front lights
1296  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_TRUCK_LOW_BEAMS))
1297  {
1299  // sync sidelights to lowbeams
1301  }
1302  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_CYCLE_TRUCK_LIGHTS))
1303  {
1304  // Smart cycling:
1305  // 1) all lights off
1306  // 2) sidelights on but only if any installed, otherwise skip to 3).
1307  // 3) sidelights and lowbeams on.
1308  // 4) sidelights, lowbeams and highbeams on, but only if highbeams are installed, otherwise cycle to 1).
1310  {
1312  }
1313  else if (!m_player_actor->getHeadlightsVisible())
1314  {
1317  }
1319  {
1323  }
1324  else
1325  {
1329  }
1330  }
1331  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_TRUCK_HIGH_BEAMS))
1332  {
1334  }
1335  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_TRUCK_FOG_LIGHTS))
1336  {
1338  }
1339 
1340  // Beacons
1341  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_TRUCK_BEACONS))
1342  {
1344  }
1345 
1346  // blinkers
1347  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_BLINK_LEFT))
1349 
1350  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_BLINK_RIGHT))
1352 
1353  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_BLINK_WARN))
1355 
1356  // custom lights
1357  for (int i = 0; i < MAX_CLIGHTS; i++)
1358  {
1359  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_LIGHTTOGGLE01 + i))
1361  }
1362 
1363  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TRUCK_REMOVE))
1364  {
1366  }
1367 
1368  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_ROPELOCK))
1369  {
1371  }
1372 
1373  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_LOCK))
1374  {
1375  //m_player_actor->hookToggle(-1, HOOK_TOGGLE, -1);
1376  ActorLinkingRequest* hook_rq = new ActorLinkingRequest();
1380 
1381  //m_player_actor->toggleSlideNodeLock();
1382  ActorLinkingRequest* slidenode_rq = new ActorLinkingRequest();
1386  }
1387 
1388  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_AUTOLOCK))
1389  {
1390  m_player_actor->hookToggle(-2, ActorLinkingRequestType::HOOK_UNLOCK, -1); //unlock all autolocks
1391  }
1392 
1393  //strap
1394  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_SECURE_LOAD))
1395  {
1397  }
1398 
1399  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_CUSTOM_PARTICLES))
1400  {
1402  }
1403 
1404  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_TOGGLE_DEBUG_VIEW))
1405  {
1407  for (ActorPtr& actor : m_player_actor->ar_linked_actors)
1408  {
1410  }
1411  }
1412 
1413  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_CYCLE_DEBUG_VIEWS))
1414  {
1416  for (ActorPtr& actor : m_player_actor->ar_linked_actors)
1417  {
1419  }
1420  }
1421 
1422  if (App::GetInputEngine()->getEventBoolValueBounce(EV_COMMON_RESCUE_TRUCK, 0.5f) &&
1423  App::mp_state->getEnum<MpState>() != MpState::CONNECTED &&
1425  {
1426  ActorPtr rescuer = nullptr;
1427  for (ActorPtr& actor : App::GetGameContext()->GetActorManager()->GetActors())
1428  {
1429  if (actor->ar_rescuer_flag)
1430  {
1431  rescuer = actor;
1432  }
1433  }
1434  if (rescuer == nullptr)
1435  {
1436  App::GetConsole()->putMessage(Console::CONSOLE_MSGTYPE_INFO, Console::CONSOLE_SYSTEM_NOTICE, _L("No rescue truck found!"), "error.png");
1437  }
1438  else
1439  {
1440  App::GetGameContext()->PushMessage(Message(MSG_SIM_SEAT_PLAYER_REQUESTED, static_cast<void*>(new ActorPtr(rescuer))));
1441  }
1442  }
1443 
1444  // parking brake
1445  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_TRAILER_PARKING_BRAKE))
1446  {
1451  }
1452 
1453  // videocam
1454  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_TOGGLE_VIDEOCAMERA, 0.5f))
1455  {
1457  {
1459  }
1460  else
1461  {
1463  }
1464  }
1465 
1466  // enter/exit truck - Without a delay: the vehicle must brake like braking normally
1467  if (App::GetInputEngine()->getEventBoolValue(EV_COMMON_ENTER_OR_EXIT_TRUCK))
1468  {
1469  if (m_player_actor->ar_driveable != AI)
1470  {
1471  m_player_actor->ar_brake = 0.66f;
1472  }
1473  }
1474 
1475  // toggle physics
1476  if (RoR::App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_TOGGLE_PHYSICS))
1477  {
1478  for (ActorPtr& actor : App::GetGameContext()->GetPlayerActor()->ar_linked_actors)
1479  {
1480  actor->ar_physics_paused = !App::GetGameContext()->GetPlayerActor()->ar_physics_paused;
1481  }
1483  }
1484 
1485  // reset truck
1486  if (App::GetInputEngine()->getEventBoolValue(EV_COMMON_RESET_TRUCK))
1487  {
1492  }
1493 
1494  // Commandkeys: process controller input for all commands
1495  for (int i = 1; i <= MAX_COMMANDS; i++) // BEWARE: commandkeys are indexed 1-MAX_COMMANDS!
1496  {
1497  int eventID = EV_COMMANDS_01 + (i - 1);
1498 
1499  m_player_actor->ar_command_key[i].playerInputValue = RoR::App::GetInputEngine()->getEventValue(eventID);
1500  }
1501 
1502  // Commandkeys: Apply command buttons in T-screen
1503  if (App::GetGuiManager()->VehicleInfoTPanel.GetActiveCommandKey() != COMMANDKEYID_INVALID)
1504  {
1506  }
1507 
1508  if (RoR::App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_TOGGLE_FORWARDCOMMANDS))
1509  {
1512  {
1513  RoR::App::GetConsole()->putMessage(Console::CONSOLE_MSGTYPE_INFO, Console::CONSOLE_SYSTEM_NOTICE, _L("forwardcommands enabled"), "information.png");
1514  }
1515  else
1516  {
1517  RoR::App::GetConsole()->putMessage(Console::CONSOLE_MSGTYPE_INFO, Console::CONSOLE_SYSTEM_NOTICE, _L("forwardcommands disabled"), "information.png");
1518  }
1519  }
1520 
1521  if (RoR::App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_TOGGLE_IMPORTCOMMANDS))
1522  {
1525  {
1526  RoR::App::GetConsole()->putMessage(Console::CONSOLE_MSGTYPE_INFO, Console::CONSOLE_SYSTEM_NOTICE, _L("importcommands enabled"), "information.png");
1527  }
1528  else
1529  {
1530  RoR::App::GetConsole()->putMessage(Console::CONSOLE_MSGTYPE_INFO, Console::CONSOLE_SYSTEM_NOTICE, _L("importcommands disabled"), "information.png");
1531  }
1532  }
1533 
1534  if (m_player_actor->getReplay())
1535  {
1537  }
1538 }
1539 
1540 // Internal heper for UpdateAirplaneInputEvents()
1541 void smoothValue(float& ref, float value, float rate)
1542 {
1543  if (value < -1)
1544  value = -1;
1545  if (value > 1)
1546  value = 1;
1547  // smooth!
1548  if (ref > value)
1549  {
1550  ref -= rate;
1551  if (ref < value)
1552  ref = value;
1553  }
1554  else if (ref < value)
1555  ref += rate;
1556 }
1557 
1559 {
1561  return;
1562 
1563  // autopilot
1565  {
1567  }
1568 
1569  // steer
1570  float commandrate = 4.0;
1573  float sum_steer = -tmp_left + tmp_right;
1574  smoothValue(m_player_actor->ar_aileron, sum_steer, dt * commandrate);
1577 
1578  // pitch
1580  float tmp_pitch_down = App::GetInputEngine()->getEventValue(EV_AIRPLANE_ELEVATOR_DOWN);
1581  float sum_pitch = tmp_pitch_down - tmp_pitch_up;
1582  smoothValue(m_player_actor->ar_elevator, sum_pitch, dt * commandrate);
1583 
1584  // rudder
1585  float tmp_rudder_left = App::GetInputEngine()->getEventValue(EV_AIRPLANE_RUDDER_LEFT);
1586  float tmp_rudder_right = App::GetInputEngine()->getEventValue(EV_AIRPLANE_RUDDER_RIGHT);
1587  float sum_rudder = tmp_rudder_left - tmp_rudder_right;
1588  smoothValue(m_player_actor->ar_rudder, sum_rudder, dt * commandrate);
1589 
1590  // brakes
1592  {
1594  }
1595 
1596  if (App::GetInputEngine()->getEventBoolValueBounce(EV_AIRPLANE_PARKING_BRAKE))
1597  {
1599  }
1600 
1601  // reverse
1602  if (App::GetInputEngine()->getEventBoolValueBounce(EV_AIRPLANE_REVERSE))
1603  {
1604  for (int i = 0; i < m_player_actor->ar_num_aeroengines; i++)
1605  {
1607  }
1608  }
1609 
1610  // engines
1611  if (App::GetInputEngine()->getEventBoolValueBounce(EV_AIRPLANE_TOGGLE_ENGINES))
1612  {
1613  for (int i = 0; i < m_player_actor->ar_num_aeroengines; i++)
1614  {
1616  }
1617  }
1618 
1619  // flaps
1620  if (App::GetInputEngine()->getEventBoolValueBounce(EV_AIRPLANE_FLAPS_NONE))
1621  {
1622  if (m_player_actor->ar_aerial_flap > 0)
1623  {
1625  }
1626  }
1627 
1628  if (App::GetInputEngine()->getEventBoolValueBounce(EV_AIRPLANE_FLAPS_FULL))
1629  {
1630  if (m_player_actor->ar_aerial_flap < 5)
1631  {
1633  }
1634  }
1635 
1636  if (App::GetInputEngine()->getEventBoolValueBounce(EV_AIRPLANE_FLAPS_LESS))
1637  {
1638  if (m_player_actor->ar_aerial_flap > 0)
1639  {
1641  }
1642  }
1643 
1645  {
1646  if (m_player_actor->ar_aerial_flap < 5)
1647  {
1649  }
1650  }
1651 
1652  // airbrakes
1654  {
1656  {
1658  }
1659  }
1660 
1662  {
1664  {
1666  }
1667  }
1668 
1670  {
1672  {
1674  }
1675  }
1676 
1678  {
1680  {
1682  }
1683  }
1684 
1685  // throttle
1687  if (tmp_throttle > 0)
1688  {
1689  for (int i = 0; i < m_player_actor->ar_num_aeroengines; i++)
1690  {
1691  m_player_actor->ar_aeroengines[i]->setThrottle(tmp_throttle);
1692  }
1693  }
1694 
1695  if (App::GetInputEngine()->isEventDefined(EV_AIRPLANE_THROTTLE_AXIS))
1696  {
1698  for (int i = 0; i < m_player_actor->ar_num_aeroengines; i++)
1699  {
1701  }
1702  }
1703 
1704  if (App::GetInputEngine()->getEventBoolValueBounce(EV_AIRPLANE_THROTTLE_DOWN, 0.1f))
1705  {
1706  for (int i = 0; i < m_player_actor->ar_num_aeroengines; i++)
1707  {
1709  }
1710  }
1711 
1712  if (App::GetInputEngine()->getEventBoolValueBounce(EV_AIRPLANE_THROTTLE_UP, 0.1f))
1713  {
1714  for (int i = 0; i < m_player_actor->ar_num_aeroengines; i++)
1715  {
1717  }
1718  }
1719 
1720  if (App::GetInputEngine()->getEventBoolValueBounce(EV_AIRPLANE_THROTTLE_NO, 0.1f))
1721  {
1722  for (int i = 0; i < m_player_actor->ar_num_aeroengines; i++)
1723  {
1725  }
1726  }
1727 
1728  if (App::GetInputEngine()->getEventBoolValueBounce(EV_AIRPLANE_THROTTLE_FULL, 0.1f))
1729  {
1730  for (int i = 0; i < m_player_actor->ar_num_aeroengines; i++)
1731  {
1733  }
1734  }
1735 
1736  // autopilot
1738  {
1739  for (int i = 0; i < m_player_actor->ar_num_aeroengines; i++)
1740  {
1742  }
1743  }
1744 }
1745 
1747 {
1748  // throttle
1749  if (App::GetInputEngine()->isEventDefined(EV_BOAT_THROTTLE_AXIS))
1750  {
1752  // use negative values also!
1753  f = f * 2 - 1;
1754  for (int i = 0; i < m_player_actor->ar_num_screwprops; i++)
1756  }
1757 
1758  if (App::GetInputEngine()->getEventBoolValueBounce(EV_BOAT_THROTTLE_DOWN, 0.1f))
1759  {
1760  for (int i = 0; i < m_player_actor->ar_num_screwprops; i++)
1762  }
1763 
1764  if (App::GetInputEngine()->getEventBoolValueBounce(EV_BOAT_THROTTLE_UP, 0.1f))
1765  {
1766  for (int i = 0; i < m_player_actor->ar_num_screwprops; i++)
1768  }
1769 
1770  // steer
1771  float tmp_steer_left = App::GetInputEngine()->getEventValue(EV_BOAT_STEER_LEFT);
1772  float tmp_steer_right = App::GetInputEngine()->getEventValue(EV_BOAT_STEER_RIGHT);
1774  float sum_steer = (tmp_steer_left - tmp_steer_right) * dt;
1775  // do not center the rudder!
1776  if (fabs(sum_steer) > 0 && stime <= 0)
1777  {
1778  for (int i = 0; i < m_player_actor->ar_num_screwprops; i++)
1780  }
1781 
1783  {
1786  sum_steer = (tmp_steer_left - tmp_steer_right);
1787  for (int i = 0; i < m_player_actor->ar_num_screwprops; i++)
1788  m_player_actor->ar_screwprops[i]->setRudder(sum_steer);
1789  }
1790 
1791  // rudder
1793  {
1794  for (int i = 0; i < m_player_actor->ar_num_screwprops; i++)
1796  }
1797 
1798  // reverse
1800  {
1801  for (int i = 0; i < m_player_actor->ar_num_screwprops; i++)
1803  }
1804 }
1805 
1807 {
1809  return;
1810 #ifdef USE_ANGELSCRIPT
1812  return;
1813 #endif // USE_ANGELSCRIPT
1814 
1815  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_LEFT_MIRROR_LEFT))
1817 
1818  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_LEFT_MIRROR_RIGHT))
1820 
1821  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_RIGHT_MIRROR_LEFT))
1823 
1824  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_RIGHT_MIRROR_RIGHT))
1826 
1827  // steering
1832 
1833  float sum = -std::max(tmp_left_digital, tmp_left_analog) + std::max(tmp_right_digital, tmp_right_analog);
1834 
1835  m_player_actor->ar_hydro_dir_command = Ogre::Math::Clamp(sum, -1.0f, 1.0f);
1836 
1837  m_player_actor->ar_hydro_speed_coupling = (tmp_left_digital >= tmp_left_analog) && (tmp_right_digital >= tmp_right_analog);
1838 
1840  {
1842  }
1843 
1844  if (m_player_actor->ar_brake > 1.0f / 6.0f)
1845  {
1847  }
1848  else
1849  {
1851  }
1852 
1853  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_TOGGLE_INTER_AXLE_DIFF))
1854  {
1857  }
1858 
1859  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF))
1860  {
1863  }
1864 
1865  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_TOGGLE_TCASE_4WD_MODE))
1866  {
1869  }
1870 
1871  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_TOGGLE_TCASE_GEAR_RATIO))
1872  {
1875  }
1876 
1878  {
1879  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_HORN))
1880  {
1881  SOUND_TOGGLE(m_player_actor, SS_TRIG_HORN); // Police siren
1882  }
1883  }
1884  else
1885  {
1886  if (App::GetInputEngine()->getEventBoolValue(EV_TRUCK_HORN)
1887  || App::GetGuiManager()->VehicleInfoTPanel.IsHornButtonActive())
1888  {
1890  }
1891  else
1892  {
1894  }
1895  }
1896 
1897  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_PARKING_BRAKE) &&
1898  !App::GetInputEngine()->getEventBoolValue(EV_TRUCK_TRAILER_PARKING_BRAKE))
1899  {
1901  }
1902 
1903  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_ANTILOCK_BRAKE))
1904  {
1906  }
1907 
1908  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_TRACTION_CONTROL))
1909  {
1911  }
1912 
1913  if (App::GetInputEngine()->getEventBoolValueBounce(EV_TRUCK_CRUISE_CONTROL))
1914  {
1916  }
1917 
1919  {
1921  }
1922 
1924  for (ActorPtr linked_actor : m_player_actor->ar_linked_actors)
1925  {
1926  linked_actor->UpdatePropAnimInputEvents();
1927  }
1928 }
1929 
RoR::MSG_EDI_MODIFY_PROJECT_REQUESTED
@ MSG_EDI_MODIFY_PROJECT_REQUESTED
Payload = RoR::UpdateProjectRequest* (owner)
Definition: Application.h:156
RoR::Actor::setHighBeamsVisible
void setHighBeamsVisible(bool val)
Definition: Actor.h:195
ROR_ASSERT
#define ROR_ASSERT(_EXPR)
Definition: Application.h:40
GameContext.h
Game state manager and message-queue provider.
RoR::GUIManager::VehicleInfoTPanel
GUI::VehicleInfoTPanel VehicleInfoTPanel
Definition: GUIManager.h:118
RoR::CameraManager::UpdateInputEvents
void UpdateInputEvents(float dt)
Definition: CameraManager.cpp:242
RoR::Engine::autoShiftSet
void autoShiftSet(int mode)
Definition: Engine.cpp:1154
RoR::EV_COMMON_SCREENSHOT
@ EV_COMMON_SCREENSHOT
take a screenshot
Definition: InputEngine.h:261
RoR::EV_AIRPLANE_RUDDER_RIGHT
@ EV_AIRPLANE_RUDDER_RIGHT
rudder right
Definition: InputEngine.h:91
MAX_COMMANDS
static const int MAX_COMMANDS
maximum number of commands per actor
Definition: SimConstants.h:28
RoR::Character::getRotation
Ogre::Radian getRotation() const
Definition: Character.h:54
RoR::GfxActor::SetDebugView
void SetDebugView(DebugViewType dv)
Definition: GfxActor.cpp:1576
RoR::EV_AIRPLANE_THROTTLE
@ EV_AIRPLANE_THROTTLE
Definition: InputEngine.h:94
RoR::CacheSystem::LoadAssetPack
void LoadAssetPack(CacheEntryPtr &t_dest, Ogre::String const &assetpack_filename)
Adds asset pack to the requesting cache entry's resource group.
Definition: CacheSystem.cpp:1309
RoR::App::gfx_polygon_mode
CVar * gfx_polygon_mode
Definition: Application.cpp:216
RoR::App::GetNetwork
Network * GetNetwork()
Definition: Application.cpp:287
RoR::Character::setPosition
void setPosition(Ogre::Vector3 position)
Definition: Character.cpp:85
RoR::ModifyProjectRequest::mpr_subject
std::string mpr_subject
Definition: CacheSystem.h:271
RoR::Actor::getMinCameraRadius
float getMinCameraRadius()
Definition: Actor.h:260
RoR::GUI::MultiplayerSelector::SetVisible
void SetVisible(bool v)
Definition: GUI_MultiplayerSelector.cpp:392
RoR::GUI::TopMenubar::ai_fname2
Ogre::String ai_fname2
Definition: GUI_TopMenubar.h:89
RoR::Autopilot::getThrottle
float getThrottle(float thrtl, float dt)
Definition: AutoPilot.cpp:225
SkyXManager.h
RoR::Actor::ar_vehicle_ai
VehicleAIPtr ar_vehicle_ai
Definition: Actor.h:394
RoR::ActorSpawnRequest::asr_net_color
int asr_net_color
Definition: SimData.h:842
RoR::CacheEntry::dname
Ogre::String dname
name parsed from the file
Definition: CacheSystem.h:70
RoR::EV_AIRPLANE_THROTTLE_DOWN
@ EV_AIRPLANE_THROTTLE_DOWN
decreases the airplane thrust
Definition: InputEngine.h:96
RoR::Actor::getWheelSpeed
float getWheelSpeed() const
Definition: Actor.h:94
RoR::GUI::TopMenubar::ai_fname
Ogre::String ai_fname
Definition: GUI_TopMenubar.h:78
ai_events::position
Ogre::Vector3 position
Definition: GUI_TopMenubar.h:39
RoR::ActorModifyRequest::Type::WAKE_UP
@ WAKE_UP
y
float y
Definition: (ValueTypes) quaternion.h:6
RoR::ActorSpawnRequest::Origin::NETWORK
@ NETWORK
Remote controlled.
RoR::MSG_SIM_MODIFY_ACTOR_REQUESTED
@ MSG_SIM_MODIFY_ACTOR_REQUESTED
Payload = RoR::ActorModifyRequest* (owner)
Definition: Application.h:122
RoR::GUI::GameSettings::SetVisible
void SetVisible(bool v)
Definition: GUI_GameSettings.cpp:514
RoR::GfxScene::GetEnvMap
GfxEnvmap & GetEnvMap()
Definition: GfxScene.h:67
RoR::MACHINE
@ MACHINE
its a machine
Definition: SimData.h:96
RoR::EV_COMMON_RESET_TRUCK
@ EV_COMMON_RESET_TRUCK
reset truck to original starting position
Definition: InputEngine.h:257
OverlayWrapper.h
RoR::GameContext::ModifyActor
void ModifyActor(ActorModifyRequest &rq)
Definition: GameContext.cpp:369
RoR::Actor::ar_physics_paused
bool ar_physics_paused
Actor physics individually paused by user.
Definition: Actor.h:456
RoR::EV_TRUCK_RIGHT_MIRROR_RIGHT
@ EV_TRUCK_RIGHT_MIRROR_RIGHT
Definition: InputEngine.h:332
RoR::MSG_EDI_RELOAD_BUNDLE_REQUESTED
@ MSG_EDI_RELOAD_BUNDLE_REQUESTED
Payload = RoR::CacheEntryPtr* (owner)
Definition: Application.h:153
RoR::InputSourceType::IST_ANALOG
@ IST_ANALOG
RoR::GfxActor::UpdateSimDataBuffer
void UpdateSimDataBuffer()
Copies sim. data from Actor to GfxActor for later update.
Definition: GfxActor.cpp:1775
RoR::TRUCK
@ TRUCK
its a truck (or other land vehicle)
Definition: SimData.h:93
RoR::Actor::ar_filename
std::string ar_filename
Attribute; filled at spawn.
Definition: Actor.h:422
RoR::MpState::CONNECTED
@ CONNECTED
RoR::Terrain::getMaxTerrainSize
Ogre::Vector3 getMaxTerrainSize()
Definition: Terrain.cpp:497
RoR::GUIManager::FrictionSettings
GUI::FrictionSettings FrictionSettings
Definition: GUIManager.h:125
RoR::EV_COMMON_TOGGLE_TRUCK_BEACONS
@ EV_COMMON_TOGGLE_TRUCK_BEACONS
toggle truck beacons
Definition: InputEngine.h:273
RoR::EV_TRUCK_RIGHT_MIRROR_LEFT
@ EV_TRUCK_RIGHT_MIRROR_LEFT
Definition: InputEngine.h:331
RoR::EV_TRUCK_BLINK_RIGHT
@ EV_TRUCK_BLINK_RIGHT
toggle right direction indicator (blinker)
Definition: InputEngine.h:304
RoR::Actor::toggleAxleDiffMode
void toggleAxleDiffMode()
Definition: Actor.cpp:1326
RoR::GfxScene::GetSimDataBuffer
GameContextSB & GetSimDataBuffer()
Definition: GfxScene.h:66
MAX_CLIGHTS
static const int MAX_CLIGHTS
See RoRnet::Lightmask and enum events in InputEngine.h.
Definition: SimConstants.h:35
RoR::CacheEntry::tuneup_def
TuneupDefPtr tuneup_def
Cached tuning info, added on first use or during cache rebuild.
Definition: CacheSystem.h:93
RoR::GameContext::m_last_skin_selection
CacheEntryPtr m_last_skin_selection
Definition: GameContext.h:198
RoR::Actor::setHeadlightsVisible
void setHeadlightsVisible(bool val)
Definition: Actor.h:193
RoR::LT_AddonPart
@ LT_AddonPart
Definition: Application.h:321
RoR::CharacterFactory::UndoRemoteActorCoupling
void UndoRemoteActorCoupling(ActorPtr actor)
Definition: CharacterFactory.cpp:90
RoR::Terrn2Parser
Definition: Terrn2FileFormat.h:80
RoR::EV_COMMON_ENTER_OR_EXIT_TRUCK
@ EV_COMMON_ENTER_OR_EXIT_TRUCK
enter or exit a truck
Definition: InputEngine.h:229
RoR::App::GetCameraManager
CameraManager * GetCameraManager()
Definition: Application.cpp:278
RoR::ActorSpawnRequest::Origin::CONFIG_FILE
@ CONFIG_FILE
'Preselected vehicle' in RoR.cfg or command line
RoR::ActorSpawnRequest::asr_origin
Origin asr_origin
Definition: SimData.h:839
RoR::CacheEntryPtr
RefCountingObjectPtr< CacheEntry > CacheEntryPtr
Definition: ForwardDeclarations.h:220
RoR::node_t::AbsPosition
Ogre::Vector3 AbsPosition
absolute position in the world (shaky)
Definition: SimData.h:294
RoR::EV_BOAT_STEER_LEFT_AXIS
@ EV_BOAT_STEER_LEFT_AXIS
steer left (analog value!)
Definition: InputEngine.h:104
VehicleAI.h
Simple waypoint AI.
RoR::App::GetGuiManager
GUIManager * GetGuiManager()
Definition: Application.cpp:272
RoR::Actor::ar_parking_brake
bool ar_parking_brake
Definition: Actor.h:411
RoR::App::sim_soft_reset_mode
CVar * sim_soft_reset_mode
Definition: Application.cpp:109
RoRnet::UserInfo
Definition: RoRnet.h:178
RoR::ActorLinkingRequest
Estabilishing a physics linkage between 2 actors modifies a global linkage table and triggers immedia...
Definition: SimData.h:904
RoR::EV_COMMON_TOGGLE_RESET_MODE
@ EV_COMMON_TOGGLE_RESET_MODE
toggle truck reset truck mode (soft vs. hard)
Definition: InputEngine.h:258
DashBoardManager.h
RoR::Actor::ar_linked_actors
ActorPtrVec ar_linked_actors
BEWARE: Includes indirect links, see DetermineLinkedActors(); Other actors linked using 'hooks/ties/r...
Definition: Actor.h:454
RoR::GameContext::m_character_factory
CharacterFactory m_character_factory
Definition: GameContext.h:205
GUI_FrictionSettings.h
RoR::GfxActor::ToggleDebugView
void ToggleDebugView()
Definition: GfxActor.cpp:1568
RoR::EV_COMMON_TOGGLE_TRUCK_FOG_LIGHTS
@ EV_COMMON_TOGGLE_TRUCK_FOG_LIGHTS
toggle truck fog lights (on/off); doesn't need low beams, doesn't use 't' lights.
Definition: InputEngine.h:277
RoR::Actor::ar_instance_id
ActorInstanceID_t ar_instance_id
Static attr; session-unique ID.
Definition: Actor.h:373
z
float z
Definition: (ValueTypes) quaternion.h:7
RoR::Actor::ar_num_nodes
int ar_num_nodes
Definition: Actor.h:290
RoR::Collisions::getSurfaceHeightBelow
float getSurfaceHeightBelow(float x, float z, float height)
Definition: Collisions.cpp:676
RoR::ActorModifyRequest::Type::REFRESH_VISUALS
@ REFRESH_VISUALS
Forces a synchronous update of visuals from any context - i.e. from terrain editor mode or with sleep...
SkyManager.h
RoR::AppState::MAIN_MENU
@ MAIN_MENU
RoR::LT_Skin
@ LT_Skin
Definition: Application.h:319
RoR::GfxScene::RemoveGfxActor
void RemoveGfxActor(RoR::GfxActor *gfx_actor)
Definition: GfxScene.cpp:323
GUI_TopMenubar.h
RoR::GameContext::m_last_section_config
Ogre::String m_last_section_config
Definition: GameContext.h:200
RoR::App::GetAppContext
AppContext * GetAppContext()
Definition: Application.cpp:269
RoR::GUI::TopMenubar::ai_skin2
std::string ai_skin2
Definition: GUI_TopMenubar.h:92
RoR::NODENUM_INVALID
static const NodeNum_t NODENUM_INVALID
Definition: ForwardDeclarations.h:55
RoR::Actor::getFogLightsVisible
bool getFogLightsVisible() const
Definition: Actor.h:196
RoR::GfxActor::CycleDebugViews
void CycleDebugViews()
Definition: GfxActor.cpp:1594
RoR::Actor::toggleWheelDiffMode
void toggleWheelDiffMode()
Definition: Actor.cpp:1318
format
Truck file format(technical spec)
RoR::MSG_SIM_UNPAUSE_REQUESTED
@ MSG_SIM_UNPAUSE_REQUESTED
Definition: Application.h:117
RoR::EV_COMMON_AUTOLOCK
@ EV_COMMON_AUTOLOCK
unlock autolock hook node
Definition: InputEngine.h:226
RoR::GameContext::~GameContext
~GameContext()
Definition: GameContext.cpp:58
RoR::SS_TRIG_BRAKE
@ SS_TRIG_BRAKE
Definition: SoundScriptManager.h:60
RoR::Terrain::getSkyManager
SkyManager * getSkyManager()
Definition: Terrain.cpp:514
RoR::EV_TRUCK_BLINK_WARN
@ EV_TRUCK_BLINK_WARN
toggle all direction indicators
Definition: InputEngine.h:305
RoR::EV_AIRPLANE_AIRBRAKES_NONE
@ EV_AIRPLANE_AIRBRAKES_NONE
Definition: InputEngine.h:80
Terrn2FileFormat.h
RoR::GameContext::UpdateCommonInputEvents
void UpdateCommonInputEvents(float dt)
Definition: GameContext.cpp:1276
RoR::ActorLinkingRequest::alr_type
ActorLinkingRequestType alr_type
Definition: SimData.h:907
RoR::GameContext::GetPlayerCharacter
Character * GetPlayerCharacter()
Definition: GameContext.cpp:893
RoR::CameraManager::NotifyVehicleChanged
void NotifyVehicleChanged(ActorPtr new_vehicle)
Definition: CameraManager.cpp:633
RoR::EV_COMMON_ENTER_PREVIOUS_TRUCK
@ EV_COMMON_ENTER_PREVIOUS_TRUCK
enter previous truck
Definition: InputEngine.h:231
RoR::CVar::getBool
bool getBool() const
Definition: CVar.h:98
RoR::TRIGGER_EVENT_ASYNC
void TRIGGER_EVENT_ASYNC(scriptEvents type, int arg1, int arg2ex=0, int arg3ex=0, int arg4ex=0, std::string arg5ex="", std::string arg6ex="", std::string arg7ex="", std::string arg8ex="")
Asynchronously (via MSG_SIM_SCRIPT_EVENT_TRIGGERED) invoke script function eventCallbackEx(),...
Definition: ScriptEngine.h:51
RoR::Actor::ar_brake
Ogre::Real ar_brake
Physics state; braking intensity.
Definition: Actor.h:396
RoR::ActorManager::FindActorInsideBox
ActorPtr FindActorInsideBox(Collisions *collisions, const Ogre::String &inst, const Ogre::String &box)
Definition: ActorManager.cpp:809
RoR::GameContext::OnLoaderGuiApply
void OnLoaderGuiApply(RoR::LoaderType type, CacheEntryPtr entry, std::string sectionconfig)
GUI callback.
Definition: GameContext.cpp:704
RoR::App::GetOverlayWrapper
OverlayWrapper * GetOverlayWrapper()
Definition: Application.cpp:271
RoR::ActorModifyRequest::Type::RESTORE_SAVED
@ RESTORE_SAVED
RoR::CacheQuery
Definition: CacheSystem.h:182
RoR::CharacterFactory::CreateLocalCharacter
Character * CreateLocalCharacter()
Definition: CharacterFactory.cpp:32
RoR::EV_TRUCK_CRUISE_CONTROL
@ EV_TRUCK_CRUISE_CONTROL
toggle cruise control
Definition: InputEngine.h:309
RoR::ActorLinkingRequestType::HOOK_TOGGLE
@ HOOK_TOGGLE
RoR::LogFormat
void LogFormat(const char *format,...)
Improved logging utility. Uses fixed 2Kb buffer.
Definition: Application.cpp:427
RoR::FlareType::SIDELIGHT
@ SIDELIGHT
RoR::GameContext::m_last_tuneup_selection
CacheEntryPtr m_last_tuneup_selection
Definition: GameContext.h:199
RoR::Collisions::getPosition
Ogre::Vector3 getPosition(const Ogre::String &inst, const Ogre::String &box)
Definition: Collisions.cpp:1133
RoR::Actor::toggleCustomParticles
void toggleCustomParticles()
Definition: Actor.cpp:3160
RoR::Actor::ar_toggle_ropes
bool ar_toggle_ropes
Sim state.
Definition: Actor.h:492
AppContext.h
System integration layer; inspired by OgreBites::ApplicationContext.
Console.h
RoR::Console::putMessage
void putMessage(MessageArea area, MessageType type, std::string const &msg, std::string icon="")
Definition: Console.cpp:103
RoR::GUIManager::GameControls
GUI::GameControls GameControls
Definition: GUIManager.h:127
RoR::ActorLinkingRequestType::HOOK_UNLOCK
@ HOOK_UNLOCK
RoR::EV_COMMON_GET_NEW_VEHICLE
@ EV_COMMON_GET_NEW_VEHICLE
get new vehicle
Definition: InputEngine.h:244
RoR::GameContext::TeleportPlayer
void TeleportPlayer(float x, float z)
Definition: GameContext.cpp:901
RoR::GameContext::UpdateActors
void UpdateActors()
Definition: GameContext.cpp:600
RoR::EV_TRUCK_TOGGLE_FORWARDCOMMANDS
@ EV_TRUCK_TOGGLE_FORWARDCOMMANDS
toggle forwardcommands
Definition: InputEngine.h:364
RoR::Actor::ar_trailer_parking_brake
bool ar_trailer_parking_brake
Definition: Actor.h:412
RoR::EV_TRUCK_TRACTION_CONTROL
@ EV_TRUCK_TRACTION_CONTROL
toggle antilockbrake system
Definition: InputEngine.h:372
RoR::GameContext::RespawnLastActor
void RespawnLastActor()
Definition: GameContext.cpp:611
RoR::LT_Load
@ LT_Load
Definition: Application.h:317
RoR::EV_BOAT_THROTTLE_DOWN
@ EV_BOAT_THROTTLE_DOWN
decrease throttle
Definition: InputEngine.h:108
RoR::LT_Airplane
@ LT_Airplane
Definition: Application.h:314
RoR::ActorManager::FetchPreviousVehicleOnList
const ActorPtr & FetchPreviousVehicleOnList(ActorPtr player, ActorPtr prev_player)
Definition: ActorManager.cpp:977
RoR::ActorSpawnRequest::asr_working_tuneup
TuneupDefPtr asr_working_tuneup
Only filled when editing tuneup via Tuning menu.
Definition: SimData.h:838
RoR::SS_TRIG_PUMP
@ SS_TRIG_PUMP
Definition: SoundScriptManager.h:61
TuneupFileFormat.h
The vehicle tuning system; applies addonparts and user overrides to vehicles.
RoR::App::cli_preset_spawn_rot
CVar * cli_preset_spawn_rot
Definition: Application.cpp:182
RoR::Actor::GetGfxActor
GfxActor * GetGfxActor()
Definition: Actor.h:275
RoR::EV_COMMON_ENTER_NEXT_TRUCK
@ EV_COMMON_ENTER_NEXT_TRUCK
enter next truck
Definition: InputEngine.h:230
RoR::GameContext::m_actor_manager
ActorManager m_actor_manager
Definition: GameContext.h:192
RoR::ModifyProjectRequestType::TUNEUP_USE_ADDONPART_SET
@ TUNEUP_USE_ADDONPART_SET
'subject' is addonpart filename.
RoR::GUI::TopMenubar::ai_waypoints
std::vector< ai_events > ai_waypoints
Definition: GUI_TopMenubar.h:68
RoR::GUIManager::GameSettings
GUI::GameSettings GameSettings
Definition: GUIManager.h:117
RoR::Actor::ar_aerial_flap
int ar_aerial_flap
Sim state; state of aircraft flaps (values: 0-5)
Definition: Actor.h:418
RoR::LT_Car
@ LT_Car
Definition: Application.h:312
RoR::Screwprop::setRudder
void setRudder(float val)
Definition: ScrewProp.cpp:89
RoR::ActorState::LOCAL_SIMULATED
@ LOCAL_SIMULATED
simulated (local) actor
RoR::App::sim_state
CVar * sim_state
Definition: Application.cpp:96
Engine.h
RoR::CacheEntry::sectionconfigs
std::vector< Ogre::String > sectionconfigs
Definition: CacheSystem.h:142
RoR::CameraManager::GetCameraNode
Ogre::SceneNode * GetCameraNode()
Definition: CameraManager.h:63
Utils.h
RoR::ActorSpawnRequest::asr_filename
std::string asr_filename
Can be in "Bundle-qualified" format, i.e. "mybundle.zip:myactor.truck".
Definition: SimData.h:831
RoR::NOT_DRIVEABLE
@ NOT_DRIVEABLE
not drivable at all
Definition: SimData.h:92
RoR::GUI::MainSelector::Show
void Show(LoaderType type, std::string const &filter_guid="", CacheEntryPtr advertised_entry=nullptr)
Definition: GUI_MainSelector.cpp:65
smoothValue
void smoothValue(float &ref, float value, float rate)
Definition: GameContext.cpp:1541
RoR::EV_COMMON_FULLSCREEN_TOGGLE
@ EV_COMMON_FULLSCREEN_TOGGLE
Definition: InputEngine.h:237
RoR::EV_AIRPLANE_RUDDER_LEFT
@ EV_AIRPLANE_RUDDER_LEFT
rudder left
Definition: InputEngine.h:90
RoR::Actor::displayAxleDiffMode
void displayAxleDiffMode()
Cycles through the available inter axle diff modes.
Definition: Actor.cpp:1334
RoR::Terrn2DocumentPtr
std::shared_ptr< Terrn2Document > Terrn2DocumentPtr
Definition: ForwardDeclarations.h:217
RoR::GameContextSB::simbuf_player_actor
ActorPtr simbuf_player_actor
Definition: SimBuffers.h:203
RoR::Actor::ar_dashboard
DashBoardManager * ar_dashboard
Definition: Actor.h:430
RoR::Actor::tractioncontrolToggle
void tractioncontrolToggle()
Definition: Actor.cpp:3742
RoR::CacheEntry::description
Ogre::String description
Definition: CacheSystem.h:105
RoR::LT_Extension
@ LT_Extension
Definition: Application.h:318
RoR::CacheQueryResult::cqr_entry
CacheEntryPtr cqr_entry
Definition: CacheSystem.h:168
RoR::InputEngine::getEventBoolValueBounce
bool getEventBoolValueBounce(int eventID, float time=0.2f)
Definition: InputEngine.cpp:765
RoR::collision_box_t
Definition: SimData.h:695
RoR::Engine::setAutoMode
void setAutoMode(SimGearboxMode mode)
Definition: Engine.cpp:847
RefCountingObjectPtr< CacheEntry >
RoR::MSG_APP_DISPLAY_WINDOWED_REQUESTED
@ MSG_APP_DISPLAY_WINDOWED_REQUESTED
Definition: Application.h:88
RoR::InputEngine::getEventValue
float getEventValue(int eventID, bool pure=false, InputSourceType valueSource=InputSourceType::IST_ANY)
valueSource: IST_ANY=digital and analog devices, IST_DIGITAL=only digital, IST_ANALOG=only analog
Definition: InputEngine.cpp:961
RoR::Actor::beaconsToggle
void beaconsToggle()
Definition: Actor.cpp:3751
RoR::ActorSpawnRequest::Origin::SAVEGAME
@ SAVEGAME
User spawned and part of a savegame.
RoR::SE_TRUCK_EXIT
@ SE_TRUCK_EXIT
triggered when switching from vehicle mode to person mode, the argument refers to the actor ID of the...
Definition: ScriptEvents.h:36
RoR::Console::CONSOLE_SYSTEM_ERROR
@ CONSOLE_SYSTEM_ERROR
Definition: Console.h:52
GUIManager.h
RoR::App::diag_preset_spawn_rot
CVar * diag_preset_spawn_rot
Definition: Application.cpp:142
RoR::Actor::ar_forward_commands
bool ar_forward_commands
Sim state.
Definition: Actor.h:490
RoR::Actor::ar_left_mirror_angle
float ar_left_mirror_angle
Sim state; rear view mirror angle.
Definition: Actor.h:413
RoR::AeroEngine::toggleReverse
virtual void toggleReverse()=0
RoR::GfxActor::SetVideoCamState
void SetVideoCamState(VideoCamState state)
Definition: GfxActor.cpp:442
Actor.h
RoR::EV_AIRPLANE_REVERSE
@ EV_AIRPLANE_REVERSE
reverse the turboprops
Definition: InputEngine.h:89
RoR::GUI::TopMenubar::ai_menu
bool ai_menu
Definition: GUI_TopMenubar.h:85
RoR::Actor::ar_right_mirror_angle
float ar_right_mirror_angle
Sim state; rear view mirror angle.
Definition: Actor.h:414
RoR::GUI::FrictionSettings::AnalyzeTerrain
void AnalyzeTerrain()
Definition: GUI_FrictionSettings.cpp:139
RoR::Console::CONSOLE_SYSTEM_NOTICE
@ CONSOLE_SYSTEM_NOTICE
Definition: Console.h:51
RoR::GUIManager::RepositorySelector
GUI::RepositorySelector RepositorySelector
Definition: GUIManager.h:128
RoR::ActorSpawnRequest
Definition: SimData.h:813
RoR::SkyXManager::GetSkyX
SkyX::SkyX * GetSkyX()
Definition: SkyXManager.h:52
RoR::Actor::SoftReset
void SoftReset()
Definition: Actor.cpp:1544
RoR::SimGearboxMode::AUTO
@ AUTO
Automatic shift.
RoR::AeroEngine::flipStart
virtual void flipStart()=0
RoR::App::sim_tuning_enabled
CVar * sim_tuning_enabled
Definition: Application.cpp:112
RoR::MSG_APP_DISPLAY_FULLSCREEN_REQUESTED
@ MSG_APP_DISPLAY_FULLSCREEN_REQUESTED
Definition: Application.h:87
RoR::AppContext::GetForceFeedback
RoR::ForceFeedback & GetForceFeedback()
Definition: AppContext.h:68
RoR::GameContext::SpawnActor
ActorPtr SpawnActor(ActorSpawnRequest &rq)
Definition: GameContext.cpp:193
RoR::Terrain::GetHeightAt
float GetHeightAt(float x, float z)
Definition: Terrain.cpp:504
RoR::LT_Boat
@ LT_Boat
Definition: Application.h:313
RoR::App::mp_state
CVar * mp_state
Definition: Application.cpp:115
RoR::EV_AIRPLANE_FLAPS_MORE
@ EV_AIRPLANE_FLAPS_MORE
one step more flaps.
Definition: InputEngine.h:86
Replay.h
RoR::ActorModifyRequest::amr_actor
ActorInstanceID_t amr_actor
Definition: SimData.h:871
RoR::Actor::getReplay
Replay * getReplay()
Definition: Actor.cpp:4516
RoR::GameContext::UpdateGlobalInputEvents
void UpdateGlobalInputEvents()
Definition: GameContext.cpp:939
RoR::EV_TRUCK_STEER_LEFT
@ EV_TRUCK_STEER_LEFT
steer left
Definition: InputEngine.h:360
RoR::VideoCamState::VCSTATE_ENABLED_OFFLINE
@ VCSTATE_ENABLED_OFFLINE
RoR::ActorModifyRequest::Type::RESET_ON_INIT_POS
@ RESET_ON_INIT_POS
RoR::GUI::GameAbout::SetVisible
void SetVisible(bool v)
Definition: GUI_GameAbout.cpp:156
RoR::LT_Truck
@ LT_Truck
Definition: Application.h:311
RoR::GfxActor::GetVideoCamState
VideoCamState GetVideoCamState() const
Definition: GfxActor.h:143
RoR::ActorSpawnRequest::asr_config
Ogre::String asr_config
Definition: SimData.h:832
RoR::EV_BOAT_THROTTLE_UP
@ EV_BOAT_THROTTLE_UP
increase throttle
Definition: InputEngine.h:109
RoR::Actor::ar_aeroengines
AeroEngine * ar_aeroengines[MAX_AEROENGINES]
Definition: Actor.h:333
RoR::GameContext::m_msg_chain_end
Message * m_msg_chain_end
Definition: GameContext.h:185
RoR::VehicleAI::isActive
bool isActive()
Returns the status of the AI.
Definition: VehicleAI.cpp:58
ScrewProp.h
RoR::CameraManager::GetCamera
Ogre::Camera * GetCamera()
Definition: CameraManager.h:64
RoR::Actor::ar_screwprops
Screwprop * ar_screwprops[MAX_SCREWPROPS]
Definition: Actor.h:335
RoR::EV_TRUCK_TRAILER_PARKING_BRAKE
@ EV_TRUCK_TRAILER_PARKING_BRAKE
toggle trailer parking brake
Definition: InputEngine.h:330
RoR::ActorManager::UpdateSleepingState
void UpdateSleepingState(ActorPtr player_actor, float dt)
Definition: ActorManager.cpp:740
RoR::GameContext::ChainMessage
void ChainMessage(Message m)
Add to last pushed message's chain.
Definition: GameContext.cpp:73
RoR::EV_AIRPLANE_AIRBRAKES_LESS
@ EV_AIRPLANE_AIRBRAKES_LESS
Definition: InputEngine.h:78
RoR::EV_COMMON_CYCLE_TRUCK_LIGHTS
@ EV_COMMON_CYCLE_TRUCK_LIGHTS
cycle truck front light mode (off -> running light -> low beams -> off).
Definition: InputEngine.h:274
RoR::ActorModifyRequest::amr_softrespawn_rotation
Ogre::Quaternion amr_softrespawn_rotation
Rotation to use with SOFT_RESPAWN; use TObjParser::CalcRotation() to calculate quaternion from XYZ li...
Definition: SimData.h:878
RoR::GUI::TopMenubar::ai_dname2
Ogre::String ai_dname2
Definition: GUI_TopMenubar.h:90
RoR::GameContext::m_current_selection
ActorSpawnRequest m_current_selection
Context of the loader UI.
Definition: GameContext.h:201
RoR::GfxSkyMode::CAELUM
@ CAELUM
Caelum (best looking, slower)
RoR::Actor::ar_num_aeroengines
int ar_num_aeroengines
Definition: Actor.h:334
RoR::Actor::getMinHeight
float getMinHeight(bool skip_virtual_nodes=true)
Definition: Actor.cpp:1479
RoR::GUIManager::MultiplayerSelector
GUI::MultiplayerSelector MultiplayerSelector
Definition: GUIManager.h:121
RoR::Actor::ar_airbrake_intensity
int ar_airbrake_intensity
Physics state; values 0-5.
Definition: Actor.h:424
RoR::Str< 200 >
RoR::CacheSystem::FindEntryByFilename
CacheEntryPtr FindEntryByFilename(RoR::LoaderType type, bool partial, const std::string &_filename_maybe_bundlequalified)
Returns NULL if none found; "Bundle-qualified" format also specifies the ZIP/directory in modcache,...
Definition: CacheSystem.cpp:184
RoR::EV_BOAT_REVERSE
@ EV_BOAT_REVERSE
no thrust
Definition: InputEngine.h:102
RoR::Actor::ar_engine
EnginePtr ar_engine
Definition: Actor.h:376
RoR::GUI::RepositorySelector::SetVisible
void SetVisible(bool visible)
Definition: GUI_RepositorySelector.cpp:1238
RoR::GameContext::LoadTerrain
bool LoadTerrain(std::string const &filename_part)
Definition: GameContext.cpp:112
RoR::ActorModifyRequest
Definition: SimData.h:853
RoR::GameContext::PopMessage
Message PopMessage()
Definition: GameContext.cpp:96
RoR::MSG_SIM_SEAT_PLAYER_REQUESTED
@ MSG_SIM_SEAT_PLAYER_REQUESTED
Payload = RoR::ActorPtr (owner) | nullptr.
Definition: Application.h:124
RoR::EV_TRUCK_LIGHTTOGGLE01
@ EV_TRUCK_LIGHTTOGGLE01
toggle custom light 1
Definition: InputEngine.h:316
CacheSystem.h
A database of user-installed content alias 'mods' (vehicles, terrains...)
RoR::GameContext::m_player_actor
ActorPtr m_player_actor
Actor (vehicle or machine) mounted and controlled by player.
Definition: GameContext.h:193
RoR::Collisions::getBox
collision_box_t * getBox(const Ogre::String &inst, const Ogre::String &box)
Definition: Collisions.cpp:1157
RoR::EV_TRUCK_LEFT_MIRROR_LEFT
@ EV_TRUCK_LEFT_MIRROR_LEFT
Definition: InputEngine.h:314
RoR::ActorSpawnRequest::asr_tuneup_entry
CacheEntryPtr asr_tuneup_entry
Only filled when user selected a saved/downloaded .tuneup mod in SelectorUI.
Definition: SimData.h:837
RoR::EV_COMMON_RESPAWN_LAST_TRUCK
@ EV_COMMON_RESPAWN_LAST_TRUCK
respawn last truck
Definition: InputEngine.h:233
RoR::GameContext::ChangePlayerActor
void ChangePlayerActor(ActorPtr actor)
Definition: GameContext.cpp:487
BITMASK_IS_1
#define BITMASK_IS_1(VAR, FLAGS)
Definition: BitFlags.h:14
GUI_MainSelector.h
RoR::Actor::resolveCollisions
void resolveCollisions(Ogre::Vector3 direction)
Moves the actor at most 'direction.length()' meters towards 'direction' to resolve any collisions.
Definition: Actor.cpp:1019
RoR::DashBoardManager::setVisible3d
void setVisible3d(bool visibility)
Definition: DashBoardManager.cpp:226
RoR::GameContext::GameContext
GameContext()
Definition: GameContext.cpp:53
RoR::ActorSpawnRequest::asr_cache_entry
CacheEntryPtr asr_cache_entry
Optional, overrides 'asr_filename' and 'asr_cache_entry_num'.
Definition: SimData.h:830
RoR::CacheQueryResult
Definition: CacheSystem.h:162
ScriptEngine.h
RoR::Actor::getTyrePressure
TyrePressure & getTyrePressure()
Definition: Actor.h:225
RoR::GameContext::DeleteActor
void DeleteActor(ActorPtr actor)
Definition: GameContext.cpp:438
RoR::GameContext::PushMessage
void PushMessage(Message m)
Doesn't guarantee order! Use ChainMessage() if order matters.
Definition: GameContext.cpp:66
RoR::App::app_state
CVar * app_state
Definition: Application.cpp:79
RoR::ActorManager::GetLocalActors
std::vector< ActorPtr > GetLocalActors()
Definition: ActorManager.cpp:1322
RoR::EV_AIRPLANE_TOGGLE_ENGINES
@ EV_AIRPLANE_TOGGLE_ENGINES
switch all engines on / off
Definition: InputEngine.h:100
RoR::Character
Definition: Character.h:40
RoR::Actor::getSectionConfig
Ogre::String getSectionConfig()
Definition: Actor.h:236
RoR::Str::ToCStr
const char * ToCStr() const
Definition: Str.h:46
RoR::SS_TRIG_AIR
@ SS_TRIG_AIR
Definition: SoundScriptManager.h:68
RoR::ActorState::LOCAL_SLEEPING
@ LOCAL_SLEEPING
sleeping (local) actor
RoR::Autopilot::disconnect
void disconnect()
Definition: AutoPilot.cpp:70
RoR::Actor::setFogLightsVisible
void setFogLightsVisible(bool val)
Definition: Actor.h:197
RoR::Actor::SyncReset
void SyncReset(bool reset_position)
this one should be called only synchronously (without physics running in background)
Definition: Actor.cpp:1568
RoR::Actor::antilockbrakeToggle
void antilockbrakeToggle()
Definition: Actor.cpp:3733
RoR::EV_SKY_INCREASE_TIME
@ EV_SKY_INCREASE_TIME
increase day-time
Definition: InputEngine.h:112
RoR::Actor::ar_hydro_speed_coupling
bool ar_hydro_speed_coupling
Definition: Actor.h:486
RoR::Actor::getHeadlightsVisible
bool getHeadlightsVisible() const
Definition: Actor.h:192
RoR::SE_TRUCK_ENTER
@ SE_TRUCK_ENTER
triggered when switching from person mode to vehicle mode, the argument refers to the actor ID of the...
Definition: ScriptEvents.h:35
RoR::Actor::ar_command_key
CmdKeyArray ar_command_key
BEWARE: commandkeys are indexed 1-MAX_COMMANDS!
Definition: Actor.h:311
RoR::Autopilot::wantsdisconnect
bool wantsdisconnect
Definition: AutoPilot.h:54
RoR::CacheEntry::skin_def
SkinDocumentPtr skin_def
Cached skin info, added on first use or during cache rebuild.
Definition: CacheSystem.h:92
RoR::Terrain::GetCollisions
Collisions * GetCollisions()
Definition: Terrain.h:82
RoR::EV_BOAT_STEER_LEFT
@ EV_BOAT_STEER_LEFT
steer left a step
Definition: InputEngine.h:103
RoR::Actor::getPosition
Ogre::Vector3 getPosition()
Definition: Actor.cpp:371
RoR::GameContext::m_last_cache_selection
CacheEntryPtr m_last_cache_selection
Vehicle/load.
Definition: GameContext.h:197
RoR::EV_TRUCK_TOGGLE_TCASE_4WD_MODE
@ EV_TRUCK_TOGGLE_TCASE_4WD_MODE
toggle the transfer case 4wd mode
Definition: InputEngine.h:369
RoR::Actor::hookToggle
void hookToggle(int group=-1, ActorLinkingRequestType mode=ActorLinkingRequestType::HOOK_TOGGLE, NodeNum_t mousenode=NODENUM_INVALID, ActorInstanceID_t forceunlock_filter=ACTORINSTANCEID_INVALID)
Definition: Actor.cpp:3580
GfxScene.h
SkyX::SkyX::setTimeMultiplier
void setTimeMultiplier(const Ogre::Real &TimeMultiplier)
Set time multiplier.
Definition: SkyX.h:166
RoR::GameContext::SetPrevPlayerActor
void SetPrevPlayerActor(ActorPtr actor)
Definition: GameContext.cpp:835
RoR::EV_TRUCK_TOGGLE_VIDEOCAMERA
@ EV_TRUCK_TOGGLE_VIDEOCAMERA
toggle videocamera update
Definition: InputEngine.h:371
RoR::BLINK_RIGHT
@ BLINK_RIGHT
Definition: SimData.h:125
RoR::MSG_GUI_OPEN_SELECTOR_REQUESTED
@ MSG_GUI_OPEN_SELECTOR_REQUESTED
Payload = LoaderType* (owner), Description = GUID | empty.
Definition: Application.h:139
RoR::BLINK_WARN
@ BLINK_WARN
Definition: SimData.h:126
SOUND_START
#define SOUND_START(_ACTOR_, _TRIG_)
Definition: SoundScriptManager.h:35
RoR::LT_Vehicle
@ LT_Vehicle
Definition: Application.h:310
RoR::GameContext::prev_pos
Ogre::Vector3 prev_pos
Definition: GameContext.h:212
RoR::LT_Trailer
@ LT_Trailer
Definition: Application.h:315
RoR::MSG_SIM_HIDE_NET_ACTOR_REQUESTED
@ MSG_SIM_HIDE_NET_ACTOR_REQUESTED
Payload = ActorPtr* (owner)
Definition: Application.h:126
RoR::LoaderType
LoaderType
< Search mode for ModCache::Query() & Operation mode for GUI::MainSelector
Definition: Application.h:306
RoR::MSG_GUI_REFRESH_TUNING_MENU_REQUESTED
@ MSG_GUI_REFRESH_TUNING_MENU_REQUESTED
Definition: Application.h:146
RoR::InputEngine::isEventDefined
bool isEventDefined(int eventID)
Definition: InputEngine.cpp:911
RoR::OverlayWrapper::showDashboardOverlays
void showDashboardOverlays(bool show, ActorPtr actor)
Definition: OverlayWrapper.cpp:375
RoR::ModifyProjectRequest::mpr_target_actor
ActorPtr mpr_target_actor
Definition: CacheSystem.h:267
RoR::InputEngine::getEventBoolValue
bool getEventBoolValue(int eventID)
Definition: InputEngine.cpp:760
RoR::GUI::TopMenubar::ai_skin
std::string ai_skin
Definition: GUI_TopMenubar.h:81
RoR::SimState::PAUSED
@ PAUSED
RoR::Actor::ar_import_commands
bool ar_import_commands
Sim state.
Definition: Actor.h:491
RoR::Screwprop::setThrottle
void setThrottle(float val)
Definition: ScrewProp.cpp:76
RoR::App::GetConsole
Console * GetConsole()
Definition: Application.cpp:273
RoR::EV_COMMON_LOCK
@ EV_COMMON_LOCK
connect hook node to a node in close proximity
Definition: InputEngine.h:240
RoR::EV_COMMON_TRUCK_REMOVE
@ EV_COMMON_TRUCK_REMOVE
Definition: InputEngine.h:280
RoR::EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF
@ EV_TRUCK_TOGGLE_INTER_WHEEL_DIFF
toggle the inter wheel differential mode
Definition: InputEngine.h:367
SoundScriptManager.h
RoR::Message::payload
void * payload
Definition: GameContext.h:59
RoR::Network::GetLocalUserData
RoRnet::UserInfo GetLocalUserData()
Definition: Network.cpp:703
RoR::App::GetGameContext
GameContext * GetGameContext()
Definition: Application.cpp:283
RoR::EV_BOAT_CENTER_RUDDER
@ EV_BOAT_CENTER_RUDDER
center the rudder
Definition: InputEngine.h:101
RoR::MSG_APP_SCREENSHOT_REQUESTED
@ MSG_APP_SCREENSHOT_REQUESTED
Definition: Application.h:86
RoR::Character::getPosition
Ogre::Vector3 getPosition()
Definition: Character.cpp:92
RoR::AIRPLANE
@ AIRPLANE
its an airplane
Definition: SimData.h:94
RoR::Actor::ar_autopilot
Autopilot * ar_autopilot
Definition: Actor.h:379
RoR::Actor::getSideLightsVisible
bool getSideLightsVisible() const
Definition: Actor.h:190
RoR::EV_AIRPLANE_AIRBRAKES_MORE
@ EV_AIRPLANE_AIRBRAKES_MORE
Definition: InputEngine.h:79
RoR::EV_AIRPLANE_FLAPS_FULL
@ EV_AIRPLANE_FLAPS_FULL
full flaps in an aircraft.
Definition: InputEngine.h:84
RoR::EV_TRUCK_HORN
@ EV_TRUCK_HORN
truck horn
Definition: InputEngine.h:313
RoR::GUI::FlexbodyDebug::AnalyzeFlexbodies
void AnalyzeFlexbodies()
populates the combobox
Definition: GUI_FlexbodyDebug.cpp:175
RoR::AppState::SIMULATION
@ SIMULATION
RoR::Actor::ar_sleep_counter
float ar_sleep_counter
Sim state; idle time counter.
Definition: Actor.h:409
RoR::Message::chain
std::vector< Message > chain
Posted after the message is processed.
Definition: GameContext.h:60
RoR::EV_BOAT_THROTTLE_AXIS
@ EV_BOAT_THROTTLE_AXIS
throttle axis. Only use this if you have fitting hardware :) (i.e. a Slider)
Definition: InputEngine.h:107
RoR::Actor::getHeightAboveGroundBelow
float getHeightAboveGroundBelow(float height, bool skip_virtual_nodes=true)
Definition: Actor.cpp:1519
RoR::Actor::ar_num_screwprops
int ar_num_screwprops
Definition: Actor.h:336
RoR::EV_COMMON_SECURE_LOAD
@ EV_COMMON_SECURE_LOAD
tie a load to the truck
Definition: InputEngine.h:263
SOUND_STOP
#define SOUND_STOP(_ACTOR_, _TRIG_)
Definition: SoundScriptManager.h:36
RoR::ActorSpawnRequest::net_stream_id
int net_stream_id
Definition: SimData.h:845
RoR::Terrain::dispose
void dispose()
Definition: Terrain.cpp:79
RoR::BLINK_LEFT
@ BLINK_LEFT
Definition: SimData.h:124
RoR::ActorSpawnRequest::Origin::TERRN_DEF
@ TERRN_DEF
Preloaded with terrain.
RoR::Engine::DRIVE
@ DRIVE
Definition: Engine.h:171
RoR::Screwprop::getRudder
float getRudder()
Definition: ScrewProp.cpp:106
RoR::ActorSpawnRequest::asr_terrn_machine
bool asr_terrn_machine
This is a fixed machinery.
Definition: SimData.h:848
RoR::EV_COMMON_TOGGLE_TERRAIN_EDITOR
@ EV_COMMON_TOGGLE_TERRAIN_EDITOR
toggle terrain editor
Definition: InputEngine.h:267
RoR::ActorModifyRequest::amr_softrespawn_position
Ogre::Vector3 amr_softrespawn_position
Position to use with SOFT_RESPAWN.
Definition: SimData.h:877
RoR::ActorSpawnRequest::asr_skin_entry
CacheEntryPtr asr_skin_entry
Definition: SimData.h:836
RoR::EV_COMMON_TOGGLE_TRUCK_LOW_BEAMS
@ EV_COMMON_TOGGLE_TRUCK_LOW_BEAMS
toggle truck low beams (on/off); also toggles running lights.
Definition: InputEngine.h:275
RoR::Collisions::getSurfaceHeight
float getSurfaceHeight(float x, float z)
Definition: Collisions.cpp:671
RoR::GameContext::m_timer
Ogre::Timer m_timer
Definition: GameContext.h:211
RoR::VideoCamState::VCSTATE_DISABLED
@ VCSTATE_DISABLED
RoR::ActorSpawnRequest::Origin::AI
@ AI
Script controlled.
RoR::ActorModifyRequest::amr_saved_state
std::shared_ptr< rapidjson::Document > amr_saved_state
Definition: SimData.h:874
RoR::App::gfx_sky_mode
CVar * gfx_sky_mode
Definition: Application.cpp:219
RoR::Actor::toggleSlideNodeLock
void toggleSlideNodeLock()
Definition: ActorSlideNode.cpp:34
RoR::GUIManager::TopMenubar
GUI::TopMenubar TopMenubar
Definition: GUIManager.h:131
RoR::GameContext::m_msg_queue
GameMsgQueue m_msg_queue
Definition: GameContext.h:184
RoR::GUI::TopMenubar::ai_sectionconfig2
Ogre::String ai_sectionconfig2
Definition: GUI_TopMenubar.h:91
RoR::MSG_EDI_ENTER_TERRN_EDITOR_REQUESTED
@ MSG_EDI_ENTER_TERRN_EDITOR_REQUESTED
Definition: Application.h:150
RoR::SS_TRIG_HORN
@ SS_TRIG_HORN
Definition: SoundScriptManager.h:59
RoR::GUIManager::ShowMessageBox
void ShowMessageBox(const char *title, const char *text, bool allow_close=true, const char *btn1_text="OK", const char *btn2_text=nullptr)
Definition: GUIManager.cpp:454
RoR::ModifyProjectRequest
Definition: CacheSystem.h:265
RoR::Actor::GetCameraRoll
Ogre::Vector3 GetCameraRoll()
Definition: Actor.h:273
RoR::CharacterFactory::GetLocalCharacter
Character * GetLocalCharacter()
Definition: CharacterFactory.h:44
RoR::LT_Terrain
@ LT_Terrain
Definition: Application.h:309
RoR::Actor::toggleTransferCaseMode
void toggleTransferCaseMode()
Definition: Actor.cpp:1402
RoR::Actor::parkingbrakeToggle
void parkingbrakeToggle()
Definition: Actor.cpp:3718
RoR::EV_COMMANDS_01
@ EV_COMMANDS_01
Command 1.
Definition: InputEngine.h:139
RoR::App::diag_preset_spawn_pos
CVar * diag_preset_spawn_pos
Definition: Application.cpp:141
RoR::ActorManager::DeleteActorInternal
void DeleteActorInternal(ActorPtr actor)
Do not call directly; use GameContext::DeleteActor()
Definition: ActorManager.cpp:871
RoR::Actor::ar_is_police
bool ar_is_police
Gfx/sfx attr.
Definition: Actor.h:488
RoR::Terrain
Definition: Terrain.h:39
RoR::App::GetCacheSystem
CacheSystem * GetCacheSystem()
Definition: Application.cpp:275
RoR::GfxSkyMode::SKYX
@ SKYX
SkyX (best looking, slower)
RoR::EV_TRUCK_TOGGLE_TCASE_GEAR_RATIO
@ EV_TRUCK_TOGGLE_TCASE_GEAR_RATIO
toggle the transfer case gear ratio
Definition: InputEngine.h:370
RoR::App::gfx_sky_time_speed
CVar * gfx_sky_time_speed
Definition: Application.cpp:221
RoR::Actor::ar_elevator
float ar_elevator
Sim state; aerial controller.
Definition: Actor.h:415
RoR::GameContext::UpdateAirplaneInputEvents
void UpdateAirplaneInputEvents(float dt)
Definition: GameContext.cpp:1558
RoRnet::UserInfo::colournum
int32_t colournum
colour set by server
Definition: RoRnet.h:183
RoR::GUIManager::FlexbodyDebug
GUI::FlexbodyDebug FlexbodyDebug
Definition: GUIManager.h:135
RoR::Replay::UpdateInputEvents
void UpdateInputEvents()
Definition: Replay.cpp:251
RoR::Actor::ar_nodes
node_t * ar_nodes
Definition: Actor.h:285
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
RoRnet::UserInfo::username
char username[RORNET_MAX_USERNAME_LEN]
the nickname of the user (UTF-8)
Definition: RoRnet.h:185
RoR::ActorModifyRequest::Type::SOFT_RESPAWN
@ SOFT_RESPAWN
Like hard reset, but positions the actor like spawn process does - using the relative positions from ...
RoR::EV_AIRPLANE_FLAPS_NONE
@ EV_AIRPLANE_FLAPS_NONE
no flaps.
Definition: InputEngine.h:87
RoR::Actor::ar_toggle_ties
bool ar_toggle_ties
Sim state.
Definition: Actor.h:493
RoR::EV_SKY_DECREASE_TIME
@ EV_SKY_DECREASE_TIME
decrease day-time
Definition: InputEngine.h:110
RoR::Actor::getRotation
float getRotation()
Definition: Actor.cpp:356
RoR::EV_AIRPLANE_STEER_RIGHT
@ EV_AIRPLANE_STEER_RIGHT
steer right
Definition: InputEngine.h:93
RoR::VideoCamState::VCSTATE_ENABLED_ONLINE
@ VCSTATE_ENABLED_ONLINE
RoR::CacheQuery::cqy_filter_type
RoR::LoaderType cqy_filter_type
Definition: CacheSystem.h:184
RoR::EV_AIRPLANE_FLAPS_LESS
@ EV_AIRPLANE_FLAPS_LESS
one step less flaps.
Definition: InputEngine.h:85
RoR::Terrain::initialize
bool initialize()
Definition: Terrain.cpp:146
RoR::Actor::toggleBlinkType
void toggleBlinkType(BlinkType blink)
Definition: Actor.cpp:3056
RoR::GfxEnvmap::UpdateEnvMap
void UpdateEnvMap(Ogre::Vector3 center, GfxActor *gfx_actor, bool full=false)
Definition: EnvironmentMap.cpp:206
RoR::GameContext::FetchPrevVehicleOnList
const ActorPtr & FetchPrevVehicleOnList()
Definition: GameContext.cpp:590
RoR::Engine::UpdateInputEvents
void UpdateInputEvents(float dt)
Definition: Engine.cpp:1260
RoR::CacheSystem::LoadResource
void LoadResource(CacheEntryPtr &t)
Loads the associated resource bundle if not already done.
Definition: CacheSystem.cpp:1440
RoR::GameContext::OnLoaderGuiCancel
void OnLoaderGuiCancel()
GUI callback.
Definition: GameContext.cpp:688
ai_events
Definition: GUI_TopMenubar.h:37
RoR::MSG_SIM_ACTOR_LINKING_REQUESTED
@ MSG_SIM_ACTOR_LINKING_REQUESTED
Payload = RoR::ActorLinkingRequest* (owner)
Definition: Application.h:132
RoR::Message
Unified game event system - all requests and state changes are reported using a message.
Definition: GameContext.h:51
RoR::Actor::ar_hydro_dir_command
float ar_hydro_dir_command
Definition: Actor.h:400
RoR::Actor::ar_driveable
ActorType ar_driveable
Sim attr; marks vehicle type and features.
Definition: Actor.h:375
RoR::EV_AIRPLANE_THROTTLE_FULL
@ EV_AIRPLANE_THROTTLE_FULL
full thrust
Definition: InputEngine.h:97
RoR::GameContext::UnloadTerrain
void UnloadTerrain()
Definition: GameContext.cpp:179
RoR::SE_TRUCK_TELEPORT
@ SE_TRUCK_TELEPORT
triggered when the user teleports the truck, the argument refers to the actor ID of the vehicle
Definition: ScriptEvents.h:51
RoR::CVar::setVal
void setVal(T val)
Definition: CVar.h:72
RoR::InputSourceType::IST_DIGITAL
@ IST_DIGITAL
RoR::MSG_GUI_OPEN_MENU_REQUESTED
@ MSG_GUI_OPEN_MENU_REQUESTED
Definition: Application.h:137
_L
#define _L
Definition: ErrorUtils.cpp:34
RoR::GameContext::m_prev_player_actor
ActorPtr m_prev_player_actor
Previous actor (vehicle or machine) mounted and controlled by player.
Definition: GameContext.h:194
RoR::EV_TRUCK_STEER_RIGHT
@ EV_TRUCK_STEER_RIGHT
steer right
Definition: InputEngine.h:361
RoR::Actor::UpdatePropAnimInputEvents
void UpdatePropAnimInputEvents()
Definition: Actor.cpp:4637
RoR::EV_COMMON_TOGGLE_TRUCK_HIGH_BEAMS
@ EV_COMMON_TOGGLE_TRUCK_HIGH_BEAMS
toggle truck high beams (on/off); doesn't need low beams, doesn't use 't' lights.
Definition: InputEngine.h:276
RoR::Actor::getUsedSkinEntry
CacheEntryPtr & getUsedSkinEntry()
Definition: Actor.cpp:4669
RoR::Terrain::getSpawnPos
Ogre::Vector3 getSpawnPos()
Definition: Terrain.cpp:584
RoR::Actor::getHighBeamsVisible
bool getHighBeamsVisible() const
Definition: Actor.h:194
RoR::ActorModifyRequest::Type::SOFT_RESET
@ SOFT_RESET
RoR::CacheEntry::terrn2_def
Terrn2DocumentPtr terrn2_def
Cached terrain definition document.
Definition: CacheSystem.h:95
RoR::Terrain::getSkyXManager
SkyXManager * getSkyXManager()
Definition: Terrain.h:79
RoR::Actor::tieToggle
void tieToggle(int group=-1, ActorLinkingRequestType mode=ActorLinkingRequestType::TIE_TOGGLE, ActorInstanceID_t forceunlock_filter=ACTORINSTANCEID_INVALID)
Definition: Actor.cpp:3386
RoR::Screwprop::getThrottle
float getThrottle()
Definition: ScrewProp.cpp:98
RoR::ActorSpawnRequest::asr_net_username
Ogre::UTFString asr_net_username
Definition: SimData.h:841
RoR::GfxActor::SetRenderdashActive
void SetRenderdashActive(bool active)
Definition: GfxActor.cpp:2397
RoR::EV_TRUCK_TOGGLE_PHYSICS
@ EV_TRUCK_TOGGLE_PHYSICS
toggle physics simulation
Definition: InputEngine.h:368
RoR::ActorSpawnRequest::asr_debugview
int asr_debugview
Definition: SimData.h:840
RoR::EV_TRUCK_TOGGLE_INTER_AXLE_DIFF
@ EV_TRUCK_TOGGLE_INTER_AXLE_DIFF
toggle the inter axle differential mode
Definition: InputEngine.h:366
RoR::EV_AIRPLANE_THROTTLE_NO
@ EV_AIRPLANE_THROTTLE_NO
no thrust
Definition: InputEngine.h:98
RoR::App::cli_preset_spawn_pos
CVar * cli_preset_spawn_pos
Definition: Application.cpp:181
RoR::GUIManager::GameAbout
GUI::GameAbout GameAbout
Definition: GUIManager.h:116
RoR::Actor::getRotationCenter
Ogre::Vector3 getRotationCenter()
Definition: Actor.cpp:1461
RoR::Actor::toggleTransferCaseGearRatio
void toggleTransferCaseGearRatio()
Definition: Actor.cpp:1433
RoR::MSG_SIM_SPAWN_ACTOR_REQUESTED
@ MSG_SIM_SPAWN_ACTOR_REQUESTED
Payload = RoR::ActorSpawnRequest* (owner)
Definition: Application.h:121
RoR::Character::SetActorCoupling
void SetActorCoupling(bool enabled, ActorPtr actor)
Definition: Character.cpp:523
RoR::Collisions::getDirection
Ogre::Quaternion getDirection(const Ogre::String &inst, const Ogre::String &box)
Definition: Collisions.cpp:1145
RoR::EV_TRUCK_TOGGLE_IMPORTCOMMANDS
@ EV_TRUCK_TOGGLE_IMPORTCOMMANDS
toggle importcommands
Definition: InputEngine.h:365
RoR::App::GetInputEngine
InputEngine * GetInputEngine()
Definition: Application.cpp:274
RoR::EV_SKY_DECREASE_TIME_FAST
@ EV_SKY_DECREASE_TIME_FAST
decrease day-time a lot faster
Definition: InputEngine.h:111
RoR::ActorPtr
RefCountingObjectPtr< Actor > ActorPtr
Definition: ForwardDeclarations.h:219
RoR::GameContext::m_terrain
TerrainPtr m_terrain
Definition: GameContext.h:189
RoR::ActorLinkingRequest::alr_actor_instance_id
ActorInstanceID_t alr_actor_instance_id
Definition: SimData.h:906
RoR::EV_BOAT_STEER_RIGHT
@ EV_BOAT_STEER_RIGHT
steer right a step
Definition: InputEngine.h:105
RoR::GUI::MainSelector::Close
void Close()
Definition: GUI_MainSelector.cpp:592
RoR::MSG_SIM_DELETE_ACTOR_REQUESTED
@ MSG_SIM_DELETE_ACTOR_REQUESTED
Payload = RoR::ActorPtr* (owner)
Definition: Application.h:123
RoR::GameContext::UpdateSimInputEvents
void UpdateSimInputEvents(float dt)
Definition: GameContext.cpp:1054
RoR::LT_AllBeam
@ LT_AllBeam
Definition: Application.h:320
RoR::GameContext::UpdateBoatInputEvents
void UpdateBoatInputEvents(float dt)
Definition: GameContext.cpp:1746
RoR::Actor::setCustomLightVisible
void setCustomLightVisible(int number, bool visible)
Definition: Actor.cpp:4450
RoRnet::PEEROPT_HIDE_ACTORS
@ PEEROPT_HIDE_ACTORS
Spawn actors hidden and immediatelly hide existing actors.
Definition: RoRnet.h:131
RoR::ActorSpawnRequest::net_source_id
int net_source_id
Definition: SimData.h:844
RoR::AeroEngine::setThrottle
virtual void setThrottle(float val)=0
Terrain.h
RoR::Actor::ar_net_stream_id
int ar_net_stream_id
Definition: Actor.h:426
RoR::Collisions::isInside
bool isInside(Ogre::Vector3 pos, const Ogre::String &inst, const Ogre::String &box, float border=0)
Definition: Collisions.cpp:1169
RoR::EV_COMMON_TOGGLE_CUSTOM_PARTICLES
@ EV_COMMON_TOGGLE_CUSTOM_PARTICLES
toggle particle cannon
Definition: InputEngine.h:268
RoR::SimState::RUNNING
@ RUNNING
RoR::GameContext::ShowLoaderGUI
void ShowLoaderGUI(int type, const Ogre::String &instance, const Ogre::String &box)
Definition: GameContext.cpp:660
RoR::EV_AIRPLANE_AIRBRAKES_FULL
@ EV_AIRPLANE_AIRBRAKES_FULL
Definition: InputEngine.h:77
AeroEngine.h
RoR::EV_TRUCK_BLINK_LEFT
@ EV_TRUCK_BLINK_LEFT
toggle left direction indicator (blinker)
Definition: InputEngine.h:303
RoR::EV_AIRPLANE_PARKING_BRAKE
@ EV_AIRPLANE_PARKING_BRAKE
airplane parking brake.
Definition: InputEngine.h:88
RoR::ActorState::NETWORKED_HIDDEN
@ NETWORKED_HIDDEN
not simulated, not updated (remote)
RoR::ActorManager::FetchActorDef
RigDef::DocumentPtr FetchActorDef(RoR::ActorSpawnRequest &rq)
Definition: ActorManager.cpp:1243
InputEngine.h
Handles controller inputs from player. Defines input events and binding mechanism,...
RoR::EV_AIRPLANE_ELEVATOR_UP
@ EV_AIRPLANE_ELEVATOR_UP
pull the elevator up in an aircraft.
Definition: InputEngine.h:83
RoR::CacheQuery::cqy_filter_guid
std::string cqy_filter_guid
Exact match (case-insensitive); leave empty to disable.
Definition: CacheSystem.h:186
RoR::GUIManager::MainSelector
GUI::MainSelector MainSelector
Definition: GUIManager.h:122
RoR::EV_COMMON_OUTPUT_POSITION
@ EV_COMMON_OUTPUT_POSITION
write current position to log (you can open the logfile and reuse the position)
Definition: InputEngine.h:243
RoR::Actor::getMaxHeight
float getMaxHeight(bool skip_virtual_nodes=true)
Definition: Actor.cpp:1492
RoR::InputEngine::isEventAnalog
bool isEventAnalog(int eventID)
Definition: InputEngine.cpp:934
RoR::Actor::countFlaresByType
int countFlaresByType(FlareType type)
Definition: Actor.cpp:4487
RoR::ActorSpawnRequest::Origin::USER
@ USER
Direct selection by user via GUI.
RoR::ActorLinkingRequestType::SLIDENODE_TOGGLE
@ SLIDENODE_TOGGLE
RoR::ActorManager::RestoreSavedState
void RestoreSavedState(ActorPtr actor, rapidjson::Value const &j_entry)
Definition: Savegame.cpp:787
RoR::Console::CONSOLE_MSGTYPE_ACTOR
@ CONSOLE_MSGTYPE_ACTOR
Parsing/spawn/simulation messages for actors.
Definition: Console.h:63
RoR::EV_AIRPLANE_BRAKE
@ EV_AIRPLANE_BRAKE
normal brake for an aircraft.
Definition: InputEngine.h:81
RoR::EV_AIRPLANE_THROTTLE_UP
@ EV_AIRPLANE_THROTTLE_UP
increase the airplane thrust
Definition: InputEngine.h:99
RoR::ActorSpawnRequest::asr_net_peeropts
BitMask_t asr_net_peeropts
RoRnet::PeerOptions to be applied after spawn.
Definition: SimData.h:843
RoR::GfxActor::GetDebugView
DebugViewType GetDebugView() const
Definition: GfxActor.h:144
RigDef::DocumentPtr
std::shared_ptr< Document > DocumentPtr
Definition: ForwardDeclarations.h:272
RoR::Console::CONSOLE_SYSTEM_WARNING
@ CONSOLE_SYSTEM_WARNING
Definition: Console.h:53
RoRnet::PEEROPT_MUTE_ACTORS
@ PEEROPT_MUTE_ACTORS
Spawn actors muted and immediatelly mute existing actors.
Definition: RoRnet.h:130
RoR::App::diag_preset_veh_enter
CVar * diag_preset_veh_enter
Definition: Application.cpp:145
RoR::CVar::getInt
int getInt() const
Definition: CVar.h:97
RoR::Console::CONSOLE_MSGTYPE_INFO
@ CONSOLE_MSGTYPE_INFO
Generic message.
Definition: Console.h:60
RoR::GameContext::SpawnPreselectedActor
void SpawnPreselectedActor(std::string const &preset_vehicle, std::string const &preset_veh_config)
needs Character to exist
Definition: GameContext.cpp:624
ai_events::speed
int speed
Definition: GUI_TopMenubar.h:40
RoR::GameContext::m_dummy_cache_selection
CacheEntryPtr m_dummy_cache_selection
Definition: GameContext.h:202
RoR::GameContext::m_last_spawned_actor
ActorPtr m_last_spawned_actor
Last actor spawned by user and still alive.
Definition: GameContext.h:195
RoR::GUI::TopMenubar::ai_dname
Ogre::String ai_dname
Definition: GUI_TopMenubar.h:79
RoR::MSG_GUI_CLOSE_MENU_REQUESTED
@ MSG_GUI_CLOSE_MENU_REQUESTED
Definition: Application.h:138
RoR::ActorSpawnRequest::asr_position
Ogre::Vector3 asr_position
Definition: SimData.h:833
RoR::GUI::GameControls::SetVisible
void SetVisible(bool visible)
Definition: GUI_GameControls.cpp:416
RoR::ForceFeedback::SetEnabled
void SetEnabled(bool v)
Definition: ForceFeedback.cpp:93
RoR::GUI::TopMenubar::ai_sectionconfig
Ogre::String ai_sectionconfig
Definition: GUI_TopMenubar.h:80
RoR::Actor::softRespawn
void softRespawn(Ogre::Vector3 spawnpos, Ogre::Quaternion spawnrot)
Use MSG_SIM_MODIFY_ACTOR_REQUESTED with type SOFT_RESPAWN; Resets the actor to given position as if s...
Definition: Actor.cpp:1287
RoR::EV_COMMON_QUIT_GAME
@ EV_COMMON_QUIT_GAME
exit the game
Definition: InputEngine.h:249
RoR::EV_TRUCKEDIT_RELOAD
@ EV_TRUCKEDIT_RELOAD
Definition: InputEngine.h:397
RoR::ModifyProjectRequest::mpr_type
ModifyProjectRequestType mpr_type
Definition: CacheSystem.h:268
RoR::Actor::ar_net_source_id
int ar_net_source_id
Unique ID of remote player who spawned this actor.
Definition: Actor.h:425
Collisions.h
RoR::EV_AIRPLANE_STEER_LEFT
@ EV_AIRPLANE_STEER_LEFT
steer left
Definition: InputEngine.h:92
RoR::MSG_SIM_MUTE_NET_ACTOR_REQUESTED
@ MSG_SIM_MUTE_NET_ACTOR_REQUESTED
Payload = ActorPtr* (owner)
Definition: Application.h:128
RoR::GUI::TopMenubar::ai_select2
bool ai_select2
Definition: GUI_TopMenubar.h:88
RoR::MSG_SIM_PAUSE_REQUESTED
@ MSG_SIM_PAUSE_REQUESTED
Definition: Application.h:116
RoR::ActorState::NETWORKED_OK
@ NETWORKED_OK
not simulated (remote) actor
RoR::EV_COMMON_CYCLE_DEBUG_VIEWS
@ EV_COMMON_CYCLE_DEBUG_VIEWS
cycle debug view mode
Definition: InputEngine.h:266
RoR::Actor::displayWheelDiffMode
void displayWheelDiffMode()
Cycles through the available inter wheel diff modes.
Definition: Actor.cpp:1362
RoR::EV_AIRPLANE_THROTTLE_AXIS
@ EV_AIRPLANE_THROTTLE_AXIS
throttle axis. Only use this if you have fitting hardware :) (i.e. a Slider)
Definition: InputEngine.h:95
RoR::ActorManager::UpdateActors
void UpdateActors(ActorPtr player_actor)
Definition: ActorManager.cpp:1016
RoR::Actor::ar_aileron
float ar_aileron
Sim state; aerial controller.
Definition: Actor.h:417
RoR::tryConvertUTF
Ogre::UTFString tryConvertUTF(const char *buffer)
Definition: Utils.cpp:58
RoR::FlareType::HIGH_BEAM
@ HIGH_BEAM
RoR::Actor::ar_state
ActorState ar_state
Definition: Actor.h:453
RoR::ActorManager::FetchNextVehicleOnList
const ActorPtr & FetchNextVehicleOnList(ActorPtr player, ActorPtr prev_player)
Definition: ActorManager.cpp:952
RoR::Actor::setAirbrakeIntensity
void setAirbrakeIntensity(float intensity)
Definition: Actor.cpp:2892
RoR::EV_AIRPLANE_ELEVATOR_DOWN
@ EV_AIRPLANE_ELEVATOR_DOWN
pull the elevator down in an aircraft.
Definition: InputEngine.h:82
RoR::GameContext::GetPlayerActor
const ActorPtr & GetPlayerActor()
Definition: GameContext.h:134
RoR::AI
@ AI
machine controlled by an Artificial Intelligence
Definition: SimData.h:97
RoR::GameContext::UpdateTruckInputEvents
void UpdateTruckInputEvents(float dt)
Definition: GameContext.cpp:1806
RoR::App::gfx_sky_time_cycle
CVar * gfx_sky_time_cycle
Definition: Application.cpp:220
RoR::Actor::prepareInside
void prepareInside(bool inside)
Prepares vehicle for in-cabin camera use.
Definition: Actor.cpp:2926
RoR::TyrePressure::IsEnabled
bool IsEnabled() const
Definition: TyrePressure.h:47
RoR::Actor::ar_rudder
float ar_rudder
Sim state; aerial/marine controller.
Definition: Actor.h:416
RoR::Actor::cruisecontrolToggle
void cruisecontrolToggle()
Defined in 'gameplay/CruiseControl.cpp'.
Definition: CruiseControl.cpp:31
RoR::ActorModifyRequest::amr_type
Type amr_type
Definition: SimData.h:872
RoR::ActorSpawnRequest::asr_spawnbox
collision_box_t * asr_spawnbox
Definition: SimData.h:835
RoR::ActorSpawnRequest::asr_rotation
Ogre::Quaternion asr_rotation
Definition: SimData.h:834
RoR::Actor::getWorkingTuneupDef
TuneupDefPtr & getWorkingTuneupDef()
Definition: Actor.cpp:4674
RoR::GfxScene::ForceUpdateSingleGfxActor
void ForceUpdateSingleGfxActor(RoR::GfxActor *gfx_actor)
Definition: GfxScene.cpp:332
RoR::AeroEngine::getThrottle
virtual float getThrottle()=0
RoR::Actor::setSideLightsVisible
void setSideLightsVisible(bool val)
Definition: Actor.h:191
RoR
Definition: AppContext.h:36
RoR::SE_GENERIC_DELETED_TRUCK
@ SE_GENERIC_DELETED_TRUCK
triggered when the user deletes an actor, the argument refers to the actor ID
Definition: ScriptEvents.h:48
RoR::ActorManager::GetActorById
const ActorPtr & GetActorById(ActorInstanceID_t actor_id)
Definition: ActorManager.cpp:1132
RoR::EV_COMMON_REMOVE_CURRENT_TRUCK
@ EV_COMMON_REMOVE_CURRENT_TRUCK
remove current truck
Definition: InputEngine.h:232
x
float x
Definition: (ValueTypes) quaternion.h:5
RoR::CacheSystem::Query
size_t Query(CacheQuery &query)
Definition: CacheSystem.cpp:2095
RoR::EV_BOAT_STEER_RIGHT_AXIS
@ EV_BOAT_STEER_RIGHT_AXIS
steer right (analog value!)
Definition: InputEngine.h:106
RoR::GUI::TopMenubar::ai_select
bool ai_select
Definition: GUI_TopMenubar.h:82
RoR::GameContext::FetchNextVehicleOnList
const ActorPtr & FetchNextVehicleOnList()
Definition: GameContext.cpp:595
RoR::ActorSpawnRequest::asr_enter
bool asr_enter
Definition: SimData.h:847
RoR::Log
void Log(const char *msg)
The ultimate, application-wide logging function. Adds a line (any length) in 'RoR....
Definition: Application.cpp:422
RoR::EV_SKY_INCREASE_TIME_FAST
@ EV_SKY_INCREASE_TIME_FAST
increase day-time a lot faster
Definition: InputEngine.h:113
RoR::EV_COMMON_RESCUE_TRUCK
@ EV_COMMON_RESCUE_TRUCK
teleport to rescue truck
Definition: InputEngine.h:256
RoR::App::GetGfxScene
GfxScene * GetGfxScene()
Definition: Application.cpp:279
RoR::GameContext::GetActorManager
ActorManager * GetActorManager()
Definition: GameContext.h:127
RoR::GameContext::FindActorByCollisionBox
ActorPtr FindActorByCollisionBox(std::string const &ev_src_instance_name, std::string const &box_name)
Definition: GameContext.cpp:605
RoR::EV_TRUCK_PARKING_BRAKE
@ EV_TRUCK_PARKING_BRAKE
toggle parking brake
Definition: InputEngine.h:329
RoR::CVar::setStr
void setStr(std::string const &str)
Definition: CVar.h:83
RoR::GameContext::m_msg_mutex
std::mutex m_msg_mutex
Definition: GameContext.h:186
RoR::CacheQuery::cqy_results
std::vector< CacheQueryResult > cqy_results
Definition: CacheSystem.h:191
RoR::LT_Train
@ LT_Train
Definition: Application.h:316
RoR::EV_COMMON_ROPELOCK
@ EV_COMMON_ROPELOCK
connect hook node to a node in close proximity
Definition: InputEngine.h:259
RoR::CacheEntry::default_skin
std::string default_skin
Definition: CacheSystem.h:107
RoR::MSG_APP_SHUTDOWN_REQUESTED
@ MSG_APP_SHUTDOWN_REQUESTED
Definition: Application.h:85
RoR::COMMANDKEYID_INVALID
static const CommandkeyID_t COMMANDKEYID_INVALID
Definition: ForwardDeclarations.h:80
RoR::ActorManager::CreateNewActor
ActorPtr CreateNewActor(ActorSpawnRequest rq, RigDef::DocumentPtr def)
Definition: ActorManager.cpp:78
RoR::GUI::VehicleInfoTPanel::GetActiveCommandKey
CommandkeyID_t GetActiveCommandKey() const
Definition: GUI_VehicleInfoTPanel.h:42
SOUND_TOGGLE
#define SOUND_TOGGLE(_ACTOR_, _TRIG_)
Definition: SoundScriptManager.h:37
RoR::Character::setRotation
void setRotation(Ogre::Radian rotation)
Definition: Character.cpp:98
RoR::Actor::ar_cinecam_node
NodeNum_t ar_cinecam_node[MAX_CAMERAS]
Sim attr; Cine-camera node indexes.
Definition: Actor.h:377
RoR::EV_COMMON_TOGGLE_DEBUG_VIEW
@ EV_COMMON_TOGGLE_DEBUG_VIEW
toggle debug view mode
Definition: InputEngine.h:265
RoR::InputEngine::getEventBounceTime
float getEventBounceTime(int eventID)
Definition: InputEngine.cpp:778
RoR::CacheEntry::guid
Ogre::String guid
global unique id; Type "addonpart" leaves this empty and uses addonpart_guids; Always lowercase.
Definition: CacheSystem.h:77
RoR::Terrn2Parser::LoadTerrn2
Terrn2DocumentPtr LoadTerrn2(Ogre::DataStreamPtr &ds)
Definition: Terrn2FileFormat.cpp:38
RoR::EV_TRUCK_ANTILOCK_BRAKE
@ EV_TRUCK_ANTILOCK_BRAKE
toggle antilockbrake system
Definition: InputEngine.h:300
RoR::Actor::getCustomLightVisible
bool getCustomLightVisible(int number)
Definition: Actor.cpp:4428
RoR::ActorModifyRequest::Type::RESET_ON_SPOT
@ RESET_ON_SPOT
RoR::Actor::displayTransferCaseMode
void displayTransferCaseMode()
Gets the current transfer case mode name (4WD Hi, ...)
Definition: Actor.cpp:1388
RoR::GameContext::CreatePlayerCharacter
void CreatePlayerCharacter()
Terrain must be loaded.
Definition: GameContext.cpp:840
RoR::GameContext::UpdateSkyInputEvents
void UpdateSkyInputEvents(float dt)
Definition: GameContext.cpp:1212
RoR::Actor::isBeingReset
bool isBeingReset() const
Definition: Actor.h:279
RoR::ActorSpawnRequest::asr_saved_state
std::shared_ptr< rapidjson::Document > asr_saved_state
Pushes msg MODIFY_ACTOR (type RESTORE_SAVED) after spawn.
Definition: SimData.h:850
RoR::CacheEntry::fname
Ogre::String fname
filename
Definition: CacheSystem.h:67
RoR::EV_TRUCK_LEFT_MIRROR_RIGHT
@ EV_TRUCK_LEFT_MIRROR_RIGHT
Definition: InputEngine.h:315
RoR::Screwprop::toggleReverse
void toggleReverse()
Definition: ScrewProp.cpp:118
RoR::TyrePressure::UpdateInputEvents
void UpdateInputEvents(float dt)
Definition: TyrePressure.cpp:32
RoR::Terrain::HasPredefinedActors
bool HasPredefinedActors()
Definition: Terrain.cpp:539
RoR::GameContext::HasMessages
bool HasMessages()
Definition: GameContext.cpp:90
RoR::ActorModifyRequest::Type::RELOAD
@ RELOAD
Full reload from filesystem, requested by user.