RigsofRods
Soft-body Physics Simulation
GfxScene.h
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2005-2012 Pierre-Michel Ricordel
4  Copyright 2007-2012 Thomas Fischer
5  Copyright 2013-2020 Petr Ohlidal
6 
7  For more information, see http://www.rigsofrods.org/
8 
9  Rigs of Rods is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License version 3, as
11  published by the Free Software Foundation.
12 
13  Rigs of Rods is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
25 
26 #pragma once
27 
28 #include "CameraManager.h"
29 #include "ForwardDeclarations.h"
30 #include "EnvironmentMap.h" // RoR::GfxEnvmap
31 #include "SimBuffers.h"
32 #include "Skidmark.h"
33 
34 #include <map>
35 #include <string>
36 #include <memory>
37 
38 namespace RoR {
39 
42 
45 class GfxScene
46 {
47 public:
48 
49  void Init();
50  void CreateDustPools();
51  DustPool* GetDustPool(const char* name);
52  void SetParticlesVisible(bool visible);
53  void DrawNetLabel(Ogre::Vector3 pos, float cam_dist, std::string const& nick, int colornum);
54  void UpdateScene(float dt_sec);
55  void ClearScene();
56  void RegisterGfxActor(RoR::GfxActor* gfx_actor);
57  void RemoveGfxActor(RoR::GfxActor* gfx_actor);
58  void RegisterGfxCharacter(RoR::GfxCharacter* gfx_character);
59  void RemoveGfxCharacter(RoR::GfxCharacter* gfx_character);
60  void BufferSimulationData();
62  GfxEnvmap& GetEnvMap() { return m_envmap; }
64  Ogre::SceneManager* GetSceneManager() { return m_scene_manager; }
65  std::vector<GfxActor*>& GetGfxActors() { return m_all_gfx_actors; }
66  std::vector<GfxCharacter*>& GetGfxCharacters() { return m_all_gfx_characters; }
67 
68 private:
69 
70  std::map<std::string, DustPool *> m_dustpools;
71  Ogre::SceneManager* m_scene_manager = nullptr;
72  std::vector<GfxActor*> m_all_gfx_actors;
73  std::vector<GfxActor*> m_live_gfx_actors;
74  std::vector<GfxCharacter*> m_all_gfx_characters;
78 };
79 
81 
82 } // namespace RoR
RoR::SkidmarkConfig
< Skidmark config file parser and data container
Definition: Skidmark.h:32
RoR::GfxScene::DrawNetLabel
void DrawNetLabel(Ogre::Vector3 pos, float cam_dist, std::string const &nick, int colornum)
Definition: GfxScene.cpp:339
RoR::GfxScene::RegisterGfxCharacter
void RegisterGfxCharacter(RoR::GfxCharacter *gfx_character)
Definition: GfxScene.cpp:325
ForwardDeclarations.h
Global forward declarations.
RoR::GfxScene::GetGfxActors
std::vector< GfxActor * > & GetGfxActors()
Definition: GfxScene.h:65
RoR::GfxScene::GetEnvMap
GfxEnvmap & GetEnvMap()
Definition: GfxScene.h:62
RoR::DustPool
Definition: DustPool.h:33
RoR::GfxScene::GetSimDataBuffer
GameContextSB & GetSimDataBuffer()
Definition: GfxScene.h:61
RoR::GameContextSB
Definition: SimBuffers.h:196
RoR::GfxScene::BufferSimulationData
void BufferSimulationData()
Run this when simulation is halted.
Definition: GfxScene.cpp:281
EnvironmentMap.h
RoR::GfxScene::RemoveGfxActor
void RemoveGfxActor(RoR::GfxActor *gfx_actor)
Definition: GfxScene.cpp:316
RoR::GfxScene::GetGfxCharacters
std::vector< GfxCharacter * > & GetGfxCharacters()
Definition: GfxScene.h:66
RoR::GfxScene::SetParticlesVisible
void SetParticlesVisible(bool visible)
Definition: GfxScene.cpp:255
CameraManager.h
RoR::GfxScene::ClearScene
void ClearScene()
Definition: GfxScene.cpp:60
RoR::GfxScene::CreateDustPools
void CreateDustPools()
Definition: GfxScene.cpp:49
RoR::GfxScene::UpdateScene
void UpdateScene(float dt_sec)
Definition: GfxScene.cpp:90
RoR::GfxScene::m_all_gfx_characters
std::vector< GfxCharacter * > m_all_gfx_characters
Definition: GfxScene.h:74
RoR::GfxScene::GetSceneManager
Ogre::SceneManager * GetSceneManager()
Definition: GfxScene.h:64
RoR::GfxScene
Provides a 3D graphical representation of the simulation Idea: simulation runs at it's own constant r...
Definition: GfxScene.h:45
RoR::GfxScene::m_simbuf
GameContextSB m_simbuf
Definition: GfxScene.h:76
RoR::GfxScene::m_live_gfx_actors
std::vector< GfxActor * > m_live_gfx_actors
Definition: GfxScene.h:73
RoR::GfxScene::RegisterGfxActor
void RegisterGfxActor(RoR::GfxActor *gfx_actor)
Definition: GfxScene.cpp:276
RoR::GfxScene::m_dustpools
std::map< std::string, DustPool * > m_dustpools
Definition: GfxScene.h:70
RoR::GfxCharacter
Definition: Character.h:99
RoR::GfxScene::GetSkidmarkConf
RoR::SkidmarkConfig * GetSkidmarkConf()
Definition: GfxScene.h:63
RoR::GfxScene::GetDustPool
DustPool * GetDustPool(const char *name)
Definition: GfxScene.cpp:263
RoR::GfxScene::m_skidmark_conf
SkidmarkConfig m_skidmark_conf
Definition: GfxScene.h:77
RoR::GfxScene::m_scene_manager
Ogre::SceneManager * m_scene_manager
Definition: GfxScene.h:71
Skidmark.h
RoR::GfxEnvmap
A dynamic environment probe; Creates a cubemap with realtime reflections around specified point.
Definition: EnvironmentMap.h:33
RoR::GfxScene::RemoveGfxCharacter
void RemoveGfxCharacter(RoR::GfxCharacter *gfx_character)
Definition: GfxScene.cpp:330
RoR::GfxActor
Definition: GfxActor.h:52
RoR::GfxScene::m_envmap
RoR::GfxEnvmap m_envmap
Definition: GfxScene.h:75
RoR::GfxScene::m_all_gfx_actors
std::vector< GfxActor * > m_all_gfx_actors
Definition: GfxScene.h:72
SimBuffers.h
RoR::GfxScene::Init
void Init()
Definition: GfxScene.cpp:82
RoR
Definition: AppContext.h:36