RigsofRods
Soft-body Physics Simulation
Terrain.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-2016 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 "Terrain.h"
23 
24 #include "Actor.h"
25 #include "ActorManager.h"
26 #include "CacheSystem.h"
27 #include "Collisions.h"
28 #include "ContentManager.h"
29 #include "Renderdash.h"
30 #include "GfxScene.h"
31 #include "GUIManager.h"
32 #include "GUI_LoadingWindow.h"
33 #include "GUI_SurveyMap.h"
34 #include "HydraxWater.h"
35 #include "Language.h"
36 #include "ScriptEngine.h"
37 #include "ShadowManager.h"
38 #include "SkyManager.h"
39 #include "SkyXManager.h"
40 #include "TerrainGeometryManager.h"
41 #include "TerrainObjectManager.h"
42 #include "Terrn2FileFormat.h"
43 #include "Utils.h"
44 #include "Water.h"
45 
46 #include <Terrain/OgreTerrainPaging.h>
47 #include <Terrain/OgreTerrainGroup.h>
48 
49 #include <algorithm>
50 
51 using namespace RoR;
52 using namespace Ogre;
53 
55  : m_collisions(0)
56  , m_geometry_manager(0)
57  , m_object_manager(0)
58  , m_shadow_manager(0)
59  , m_sky_manager(0)
60  , SkyX_manager(0)
61  , m_sight_range(1000)
62  , m_main_light(0)
63  , m_paged_detail_factor(0.0f)
64  , m_cur_gravity(DEFAULT_GRAVITY)
65  , m_hydrax_water(nullptr)
66  , m_cache_entry(entry)
67  , m_def(def)
68 {
69 }
70 
72 {
73  if (!m_disposed)
74  {
75  this->dispose();
76  }
77 }
78 
80 {
81  if (App::app_state->getEnum<AppState>() == AppState::SHUTDOWN)
82  {
83  // Rush to exit
84  return;
85  }
86 
87  //I think that the order is important
88 
89 #ifdef USE_CAELUM
90  if (m_sky_manager != nullptr)
91  {
92  delete(m_sky_manager);
93  m_sky_manager = nullptr;
94  }
95 #endif // USE_CAELUM
96 
97  if (SkyX_manager != nullptr)
98  {
99  delete(SkyX_manager);
100  SkyX_manager = nullptr;
101  }
102 
103  if (m_main_light != nullptr)
104  {
105  App::GetGfxScene()->GetSceneManager()->destroyAllLights();
106  m_main_light = nullptr;
107  }
108 
109  if (m_hydrax_water != nullptr)
110  {
111  m_water.reset(); // TODO: Currently needed - research and get rid of this ~ only_a_ptr, 08/2018
112  }
113 
114  if (m_object_manager != nullptr)
115  {
116  delete(m_object_manager);
117  m_object_manager = nullptr;
118  }
119 
120  if (m_geometry_manager != nullptr)
121  {
122  delete(m_geometry_manager);
123  m_geometry_manager = nullptr;
124  }
125 
126  if (m_shadow_manager != nullptr)
127  {
128  delete(m_shadow_manager);
129  m_shadow_manager = nullptr;
130  }
131 
132  if (m_collisions != nullptr)
133  {
134  delete(m_collisions);
135  m_collisions = nullptr;
136  }
137 
138  if (App::GetScriptEngine()->getTerrainScriptUnit() != SCRIPTUNITID_INVALID)
139  {
140  App::GetScriptEngine()->unloadScript(App::GetScriptEngine()->getTerrainScriptUnit());
141  }
142 
143  m_disposed = true;
144 }
145 
147 {
148  auto* loading_window = &App::GetGuiManager()->LoadingWindow;
149 
150  this->setGravity(this->m_def->gravity);
151 
152  loading_window->SetProgress(10, _L("Initializing Object Subsystem"));
153  this->initObjects(); // *.odef files
154 
155  loading_window->SetProgress(14, _L("Initializing Shadow Subsystem"));
156  this->initShadows();
157 
158  loading_window->SetProgress(17, _L("Initializing Geometry Subsystem"));
159  this->m_geometry_manager = new TerrainGeometryManager(this);
160 
161  loading_window->SetProgress(23, _L("Initializing Camera Subsystem"));
162  this->initCamera();
163 
164  // sky, must come after camera due to m_sight_range
165  loading_window->SetProgress(25, _L("Initializing Sky Subsystem"));
166  this->initSkySubSystem();
167 
168  loading_window->SetProgress(27, _L("Initializing Light Subsystem"));
169  this->initLight();
170 
171  if (App::gfx_sky_mode->getEnum<GfxSkyMode>() != GfxSkyMode::CAELUM) //Caelum has its own fog management
172  {
173  loading_window->SetProgress(29, _L("Initializing Fog Subsystem"));
174  this->initFog();
175  }
176 
177  loading_window->SetProgress(31, _L("Initializing Vegetation Subsystem"));
178  this->initVegetation();
179 
180  this->fixCompositorClearColor();
181 
182  loading_window->SetProgress(40, _L("Loading Terrain Geometry"));
183  if (!this->m_geometry_manager->InitTerrain(this->m_def->ogre_ter_conf_filename))
184  {
185  return false; // Error already reported
186  }
187 
188  loading_window->SetProgress(60, _L("Initializing Collision Subsystem"));
189  this->m_collisions = new Collisions(this->getMaxTerrainSize());
190 
191  loading_window->SetProgress(75, _L("Initializing Script Subsystem"));
192  this->initScripting();
193  this->initAiPresets();
194 
195  loading_window->SetProgress(77, _L("Initializing Water Subsystem"));
196  this->initWater();
197 
198  loading_window->SetProgress(80, _L("Loading Terrain Objects"));
199  this->loadTerrainObjects(); // *.tobj files
200 
201  // init things after loading the terrain
202  this->initTerrainCollisions();
203 
204  loading_window->SetProgress(90, _L("Initializing terrain light properties"));
205  this->m_geometry_manager->UpdateMainLightPosition(); // Initial update takes a while
206  this->m_collisions->finishLoadingTerrain();
207 
208  this->LoadTelepoints(); // *.terrn2 file feature
209 
210  App::GetGfxScene()->CreateDustPools(); // Particle effects
211 
212  loading_window->SetProgress(92, _L("Initializing Overview Map Subsystem"));
213  App::GetGuiManager()->SurveyMap.CreateTerrainTextures(); // Should be done before actors are loaded, otherwise they'd show up in the static texture
214 
215  LOG(" ===== LOADING TERRAIN ACTORS " + m_cache_entry->fname);
216  loading_window->SetProgress(95, _L("Loading Terrain Actors"));
217  this->LoadPredefinedActors();
218 
219  LOG(" ===== TERRAIN LOADING DONE " + m_cache_entry->fname);
220 
221  App::sim_terrain_name->setStr(m_cache_entry->fname);
222  App::sim_terrain_gui_name->setStr(this->m_def->name);
223 
224  return this;
225 }
226 
228 {
229  App::GetCameraManager()->GetCamera()->getViewport()->setBackgroundColour(m_def->ambient_color);
230  App::GetCameraManager()->GetCameraNode()->setPosition(m_def->start_position);
231 
232  if (App::gfx_sky_mode->getEnum<GfxSkyMode>() == GfxSkyMode::SKYX)
233  {
234  m_sight_range = 5000; //Force unlimited for SkyX, lower settings are glitchy
235  }
236  else
237  {
238  m_sight_range = App::gfx_sight_range->getInt();
239  }
240 
241  if (m_sight_range < UNLIMITED_SIGHTRANGE && App::gfx_sky_mode->getEnum<GfxSkyMode>() != GfxSkyMode::SKYX)
242  {
243  App::GetCameraManager()->GetCamera()->setFarClipDistance(m_sight_range);
244  }
245  else
246  {
247  // disabled in global config
248  if (App::gfx_water_mode->getEnum<GfxWaterMode>() != GfxWaterMode::HYDRAX)
249  App::GetCameraManager()->GetCamera()->setFarClipDistance(0); //Unlimited
250  else
251  App::GetCameraManager()->GetCamera()->setFarClipDistance(9999 * 6); //Unlimited for hydrax and stuff
252  }
253 }
254 
256 {
257 #ifdef USE_CAELUM
258  // Caelum skies
259  if (App::gfx_sky_mode->getEnum<GfxSkyMode>() == GfxSkyMode::CAELUM)
260  {
261  m_sky_manager = new SkyManager();
262 
263  // try to load caelum config
264  if (!m_def->caelum_config.empty() && ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(m_def->caelum_config))
265  {
266  // config provided and existing, use it :)
267  m_sky_manager->LoadCaelumScript(m_def->caelum_config, m_def->caelum_fog_start, m_def->caelum_fog_end);
268  }
269  else
270  {
271  // no config provided, fall back to the default one
272  m_sky_manager->LoadCaelumScript("ror_default_sky");
273  }
274  }
275  else
276 #endif //USE_CAELUM
277  // SkyX skies
278  if (App::gfx_sky_mode->getEnum<GfxSkyMode>() == GfxSkyMode::SKYX)
279  {
280  // try to load SkyX config
281  if (!m_def->skyx_config.empty() && ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(m_def->skyx_config))
282  SkyX_manager = new SkyXManager(m_def->skyx_config);
283  else
284  SkyX_manager = new SkyXManager("SkyXDefault.skx");
285  }
286  else
287  {
288  if (!m_def->cubemap_config.empty())
289  {
290  // use custom
291  App::GetGfxScene()->GetSceneManager()->setSkyBox(true, m_def->cubemap_config, 100, true);
292  }
293  else
294  {
295  // use default
296  App::GetGfxScene()->GetSceneManager()->setSkyBox(true, "tracks/skyboxcol", 100, true);
297  }
298  }
299 }
300 
302 {
303  if (App::gfx_sky_mode->getEnum<GfxSkyMode>() == GfxSkyMode::CAELUM)
304  {
305 #ifdef USE_CAELUM
306  m_main_light = m_sky_manager->GetSkyMainLight();
307 #endif
308  }
309  else if (App::gfx_sky_mode->getEnum<GfxSkyMode>() == GfxSkyMode::SKYX)
310  {
311  m_main_light = SkyX_manager->getMainLight();
312  }
313  else
314  {
315  // screw caelum, we will roll our own light
316 
317  // Create a light
318  m_main_light = App::GetGfxScene()->GetSceneManager()->createLight("MainLight");
319  //directional light for shadow
320  m_main_light->setType(Light::LT_DIRECTIONAL);
321  m_main_light->setDirection(Ogre::Vector3(0.785, -0.423, 0.453).normalisedCopy());
322 
323  m_main_light->setDiffuseColour(m_def->ambient_color);
324  m_main_light->setSpecularColour(m_def->ambient_color);
325  m_main_light->setCastShadows(true);
326  m_main_light->setShadowFarDistance(1000.0f);
327  m_main_light->setShadowNearClipDistance(-1);
328  }
329 }
330 
332 {
333  if (m_sight_range >= UNLIMITED_SIGHTRANGE)
334  App::GetGfxScene()->GetSceneManager()->setFog(FOG_NONE);
335  else
336  App::GetGfxScene()->GetSceneManager()->setFog(FOG_LINEAR, m_def->ambient_color, 0.000f, m_sight_range * 0.65f, m_sight_range*0.9);
337 }
338 
340 {
341  switch (App::gfx_vegetation_mode->getEnum<GfxVegetation>())
342  {
344  m_paged_detail_factor = 0.2f;
345  break;
347  m_paged_detail_factor = 0.5f;
348  break;
349  case GfxVegetation::FULL:
350  m_paged_detail_factor = 1.0f;
351  break;
352  default:
353  m_paged_detail_factor = 0.0f;
354  break;
355  }
356 }
357 
359 {
360  // hack
361  // now with extensive error checking
362  if (CompositorManager::getSingleton().hasCompositorChain(App::GetCameraManager()->GetCamera()->getViewport()))
363  {
364  CompositorInstance* co = CompositorManager::getSingleton().getCompositorChain(App::GetCameraManager()->GetCamera()->getViewport())->_getOriginalSceneCompositor();
365  if (co)
366  {
367  CompositionTechnique* ct = co->getTechnique();
368  if (ct)
369  {
370  CompositionTargetPass* ctp = ct->getOutputTargetPass();
371  if (ctp)
372  {
373  ROR_ASSERT(ctp->getPasses().size() > 0);
374  CompositionPass* p = ctp->getPasses()[0];
375  if (p)
376  {
377  p->setClearColour(Ogre::ColourValue::Black);
378  }
379  }
380  }
381  }
382  }
383 }
384 
386 {
387  // disabled in global config
388  if (App::gfx_water_mode->getEnum<GfxWaterMode>() == GfxWaterMode::NONE)
389  return;
390 
391  // disabled in map config
392  if (!m_def->has_water)
393  {
394  return;
395  }
396 
397  if (App::gfx_water_mode->getEnum<GfxWaterMode>() == GfxWaterMode::HYDRAX)
398  {
399  // try to load hydrax config
400  if (!m_def->hydrax_conf_file.empty() && ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(m_def->hydrax_conf_file))
401  {
402  m_hydrax_water = new HydraxWater(m_def->water_height, m_def->hydrax_conf_file);
403  }
404  else
405  {
406  // no config provided, fall back to the default one
407  m_hydrax_water = new HydraxWater(m_def->water_height);
408  }
409 
410  m_water = std::unique_ptr<IWater>(m_hydrax_water);
411 
412  //Apply depth technique to the terrain
413  TerrainGroup::TerrainIterator ti = m_geometry_manager->getTerrainGroup()->getTerrainIterator();
414  while (ti.hasMoreElements())
415  {
416  Ogre::Terrain* t = ti.getNext()->instance;
417  MaterialPtr ptr = t->getMaterial();
418  m_hydrax_water->GetHydrax()->getMaterialManager()->addDepthTechnique(ptr->createTechnique());
419  }
420  }
421  else
422  {
423  m_water = std::unique_ptr<IWater>(new Water(this->getMaxTerrainSize()));
424  m_water->SetStaticWaterHeight(m_def->water_height);
425  m_water->SetWaterBottomHeight(m_def->water_bottom_height);
426  }
427 }
428 
430 {
431  m_shadow_manager = new ShadowManager();
432  m_shadow_manager->loadConfiguration();
433 }
434 
436 {
437  for (std::string tobj_filename : m_def->tobj_files)
438  {
439  m_object_manager->LoadTObjFile(tobj_filename);
440  }
441 }
442 
444 {
445  if (!m_def->traction_map_file.empty())
446  {
447  m_collisions->setupLandUse(m_def->traction_map_file.c_str());
448  }
449 }
450 
452 {
453 #ifdef USE_ANGELSCRIPT
454  // suspend AS logging, so we dont spam the users screen with initialization messages
456 
457  bool loaded = false;
458 
459  for (std::string as_filename : m_def->as_files)
460  {
461  loaded |= this->getObjectManager()->LoadTerrainScript(as_filename);
462  }
463 
464  if (!loaded)
465  {
466  // load a default script that does the most basic things
467  this->getObjectManager()->LoadTerrainScript(DEFAULT_TERRAIN_SCRIPT);
468  }
469 
470  // finally resume AS logging
472 #endif //USE_ANGELSCRIPT
473 }
474 
476 {
477  // Load 'bundled' AI presets - see section `[AI Presets]` in terrn2 file format
478  // ----------------------------------------------------------------------------
479 
481 }
482 
483 void RoR::Terrain::setGravity(float value)
484 {
485  m_cur_gravity = value;
486 }
487 
489 {
490  m_object_manager = new TerrainObjectManager(this);
491 }
492 
494 {
495  return m_collisions->getCollisionAAB();
496 }
497 
499 {
500  if (!m_geometry_manager)
501  return Vector3::ZERO;
502  return m_geometry_manager->getMaxTerrainSize();
503 }
504 
505 float RoR::Terrain::getHeightAt(float x, float z)
506 {
507  return m_geometry_manager->getHeightAt(x, z);
508 }
509 
510 Ogre::Vector3 RoR::Terrain::GetNormalAt(float x, float y, float z)
511 {
512  return m_geometry_manager->getNormalAt(x, y, z);
513 }
514 
516 {
517  return m_sky_manager;
518 }
519 
521 {
522  if (m_disposed)
523  return false;
524  else
525  return m_geometry_manager->isFlat();
526 }
527 
529 {
530  if (m_object_manager)
531  m_object_manager->LoadTelepoints();
532 }
533 
535 {
536  if (m_object_manager)
537  m_object_manager->LoadPredefinedActors();
538 }
539 
541 {
542  if (m_object_manager)
543  return m_object_manager->HasPredefinedActors();
544  return false;
545 }
546 
548 {
549  return m_object_manager->getProceduralManager();
550 }
551 
553 {
554  return m_cache_entry->fname;
555 }
556 
558 {
559  return m_cache_entry->resource_group;
560 }
561 
562 void RoR::Terrain::addSurveyMapEntity(const std::string& type, const std::string& filename, const std::string& resource_group, const std::string& caption, const Ogre::Vector3& pos, float angle, int id)
563 {
564  m_object_manager->m_map_entities.push_back(SurveyMapEntity(type, caption, filename, resource_group, pos, Ogre::Radian(angle), id));
565 }
566 
568 {
569  EraseIf(m_object_manager->m_map_entities, [id](const SurveyMapEntity& e) { return e.id == id; });
570 }
571 
573 {
574  return m_object_manager->m_map_entities;
575 }
576 
578 
579 std::string RoR::Terrain::getTerrainName() const { return m_def->name; }
580 
581 std::string RoR::Terrain::getGUID() const { return m_def->guid; }
582 
583 int RoR::Terrain::getVersion() const { return m_def->version; }
584 
585 CacheEntryPtr RoR::Terrain::getCacheEntry() { return m_cache_entry; }
586 
587 Ogre::Vector3 RoR::Terrain::getSpawnPos() { return m_def->start_position; }
588 
589 Ogre::Degree RoR::Terrain::getSpawnRot() { return m_def->start_rotation; }
590 
591 float RoR::Terrain::getWaterHeight() const { return m_def->water_height; }
ROR_ASSERT
#define ROR_ASSERT(_EXPR)
Definition: Application.h:40
RoR::ScriptEngine::unloadScript
void unloadScript(ScriptUnitID_t unique_id)
Unloads a script.
Definition: ScriptEngine.cpp:1066
RoR::Terrain::initCamera
void initCamera()
Definition: Terrain.cpp:227
RoR::GUIManager::SurveyMap
GUI::SurveyMap SurveyMap
Definition: GUIManager.h:135
RoR::Terrain::GetDef
Terrn2DocumentPtr GetDef()
Definition: Terrain.cpp:577
SkyXManager.h
y
float y
Definition: (ValueTypes) quaternion.h:6
RoR::Terrain::Terrain
Terrain(CacheEntryPtr entry, Terrn2DocumentPtr def)
Definition: Terrain.cpp:54
RoR::Terrain::fixCompositorClearColor
void fixCompositorClearColor()
Definition: Terrain.cpp:358
RoR::Terrain::getMaxTerrainSize
Ogre::Vector3 getMaxTerrainSize()
Definition: Terrain.cpp:498
RoR::SCRIPTUNITID_INVALID
static const ScriptUnitID_t SCRIPTUNITID_INVALID
Definition: ForwardDeclarations.h:42
RoR::App::GetCameraManager
CameraManager * GetCameraManager()
Definition: Application.cpp:279
RoR::App::GetGuiManager
GUIManager * GetGuiManager()
Definition: Application.cpp:273
RoR::Collisions
Definition: Collisions.h:80
RoR::Terrain::initScripting
void initScripting()
Definition: Terrain.cpp:451
RoR::TerrainObjectManager
Definition: TerrainObjectManager.h:58
RoR::Terrain::initShadows
void initShadows()
Definition: Terrain.cpp:429
z
float z
Definition: (ValueTypes) quaternion.h:7
SkyManager.h
Renderdash.h
ContentManager.h
RoR::Terrain::getTerrainFileResourceGroup
std::string getTerrainFileResourceGroup()
Definition: Terrain.cpp:557
RoR::Terrain::isFlat
bool isFlat()
Definition: Terrain.cpp:520
RoR::Terrain::getSkyManager
SkyManager * getSkyManager()
Definition: Terrain.cpp:515
TerrainGeometryManager.h
Terrn2FileFormat.h
RoR::Terrain::setGravity
void setGravity(float value)
Definition: Terrain.cpp:483
RoR::ShadowManager
Definition: ShadowManager.h:51
RoR::HydraxWater
Definition: HydraxWater.h:34
RoR::Terrain::~Terrain
virtual ~Terrain() override
Definition: Terrain.cpp:71
RoR::GfxScene::CreateDustPools
void CreateDustPools()
Definition: GfxScene.cpp:49
RoR::GfxWaterMode::NONE
@ NONE
None.
RoR::ScriptEngine::setForwardScriptLogToConsole
void setForwardScriptLogToConsole(bool doForward)
Definition: ScriptEngine.cpp:1084
DEFAULT_TERRAIN_SCRIPT
#define DEFAULT_TERRAIN_SCRIPT
Definition: ScriptEngine.h:30
RoR::Water
Definition: Water.h:40
RoR::Terrain::initSkySubSystem
void initSkySubSystem()
Definition: Terrain.cpp:255
RoR::CameraManager::GetCameraNode
Ogre::SceneNode * GetCameraNode()
Definition: CameraManager.h:63
RoR::Terrain::getTerrainCollisionAAB
Ogre::AxisAlignedBox getTerrainCollisionAAB()
Definition: Terrain.cpp:493
Utils.h
Language.h
RoR::Terrn2DocumentPtr
std::shared_ptr< Terrn2Document > Terrn2DocumentPtr
Definition: ForwardDeclarations.h:223
RoR::GUI::TopMenubar::LoadBundledAiPresets
void LoadBundledAiPresets(TerrainPtr terrain)
Loads JSON files from [AI Presets] section in .terrn2 file format.
Definition: GUI_TopMenubar.cpp:2523
TerrainObjectManager.h
RefCountingObjectPtr< CacheEntry >
GUIManager.h
ActorManager.h
RoR::Terrain::getProceduralManager
ProceduralManagerPtr getProceduralManager()
Definition: Terrain.cpp:547
Actor.h
RoR::App::GetScriptEngine
ScriptEngine * GetScriptEngine()
Definition: Application.cpp:283
RoR::Terrain::getTerrainName
std::string getTerrainName() const
Definition: Terrain.cpp:579
RoR::GUIManager::LoadingWindow
GUI::LoadingWindow LoadingWindow
Definition: GUIManager.h:132
RoR::GfxScene::GetSceneManager
Ogre::SceneManager * GetSceneManager()
Definition: GfxScene.h:69
RoR::Terrain::getTerrainFileName
std::string getTerrainFileName()
Definition: Terrain.cpp:552
GUI_SurveyMap.h
RoR::Terrain::GetNormalAt
Ogre::Vector3 GetNormalAt(float x, float y, float z)
Definition: Terrain.cpp:510
RoR::Terrain::getWaterHeight
float getWaterHeight() const
Definition: Terrain.cpp:591
RoR::SurveyMapEntityVec
std::vector< SurveyMapEntity > SurveyMapEntityVec
Definition: SurveyMapEntity.h:56
RoR::CameraManager::GetCamera
Ogre::Camera * GetCamera()
Definition: CameraManager.h:64
RoR::Terrain::addSurveyMapEntity
void addSurveyMapEntity(const std::string &type, const std::string &filename, const std::string &resource_group, const std::string &caption, const Ogre::Vector3 &pos, float angle, int id)
Definition: Terrain.cpp:562
RoR::Terrain::initLight
void initLight()
Definition: Terrain.cpp:301
RoR::GfxSkyMode::CAELUM
@ CAELUM
Caelum (best looking, slower)
RoR::Terrain::getHeightAt
float getHeightAt(float x, float z)
Definition: Terrain.cpp:505
RoR::Terrain::initAiPresets
void initAiPresets()
Definition: Terrain.cpp:475
GUI_LoadingWindow.h
CacheSystem.h
A database of user-installed content alias 'mods' (vehicles, terrains...)
ScriptEngine.h
RoR::App::app_state
CVar * app_state
Definition: Application.cpp:79
RoR::Terrain::getSurveyMapEntities
SurveyMapEntityVec & getSurveyMapEntities()
Definition: Terrain.cpp:572
RoR::App::sim_terrain_name
CVar * sim_terrain_name
Definition: Application.cpp:97
GfxScene.h
RoR::Terrain::initFog
void initFog()
Definition: Terrain.cpp:331
RoR::GfxVegetation::FULL
@ FULL
RoR::Terrain::LoadPredefinedActors
void LoadPredefinedActors()
Definition: Terrain.cpp:534
RoR::Terrain::dispose
void dispose()
Definition: Terrain.cpp:79
RoR::App::gfx_water_mode
CVar * gfx_water_mode
Definition: Application.cpp:224
RoR::AppState::SHUTDOWN
@ SHUTDOWN
RoR::GUI::SurveyMap::CreateTerrainTextures
void CreateTerrainTextures()
Definition: GUI_SurveyMap.cpp:440
RoR::App::gfx_sky_mode
CVar * gfx_sky_mode
Definition: Application.cpp:219
RoR::GUIManager::TopMenubar
GUI::TopMenubar TopMenubar
Definition: GUIManager.h:133
RoR::App::gfx_sight_range
CVar * gfx_sight_range
Definition: Application.cpp:236
ShadowManager.h
RoR::Terrain::initTerrainCollisions
void initTerrainCollisions()
Definition: Terrain.cpp:443
RoR::GfxSkyMode::SKYX
@ SKYX
SkyX (best looking, slower)
RoR::Terrain::getVersion
int getVersion() const
Definition: Terrain.cpp:583
RoR::Terrain::initialize
bool initialize()
Definition: Terrain.cpp:146
_L
#define _L
Definition: ErrorUtils.cpp:35
RoR::Terrain::loadTerrainObjects
void loadTerrainObjects()
Definition: Terrain.cpp:435
RoR::Terrain::getSpawnPos
Ogre::Vector3 getSpawnPos()
Definition: Terrain.cpp:587
RoR::Terrain::getSpawnRot
Ogre::Degree getSpawnRot()
Definition: Terrain.cpp:589
RoR::Terrain::LoadTelepoints
void LoadTelepoints()
Definition: Terrain.cpp:528
RoR::Terrain::getCacheEntry
CacheEntryPtr getCacheEntry()
Definition: Terrain.cpp:585
RoR::EraseIf
void EraseIf(std::vector< T, A > &c, Predicate pred)
Definition: Utils.h:75
RoR::Terrain::initVegetation
void initVegetation()
Definition: Terrain.cpp:339
Terrain.h
RoR::Terrain::getGUID
std::string getGUID() const
Definition: Terrain.cpp:581
Ogre
Definition: ExtinguishableFireAffector.cpp:35
DEFAULT_GRAVITY
static const float DEFAULT_GRAVITY
earth gravity
Definition: SimConstants.h:50
RoR::CVar::getInt
int getInt() const
Definition: CVar.h:97
RoR::App::sim_terrain_gui_name
CVar * sim_terrain_gui_name
Definition: Application.cpp:98
RoR::App::gfx_vegetation_mode
CVar * gfx_vegetation_mode
Definition: Application.cpp:223
RoR::Terrain::delSurveyMapEntities
void delSurveyMapEntities(int id)
Definition: Terrain.cpp:567
Collisions.h
RoR::Terrain::initWater
void initWater()
Definition: Terrain.cpp:385
RoR::TerrainGeometryManager
this class handles all interactions with the Ogre Terrain system
Definition: TerrainGeometryManager.h:38
RoR::SurveyMapEntity
Definition: SurveyMapEntity.h:35
RoR
Definition: AppContext.h:36
RoR::Terrain::initObjects
void initObjects()
Definition: Terrain.cpp:488
x
float x
Definition: (ValueTypes) quaternion.h:5
Water.h
RoR::App::GetGfxScene
GfxScene * GetGfxScene()
Definition: Application.cpp:280
RoR::CVar::setStr
void setStr(std::string const &str)
Definition: CVar.h:83
RoR::GfxVegetation::x20PERC
@ x20PERC
HydraxWater.h
RoR::SkyXManager
Definition: SkyXManager.h:32
RoR::GfxVegetation::x50PERC
@ x50PERC
RoR::GfxWaterMode::HYDRAX
@ HYDRAX
HydraX.
RoR::Terrain::HasPredefinedActors
bool HasPredefinedActors()
Definition: Terrain.cpp:540