![]() |
Rigs of Rods 2026.01
Soft-body Physics Simulation
|
Central game state manager.
RoR's gameplay is quite simple in structure, it consists of:
Terrain. this includes static collision objects (or intrusion detection objects), managed by TerrainObjectManager.ActorManager. They collide with static terrain and each other. this includes 'fixes' - actors with partially fixed position.CharacterFactory. they have simplified physics and can climb objects. For convenience and to help manage interactions, this class provides methods to manipulate these elements.CAUTION: PushMessage() doesn't guarantee order of processing: if message handler generates additional messages, it moves the original message at the end of the queue. To illustrate:
Message chaining is for situations where message order must be preserved.
Definition at line 95 of file GameContext.h.
Private Attributes | |
| GameMsgQueue | m_msg_queue |
| Message * | m_msg_chain_end = nullptr |
| std::mutex | m_msg_mutex |
| TerrainPtr | m_terrain |
| ActorManager | m_actor_manager |
| ActorPtr | m_player_actor |
| ActorPtr | m_prev_player_actor |
| ActorPtr | m_last_spawned_actor |
| ActorPtr | m_actor_remotely_receiving_commands |
| CacheEntryPtr | m_last_cache_selection |
| CacheEntryPtr | m_last_skin_selection |
| CacheEntryPtr | m_last_tuneup_selection |
| Ogre::String | m_last_section_config |
| ActorSpawnRequest | m_current_selection |
| CacheEntryPtr | m_dummy_cache_selection |
| CharacterFactory | m_character_factory |
| RaceSystem | m_race_system |
| RepairMode | m_recovery_mode |
| SceneMouse | m_scene_mouse |
| Ogre::Timer | m_timer |
| Ogre::Vector3 | prev_pos = Ogre::Vector3::ZERO |
Friends | |
| class | AppContext |
| GameContext::GameContext | ( | ) |
Definition at line 53 of file GameContext.cpp.
| GameContext::~GameContext | ( | ) |
Definition at line 58 of file GameContext.cpp.
| void GameContext::ChainMessage | ( | Message | m | ) |
Add to last pushed message's chain.
Definition at line 73 of file GameContext.cpp.
| void GameContext::ChangePlayerActor | ( | ActorPtr | actor | ) |
Definition at line 502 of file GameContext.cpp.
| void GameContext::CreatePlayerCharacter | ( | ) |
Terrain must be loaded.
Definition at line 851 of file GameContext.cpp.
| void GameContext::DeleteActor | ( | ActorPtr | actor | ) |
Definition at line 453 of file GameContext.cpp.
| std::string GameContext::ExtractSceneName | ( | std::string const & | filename | ) |
Definition at line 75 of file Savegame.cpp.
| std::string GameContext::ExtractSceneTerrain | ( | std::string const & | filename | ) |
Returns terrain filename.
Definition at line 87 of file Savegame.cpp.
| const ActorPtr & GameContext::FetchNextVehicleOnList | ( | ) |
Definition at line 606 of file GameContext.cpp.
| const ActorPtr & GameContext::FetchPrevVehicleOnList | ( | ) |
Definition at line 601 of file GameContext.cpp.
| ActorPtr GameContext::FindActorByCollisionBox | ( | std::string const & | ev_src_instance_name, |
| std::string const & | box_name | ||
| ) |
Definition at line 616 of file GameContext.cpp.
|
inline |
Definition at line 127 of file GameContext.h.
|
inline |
Definition at line 137 of file GameContext.h.
|
inline |
Definition at line 151 of file GameContext.h.
|
inline |
Last actor spawned by user and still alive.
Definition at line 136 of file GameContext.h.
|
inline |
Definition at line 134 of file GameContext.h.
| Character * GameContext::GetPlayerCharacter | ( | ) |
Definition at line 908 of file GameContext.cpp.
|
inline |
Definition at line 135 of file GameContext.h.
| std::string GameContext::GetQuicksaveFilename | ( | ) |
For currently loaded terrain (cvar 'sim_terrain_name')
Definition at line 56 of file Savegame.cpp.
|
inline |
Definition at line 169 of file GameContext.h.
|
inline |
Definition at line 170 of file GameContext.h.
|
inline |
Definition at line 171 of file GameContext.h.
|
inline |
Definition at line 117 of file GameContext.h.
| void GameContext::HandleSavegameHotkeys | ( | ) |
Definition at line 99 of file Savegame.cpp.
| bool GameContext::HasMessages | ( | ) |
Definition at line 90 of file GameContext.cpp.
| void GameContext::LoadScene | ( | std::string const & | filename | ) |
Matching terrain must be already loaded.
Definition at line 64 of file Savegame.cpp.
| bool GameContext::LoadTerrain | ( | std::string const & | filename_part | ) |
Definition at line 112 of file GameContext.cpp.
| void GameContext::ModifyActor | ( | ActorModifyRequest & | rq | ) |
Definition at line 384 of file GameContext.cpp.
| void GameContext::OnLoaderGuiApply | ( | RoR::LoaderType | type, |
| CacheEntryPtr | entry, | ||
| std::string | sectionconfig | ||
| ) |
GUI callback.
Definition at line 715 of file GameContext.cpp.
| void GameContext::OnLoaderGuiCancel | ( | ) |
GUI callback.
Definition at line 699 of file GameContext.cpp.
| Message GameContext::PopMessage | ( | ) |
Definition at line 96 of file GameContext.cpp.
| void GameContext::PushMessage | ( | Message | m | ) |
Doesn't guarantee order! Use ChainMessage() if order matters.
Definition at line 66 of file GameContext.cpp.
| void GameContext::RespawnLastActor | ( | ) |
Definition at line 622 of file GameContext.cpp.
| void GameContext::SaveScene | ( | std::string const & | filename | ) |
Definition at line 70 of file Savegame.cpp.
| void GameContext::SetPrevPlayerActor | ( | ActorPtr | actor | ) |
Definition at line 846 of file GameContext.cpp.
| void GameContext::ShowLoaderGUI | ( | int | type, |
| const Ogre::String & | instance, | ||
| const Ogre::String & | box | ||
| ) |
Definition at line 671 of file GameContext.cpp.
| ActorPtr GameContext::SpawnActor | ( | ActorSpawnRequest & | rq | ) |
Definition at line 193 of file GameContext.cpp.
| void GameContext::SpawnPreselectedActor | ( | std::string const & | preset_vehicle, |
| std::string const & | preset_veh_config | ||
| ) |
needs Character to exist
Definition at line 635 of file GameContext.cpp.
| void GameContext::TeleportPlayer | ( | float | x, |
| float | z | ||
| ) |
Definition at line 916 of file GameContext.cpp.
| void GameContext::UnloadTerrain | ( | ) |
Definition at line 179 of file GameContext.cpp.
| void GameContext::UpdateActors | ( | ) |
Definition at line 611 of file GameContext.cpp.
| void GameContext::UpdateAirplaneInputEvents | ( | float | dt, |
| ActorPtr | airplane | ||
| ) |
Definition at line 1615 of file GameContext.cpp.
| void GameContext::UpdateBoatInputEvents | ( | float | dt, |
| ActorPtr | boat | ||
| ) |
Definition at line 1834 of file GameContext.cpp.
| void GameContext::UpdateCommonInputEvents | ( | float | dt, |
| ActorPtr | actor | ||
| ) |
Definition at line 1331 of file GameContext.cpp.
| void GameContext::UpdateGlobalInputEvents | ( | ) |
Definition at line 954 of file GameContext.cpp.
| void GameContext::UpdateSimInputEvents | ( | float | dt | ) |
Definition at line 1069 of file GameContext.cpp.
| void GameContext::UpdateSkyInputEvents | ( | float | dt | ) |
Definition at line 1267 of file GameContext.cpp.
| void GameContext::UpdateTruckInputEvents | ( | float | dt, |
| ActorPtr | truck | ||
| ) |
Definition at line 1894 of file GameContext.cpp.
|
friend |
Definition at line 97 of file GameContext.h.
|
private |
Definition at line 193 of file GameContext.h.
|
private |
Actor close enough to import command keys.
Definition at line 197 of file GameContext.h.
|
private |
Definition at line 207 of file GameContext.h.
|
private |
Context of the loader UI.
Definition at line 203 of file GameContext.h.
|
private |
Definition at line 204 of file GameContext.h.
|
private |
Vehicle/load.
Definition at line 199 of file GameContext.h.
|
private |
Definition at line 202 of file GameContext.h.
|
private |
Definition at line 200 of file GameContext.h.
|
private |
Last actor spawned by user and still alive.
Definition at line 196 of file GameContext.h.
|
private |
Definition at line 201 of file GameContext.h.
|
private |
Definition at line 186 of file GameContext.h.
|
private |
Definition at line 187 of file GameContext.h.
|
private |
Definition at line 185 of file GameContext.h.
|
private |
Actor (vehicle or machine) mounted and controlled by player.
Definition at line 194 of file GameContext.h.
|
private |
Previous actor (vehicle or machine) mounted and controlled by player.
Definition at line 195 of file GameContext.h.
|
private |
Definition at line 210 of file GameContext.h.
|
private |
Aka 'advanced repair' or 'interactive reset'.
Definition at line 211 of file GameContext.h.
|
private |
Mouse interaction with scene.
Definition at line 212 of file GameContext.h.
|
private |
Definition at line 190 of file GameContext.h.
|
private |
Definition at line 213 of file GameContext.h.
|
private |
Definition at line 214 of file GameContext.h.