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
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);
38 ~DustPool();
39
40 void Discard(Ogre::SceneManager* sm);
41
42 void setVisible(bool s);
43 //Dust
44 void malloc(Ogre::Vector3 pos, Ogre::Vector3 vel, Ogre::ColourValue col = Ogre::ColourValue(0.83, 0.71, 0.64, 1.0));
45 //clumps
46 void allocClump(Ogre::Vector3 pos, Ogre::Vector3 vel, Ogre::ColourValue col = Ogre::ColourValue(0.83, 0.71, 0.64, 1.0));
47 //Rubber smoke
48 void allocSmoke(Ogre::Vector3 pos, Ogre::Vector3 vel);
49 //
50 void allocSparks(Ogre::Vector3 pos, Ogre::Vector3 vel);
51 //Water vapour
52 void allocVapour(Ogre::Vector3 pos, Ogre::Vector3 vel, float time);
53
54 void allocDrip(Ogre::Vector3 pos, Ogre::Vector3 vel, float time);
55
56 void allocSplash(Ogre::Vector3 pos, Ogre::Vector3 vel);
57
58 void allocRipple(Ogre::Vector3 pos, Ogre::Vector3 vel);
59
60 void update();
61
62protected:
63
64 static const int MAX_DUSTS = 100;
65
77
78 Ogre::ColourValue colours[MAX_DUSTS];
79 Ogre::ParticleSystem* pss[MAX_DUSTS];
80 Ogre::SceneNode* sns[MAX_DUSTS];
81 Ogre::SceneNode* parent_snode;
82 Ogre::Vector3 positions[MAX_DUSTS];
83 Ogre::Vector3 velocities[MAX_DUSTS];
86 int size;
89};
90
92
93} // namespace RoRs
Central state/object manager and communications hub.
Ogre::SceneNode * sns[MAX_DUSTS]
Definition DustPool.h:80
void Discard(Ogre::SceneManager *sm)
Definition DustPool.cpp:70
void allocRipple(Ogre::Vector3 pos, Ogre::Vector3 vel)
Definition DustPool.cpp:184
Ogre::Vector3 positions[MAX_DUSTS]
Definition DustPool.h:82
Ogre::Vector3 velocities[MAX_DUSTS]
Velocity in wall time, ignoring the time scale.
Definition DustPool.h:83
int types[MAX_DUSTS]
Definition DustPool.h:87
void allocVapour(Ogre::Vector3 pos, Ogre::Vector3 vel, float time)
Definition DustPool.cpp:149
Ogre::ParticleSystem * pss[MAX_DUSTS]
Definition DustPool.h:79
Ogre::SceneNode * parent_snode
Definition DustPool.h:81
Ogre::ColourValue colours[MAX_DUSTS]
Definition DustPool.h:78
bool m_is_discarded
Definition DustPool.h:88
void allocSmoke(Ogre::Vector3 pos, Ogre::Vector3 vel)
Definition DustPool.cpp:123
void allocSparks(Ogre::Vector3 pos, Ogre::Vector3 vel)
Definition DustPool.cpp:135
void allocClump(Ogre::Vector3 pos, Ogre::Vector3 vel, Ogre::ColourValue col=Ogre::ColourValue(0.83, 0.71, 0.64, 1.0))
Definition DustPool.cpp:110
void setVisible(bool s)
Definition DustPool.cpp:88
void allocSplash(Ogre::Vector3 pos, Ogre::Vector3 vel)
Definition DustPool.cpp:173
float rates[MAX_DUSTS]
Definition DustPool.h:84
static const int MAX_DUSTS
Definition DustPool.h:64
void malloc(Ogre::Vector3 pos, Ogre::Vector3 vel, Ogre::ColourValue col=Ogre::ColourValue(0.83, 0.71, 0.64, 1.0))
Definition DustPool.cpp:97
void allocDrip(Ogre::Vector3 pos, Ogre::Vector3 vel, float time)
Definition DustPool.cpp:161