![]() |
RigsofRods
2023.09
Soft-body Physics Simulation
|
Central game state manager. More...
#include <GameContext.h>
Public Member Functions | |
| GameContext () | |
| ~GameContext () | |
Message queue | |
| void | PushMessage (Message m) |
| Doesn't guarantee order! Use ChainMessage() if order matters. More... | |
| void | ChainMessage (Message m) |
| Add to last pushed message's chain. More... | |
| bool | HasMessages () |
| Message | PopMessage () |
Terrain | |
| bool | LoadTerrain (std::string const &filename_part) |
| void | UnloadTerrain () |
| const TerrainPtr & | GetTerrain () |
Actors | |
| ActorPtr | SpawnActor (ActorSpawnRequest &rq) |
| void | ModifyActor (ActorModifyRequest &rq) |
| void | DeleteActor (ActorPtr actor) |
| void | UpdateActors () |
| ActorManager * | GetActorManager () |
| const ActorPtr & | FetchPrevVehicleOnList () |
| const ActorPtr & | FetchNextVehicleOnList () |
| ActorPtr | FindActorByCollisionBox (std::string const &ev_src_instance_name, std::string const &box_name) |
| void | RespawnLastActor () |
| void | SpawnPreselectedActor (std::string const &preset_vehicle, std::string const &preset_veh_config) |
needs Character to exist More... | |
| const ActorPtr & | GetPlayerActor () |
| const ActorPtr & | GetPrevPlayerActor () |
| const ActorPtr & | GetActorRemotelyReceivingCommands () |
| void | SetPrevPlayerActor (ActorPtr actor) |
| void | ChangePlayerActor (ActorPtr actor) |
| void | ShowLoaderGUI (int type, const Ogre::String &instance, const Ogre::String &box) |
| void | OnLoaderGuiCancel () |
| GUI callback. More... | |
| void | OnLoaderGuiApply (RoR::LoaderType type, CacheEntryPtr entry, std::string sectionconfig) |
| GUI callback. More... | |
Characters | |
| |
| void | CreatePlayerCharacter () |
| Terrain must be loaded. More... | |
| Character * | GetPlayerCharacter () |
| CharacterFactory * | GetCharacterFactory () |
Savegames | |
| void | LoadScene (std::string const &filename) |
| Matching terrain must be already loaded. More... | |
| void | SaveScene (std::string const &filename) |
| std::string | GetQuicksaveFilename () |
| For currently loaded terrain (cvar 'sim_terrain_name') More... | |
| std::string | ExtractSceneName (std::string const &filename) |
| std::string | ExtractSceneTerrain (std::string const &filename) |
| Returns terrain filename. More... | |
| void | HandleSavegameHotkeys () |
Gameplay feats (misc.) | |
| RaceSystem & | GetRaceSystem () |
| RepairMode & | GetRepairMode () |
| SceneMouse & | GetSceneMouse () |
| void | TeleportPlayer (float x, float z) |
| void | UpdateGlobalInputEvents () |
| void | UpdateSimInputEvents (float dt) |
| void | UpdateSkyInputEvents (float dt) |
| void | UpdateCommonInputEvents (float dt) |
| void | UpdateAirplaneInputEvents (float dt) |
| void | UpdateBoatInputEvents (float dt) |
| void | UpdateTruckInputEvents (float dt) |
Friends | |
| class | AppContext |
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.
| 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 487 of file GameContext.cpp.
| void GameContext::CreatePlayerCharacter | ( | ) |
Terrain must be loaded.
Definition at line 840 of file GameContext.cpp.
| void GameContext::DeleteActor | ( | ActorPtr | actor | ) |
Definition at line 438 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 595 of file GameContext.cpp.
| const ActorPtr & GameContext::FetchPrevVehicleOnList | ( | ) |
Definition at line 590 of file GameContext.cpp.
| ActorPtr GameContext::FindActorByCollisionBox | ( | std::string const & | ev_src_instance_name, |
| std::string const & | box_name | ||
| ) |
Definition at line 605 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 |
Definition at line 134 of file GameContext.h.
| Character * GameContext::GetPlayerCharacter | ( | ) |
Definition at line 897 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 369 of file GameContext.cpp.
| void GameContext::OnLoaderGuiApply | ( | RoR::LoaderType | type, |
| CacheEntryPtr | entry, | ||
| std::string | sectionconfig | ||
| ) |
GUI callback.
Definition at line 704 of file GameContext.cpp.
| void GameContext::OnLoaderGuiCancel | ( | ) |
GUI callback.
Definition at line 688 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 611 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 835 of file GameContext.cpp.
| void GameContext::ShowLoaderGUI | ( | int | type, |
| const Ogre::String & | instance, | ||
| const Ogre::String & | box | ||
| ) |
Definition at line 660 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 624 of file GameContext.cpp.
| void GameContext::TeleportPlayer | ( | float | x, |
| float | z | ||
| ) |
Definition at line 905 of file GameContext.cpp.
| void GameContext::UnloadTerrain | ( | ) |
Definition at line 179 of file GameContext.cpp.
| void GameContext::UpdateActors | ( | ) |
Definition at line 600 of file GameContext.cpp.
| void GameContext::UpdateAirplaneInputEvents | ( | float | dt | ) |
Definition at line 1602 of file GameContext.cpp.
| void GameContext::UpdateBoatInputEvents | ( | float | dt | ) |
Definition at line 1790 of file GameContext.cpp.
| void GameContext::UpdateCommonInputEvents | ( | float | dt | ) |
Definition at line 1320 of file GameContext.cpp.
| void GameContext::UpdateGlobalInputEvents | ( | ) |
Definition at line 943 of file GameContext.cpp.
| void GameContext::UpdateSimInputEvents | ( | float | dt | ) |
Definition at line 1058 of file GameContext.cpp.
| void GameContext::UpdateSkyInputEvents | ( | float | dt | ) |
Definition at line 1256 of file GameContext.cpp.
| void GameContext::UpdateTruckInputEvents | ( | float | dt | ) |
Definition at line 1850 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.
1.8.17