Rigs of Rods 2026.01
Soft-body Physics Simulation
Loading...
Searching...
No Matches
DustPool.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
6 For more information, see http://www.rigsofrods.org/
7
8 Rigs of Rods is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License version 3, as
10 published by the Free Software Foundation.
11
12 Rigs of Rods is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#pragma once
22
23#include "Application.h"
24
25#include <mutex>
26#include <Ogre.h>
27
28namespace RoR {
29
32
34{
35public:
36
37 DustPool(Ogre::SceneManager* sm, const char* dname, int dsize, const std::string& custom_name = "");
38 ~DustPool();
39
40 void Discard(Ogre::SceneManager* sm);
41
42 void AdjustDustPoolSpeedFactor(GfxActor* gfx_actor = nullptr);
43
44 void setVisible(bool s);
45 //Dust
46 void malloc(Ogre::Vector3 pos, Ogre::Vector3 vel, Ogre::ColourValue col = Ogre::ColourValue(0.83, 0.71, 0.64, 1.0));
47 //clumps
48 void allocClump(Ogre::Vector3 pos, Ogre::Vector3 vel, Ogre::ColourValue col = Ogre::ColourValue(0.83, 0.71, 0.64, 1.0));
49 //Rubber smoke
50 void allocSmoke(Ogre::Vector3 pos, Ogre::Vector3 vel);
51 //
52 void allocSparks(Ogre::Vector3 pos, Ogre::Vector3 vel);
53 //Water vapour
54 void allocVapour(Ogre::Vector3 pos, Ogre::Vector3 vel, float time);
55
56 void allocDrip(Ogre::Vector3 pos, Ogre::Vector3 vel, float time);
57
58 void allocSplash(Ogre::Vector3 pos, Ogre::Vector3 vel);
59
60 void allocRipple(Ogre::Vector3 pos, Ogre::Vector3 vel);
61
62 void update();
63
64protected:
65
66 static const int MAX_DUSTS = 100;
67
79
80 Ogre::ColourValue colours[MAX_DUSTS];
81 Ogre::ParticleSystem* pss[MAX_DUSTS];
82 Ogre::SceneNode* sns[MAX_DUSTS];
83 Ogre::SceneNode* parent_snode;
84 Ogre::Vector3 positions[MAX_DUSTS];
85 Ogre::Vector3 velocities[MAX_DUSTS];
88 int size;
91};
92
94
95} // namespace RoRs
Central state/object manager and communications hub.
Ogre::SceneNode * sns[MAX_DUSTS]
Definition DustPool.h:82
void Discard(Ogre::SceneManager *sm)
Definition DustPool.cpp:69
void allocRipple(Ogre::Vector3 pos, Ogre::Vector3 vel)
Definition DustPool.cpp:183
Ogre::Vector3 positions[MAX_DUSTS]
Definition DustPool.h:84
Ogre::Vector3 velocities[MAX_DUSTS]
Velocity in wall time, ignoring the time scale.
Definition DustPool.h:85
int types[MAX_DUSTS]
Definition DustPool.h:89
void allocVapour(Ogre::Vector3 pos, Ogre::Vector3 vel, float time)
Definition DustPool.cpp:148
Ogre::ParticleSystem * pss[MAX_DUSTS]
Definition DustPool.h:81
Ogre::SceneNode * parent_snode
Definition DustPool.h:83
Ogre::ColourValue colours[MAX_DUSTS]
Definition DustPool.h:80
void AdjustDustPoolSpeedFactor(GfxActor *gfx_actor=nullptr)
Definition DustPool.cpp:194
bool m_is_discarded
Definition DustPool.h:90
void allocSmoke(Ogre::Vector3 pos, Ogre::Vector3 vel)
Definition DustPool.cpp:122
void allocSparks(Ogre::Vector3 pos, Ogre::Vector3 vel)
Definition DustPool.cpp:134
void allocClump(Ogre::Vector3 pos, Ogre::Vector3 vel, Ogre::ColourValue col=Ogre::ColourValue(0.83, 0.71, 0.64, 1.0))
Definition DustPool.cpp:109
void setVisible(bool s)
Definition DustPool.cpp:87
void allocSplash(Ogre::Vector3 pos, Ogre::Vector3 vel)
Definition DustPool.cpp:172
float rates[MAX_DUSTS]
Definition DustPool.h:86
static const int MAX_DUSTS
Definition DustPool.h:66
void malloc(Ogre::Vector3 pos, Ogre::Vector3 vel, Ogre::ColourValue col=Ogre::ColourValue(0.83, 0.71, 0.64, 1.0))
Definition DustPool.cpp:96
void allocDrip(Ogre::Vector3 pos, Ogre::Vector3 vel, float time)
Definition DustPool.cpp:160