Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
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 "GfxData.h"
32#include "SimBuffers.h"
33#include "Skidmark.h"
34
35#include <map>
36#include <string>
37#include <memory>
38
39namespace RoR {
40
43
47{
48public:
49
50 void Init();
51
54 void CreateDustPools();
55 DustPool* GetDustPool(const char* name);
56 void AdjustParticleSystemTimeFactor(Ogre::ParticleSystem* psys);
57 void SetParticlesVisible(bool visible);
59
66 void UpdateFreeBeamGfx(float dt);
70
71 void DrawNetLabel(Ogre::Vector3 pos, float cam_dist, std::string const& nick, int colornum);
72 void UpdateScene(float dt);
73 void ClearScene();
74 void RegisterGfxActor(RoR::GfxActor* gfx_actor);
75 void RemoveGfxActor(RoR::GfxActor* gfx_actor);
77 void RegisterGfxCharacter(RoR::GfxCharacter* gfx_character);
78 void RemoveGfxCharacter(RoR::GfxCharacter* gfx_character);
83 Ogre::SceneManager* GetSceneManager() { return m_scene_manager; }
84 std::vector<GfxActor*>& GetGfxActors() { return m_all_gfx_actors; }
85 std::vector<GfxCharacter*>& GetGfxCharacters() { return m_all_gfx_characters; }
86
87 static Ogre::Quaternion SpecialGetRotationTo(const Ogre::Vector3& src, const Ogre::Vector3& dest);
88
89private:
90
91 std::map<std::string, DustPool *> m_dustpools;
92 Ogre::SceneManager* m_scene_manager = nullptr;
93 std::vector<GfxActor*> m_all_gfx_actors;
94 std::vector<GfxActor*> m_live_gfx_actors;
95 std::vector<GfxCharacter*> m_all_gfx_characters;
99
100 // Free beams GFX:
101 std::vector<FreeBeamGfx> m_gfx_freebeams;
103 Ogre::SceneNode* m_gfx_freebeams_grouping_node = nullptr;
104};
105
107
108} // namespace RoR
Global forward declarations.
A dynamic environment probe; Creates a cubemap with realtime reflections around specified point.
Provides a 3D graphical representation of the simulation Idea: simulation runs at it's own constant r...
Definition GfxScene.h:47
FreeBeamGfxID_t m_gfx_freebeam_next_id
Definition GfxScene.h:102
void CreateDustPools()
Definition GfxScene.cpp:50
Ogre::SceneNode * m_gfx_freebeams_grouping_node
Only for nicer scenegraph when viewing through Inspector gadget.
Definition GfxScene.h:103
void ForceUpdateSingleGfxActor(RoR::GfxActor *gfx_actor)
Definition GfxScene.cpp:339
std::vector< GfxActor * > m_live_gfx_actors
Definition GfxScene.h:94
GfxEnvmap & GetEnvMap()
Definition GfxScene.h:81
void RegisterGfxActor(RoR::GfxActor *gfx_actor)
Definition GfxScene.cpp:290
static Ogre::Quaternion SpecialGetRotationTo(const Ogre::Vector3 &src, const Ogre::Vector3 &dest)
Definition GfxScene.cpp:581
void AdjustParticleSystemTimeFactor(Ogre::ParticleSystem *psys)
Definition GfxScene.cpp:435
void DrawNetLabel(Ogre::Vector3 pos, float cam_dist, std::string const &nick, int colornum)
Definition GfxScene.cpp:374
void ClearScene()
Definition GfxScene.cpp:61
GameContextSB m_simbuf
Definition GfxScene.h:97
void SetParticlesVisible(bool visible)
Definition GfxScene.cpp:269
std::vector< FreeBeamGfx > m_gfx_freebeams
Definition GfxScene.h:101
std::vector< GfxActor * > m_all_gfx_actors
Definition GfxScene.h:93
void RegisterGfxCharacter(RoR::GfxCharacter *gfx_character)
Definition GfxScene.cpp:360
std::map< std::string, DustPool * > m_dustpools
Definition GfxScene.h:91
void RemoveGfxActor(RoR::GfxActor *gfx_actor)
Definition GfxScene.cpp:330
RoR::GfxEnvmap m_envmap
Definition GfxScene.h:96
RoR::SkidmarkConfig * GetSkidmarkConf()
Definition GfxScene.h:82
DustPool * GetDustPool(const char *name)
Definition GfxScene.cpp:277
void RemoveFreeBeamGfx(FreeBeamGfxID_t id)
Definition GfxScene.cpp:489
Ogre::SceneManager * m_scene_manager
Definition GfxScene.h:92
std::vector< GfxCharacter * > m_all_gfx_characters
Definition GfxScene.h:95
FreeBeamGfxID_t GetFreeBeamGfxNextId()
Definition GfxScene.h:65
void OnFreeForceBroken(FreeForceID_t id)
Definition GfxScene.cpp:570
void RemoveGfxCharacter(RoR::GfxCharacter *gfx_character)
Definition GfxScene.cpp:365
void ModifyFreeBeamGfx(FreeBeamGfxRequest *rq)
Definition GfxScene.cpp:473
void OnFreeForceRemoved(FreeForceID_t id)
Definition GfxScene.cpp:549
Ogre::SceneManager * GetSceneManager()
Definition GfxScene.h:83
GameContextSB & GetSimDataBuffer()
Definition GfxScene.h:80
std::vector< GfxActor * > & GetGfxActors()
Definition GfxScene.h:84
void BufferSimulationData()
Run this when simulation is halted.
Definition GfxScene.cpp:295
SkidmarkConfig m_skidmark_conf
Definition GfxScene.h:98
void UpdateScene(float dt)
Definition GfxScene.cpp:94
void AddFreeBeamGfx(FreeBeamGfxRequest *rq)
Definition GfxScene.cpp:446
void UpdateFreeBeamGfx(float dt)
Definition GfxScene.cpp:506
std::vector< GfxCharacter * > & GetGfxCharacters()
Definition GfxScene.h:85
< Skidmark config file parser and data container
Definition Skidmark.h:33
int FreeForceID_t
Unique sequentially generated ID of FreeForce; use ActorManager::GetFreeForceNextId().
int FreeBeamGfxID_t
Index into GfxScene::m_gfx_freebeams, use RoR::FREEBEAMGFXID_INVALID as empty value.
Used by MSG_EDI_[ADD/MODIFY]_FREEBEAMGFX_REQUESTED; tailored for use with AngelScript thru GameScript...
Definition GfxData.h:292