RigsofRods
Soft-body Physics Simulation
ExtinguishableFireAffector.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 #ifdef USE_ANGELSCRIPT
24 
25 #include <OgreParticleAffector.h>
26 #include <OgreVector3.h>
27 #include <OgreVector2.h>
28 
29 namespace Ogre {
30 
33 
36 
45 class ExtinguishableFireAffector : public ParticleAffector
46 {
47 public:
49  class CmdMiddlePoint : public ParamCommand
50  {
51  public:
52  String doGet(const void* target) const;
53  void doSet(void* target, const String& val);
54  };
55 
57  class CmdIntensity : public ParamCommand
58  {
59  public:
60  String doGet(const void* target) const;
61  void doSet(void* target, const String& val);
62  };
63 
65  class CmdMaxIntensity : public ParamCommand
66  {
67  public:
68  String doGet(const void* target) const;
69  void doSet(void* target, const String& val);
70  };
71 
73  class CmdIntensityGrowth : public ParamCommand
74  {
75  public:
76  String doGet(const void* target) const;
77  void doSet(void* target, const String& val);
78  };
79 
81  class CmdRadius : public ParamCommand
82  {
83  public:
84  String doGet(const void* target) const;
85  void doSet(void* target, const String& val);
86  };
87 
89  ExtinguishableFireAffector(ParticleSystem* psys);
90 
93 
95  void _affectParticles(ParticleSystem* pSystem, Real timeElapsed);
96 
98  void setMiddlePoint(const Vector3& pos);
99 
101  Vector3 getMiddlePoint(void) const;
102 
104  void setIntensity(Real intensity);
105 
107  Real getIntensity(void) const;
108 
110  void setMaxIntensity(Real intensity);
111 
113  Real getMaxIntensity(void) const;
114 
116  void setIntensityGrowth(Real intensity);
117 
119  Real getIntensityGrowth(void) const;
120 
122  void setRadius(Real radius);
123 
125  Real getRadius(void) const;
126 
127  bool isTemplate() const;
128  Vector3 getAbsoluteMiddlePoint(void) const;
129  Real reduceIntensity(Real amount);
130  ParticleSystem* getParticleSystem() { return mPsys; };
131 
133  void setInstanceName(String iname) { objectInstanceName = iname; };
134  String getInstanceName() { return objectInstanceName; };
135 
137  static CmdMiddlePoint msMiddlePointCmd;
142 
143 protected:
145  Vector3 mMiddlePoint;
146 
148  Real mRadius;
149 
152 
153  ParticleSystem* mPsys;
154 
161 
164 };
165 
166 } // namespace Ogre
167 
168 #endif // USE_ANGELSCRIPT
Ogre::ExtinguishableFireAffector::CmdMiddlePoint::doSet
void doSet(void *target, const String &val)
Definition: ExtinguishableFireAffector.cpp:194
Ogre::ExtinguishableFireAffector::mMiddlePoint
Vector3 mMiddlePoint
sphere middle point
Definition: ExtinguishableFireAffector.h:145
Ogre::ExtinguishableFireAffector::originalIntensity
Real originalIntensity
Definition: ExtinguishableFireAffector.h:155
Ogre::ExtinguishableFireAffector::setMiddlePoint
void setMiddlePoint(const Vector3 &pos)
Sets the sphere middle point.
Definition: ExtinguishableFireAffector.cpp:126
Ogre::ExtinguishableFireAffector::getIntensityGrowth
Real getIntensityGrowth(void) const
Gets the intensity growth rate.
Definition: ExtinguishableFireAffector.cpp:174
Ogre::ExtinguishableFireAffector::setInstanceName
void setInstanceName(String iname)
Sets the instance name of the parent object for this particle system.
Definition: ExtinguishableFireAffector.h:133
Ogre::ExtinguishableFireAffector::setIntensity
void setIntensity(Real intensity)
Sets the intensity.
Definition: ExtinguishableFireAffector.cpp:131
Ogre::ExtinguishableFireAffector::getRadius
Real getRadius(void) const
Gets the radius for the interaction with the FireExtiniguisher affector.
Definition: ExtinguishableFireAffector.cpp:179
Ogre::ExtinguishableFireAffector::CmdMiddlePoint::doGet
String doGet(const void *target) const
Definition: ExtinguishableFireAffector.cpp:189
Ogre::ExtinguishableFireAffector::ExtinguishableFireAffector
ExtinguishableFireAffector(ParticleSystem *psys)
Default constructor.
Definition: ExtinguishableFireAffector.cpp:45
Ogre::ExtinguishableFireAffector::getAbsoluteMiddlePoint
Vector3 getAbsoluteMiddlePoint(void) const
Definition: ExtinguishableFireAffector.cpp:157
Ogre::ExtinguishableFireAffector::msRadiusCmd
static CmdRadius msRadiusCmd
Definition: ExtinguishableFireAffector.h:141
Ogre::ExtinguishableFireAffector::setMaxIntensity
void setMaxIntensity(Real intensity)
Sets the maximum intensity.
Definition: ExtinguishableFireAffector.cpp:136
Ogre::ExtinguishableFireAffector::mPsys
ParticleSystem * mPsys
Definition: ExtinguishableFireAffector.h:153
Ogre::ExtinguishableFireAffector::msMaxIntensityCmd
static CmdMaxIntensity msMaxIntensityCmd
Definition: ExtinguishableFireAffector.h:139
Ogre::ExtinguishableFireAffector::mIntensityGrowth
Real mIntensityGrowth
Definition: ExtinguishableFireAffector.h:159
Ogre::ExtinguishableFireAffector::mRadius
Real mRadius
radius of the sphere
Definition: ExtinguishableFireAffector.h:148
Ogre::ExtinguishableFireAffector::CmdIntensity
Command object for intensity (see ParamCommand).
Definition: ExtinguishableFireAffector.h:57
Ogre::ExtinguishableFireAffector::CmdMiddlePoint
Command object for middle point (see ParamCommand).
Definition: ExtinguishableFireAffector.h:49
Ogre::ExtinguishableFireAffector::msIntensityCmd
static CmdIntensity msIntensityCmd
Definition: ExtinguishableFireAffector.h:138
Ogre::ExtinguishableFireAffector::CmdIntensityGrowth::doGet
String doGet(const void *target) const
Definition: ExtinguishableFireAffector.cpp:224
Ogre::ExtinguishableFireAffector::getMaxIntensity
Real getMaxIntensity(void) const
Gets the maximum intensity.
Definition: ExtinguishableFireAffector.cpp:169
Ogre::ExtinguishableFireAffector::reduceIntensity
Real reduceIntensity(Real amount)
Definition: ExtinguishableFireAffector.cpp:252
Ogre::ExtinguishableFireAffector::getParticleSystem
ParticleSystem * getParticleSystem()
Definition: ExtinguishableFireAffector.h:130
Ogre::ExtinguishableFireAffector::CmdRadius
Command object for radius (see ParamCommand).
Definition: ExtinguishableFireAffector.h:81
Ogre::ExtinguishableFireAffector::CmdMaxIntensity::doSet
void doSet(void *target, const String &val)
Definition: ExtinguishableFireAffector.cpp:218
Ogre::ExtinguishableFireAffector::CmdIntensity::doGet
String doGet(const void *target) const
Definition: ExtinguishableFireAffector.cpp:200
Ogre::ExtinguishableFireAffector::msMiddlePointCmd
static CmdMiddlePoint msMiddlePointCmd
Command objects.
Definition: ExtinguishableFireAffector.h:134
Ogre::ExtinguishableFireAffector::getMiddlePoint
Vector3 getMiddlePoint(void) const
Gets the sphere middle point.
Definition: ExtinguishableFireAffector.cpp:152
Ogre::ExtinguishableFireAffector::CmdIntensityGrowth
Command object for intensity growth (see ParamCommand).
Definition: ExtinguishableFireAffector.h:73
Ogre::ExtinguishableFireAffector::CmdRadius::doSet
void doSet(void *target, const String &val)
Definition: ExtinguishableFireAffector.cpp:242
Ogre::ExtinguishableFireAffector
This class defines a ParticleAffector which deflects particles.
Definition: ExtinguishableFireAffector.h:45
Ogre::ExtinguishableFireAffector::isTemplate
bool isTemplate() const
Definition: ExtinguishableFireAffector.cpp:248
Ogre::ExtinguishableFireAffector::getIntensity
Real getIntensity(void) const
Gets the intensity.
Definition: ExtinguishableFireAffector.cpp:164
Ogre::ExtinguishableFireAffector::setIntensityGrowth
void setIntensityGrowth(Real intensity)
Sets the intensity growth rate.
Definition: ExtinguishableFireAffector.cpp:141
Ogre::ExtinguishableFireAffector::CmdIntensity::doSet
void doSet(void *target, const String &val)
Definition: ExtinguishableFireAffector.cpp:206
Ogre::ExtinguishableFireAffector::updateIntensityRequired
bool updateIntensityRequired
Definition: ExtinguishableFireAffector.h:156
Ogre::ExtinguishableFireAffector::CmdRadius::doGet
String doGet(const void *target) const
Definition: ExtinguishableFireAffector.cpp:236
Ogre::ExtinguishableFireAffector::setRadius
void setRadius(Real radius)
Sets the radius for the interaction with the FireExtiniguisher affector.
Definition: ExtinguishableFireAffector.cpp:146
Ogre::ExtinguishableFireAffector::~ExtinguishableFireAffector
~ExtinguishableFireAffector()
Destructor.
Definition: ExtinguishableFireAffector.cpp:89
Ogre::ExtinguishableFireAffector::objectInstanceName
String objectInstanceName
The instance name of the parent object.
Definition: ExtinguishableFireAffector.h:163
Ogre::ExtinguishableFireAffector::getInstanceName
String getInstanceName()
Definition: ExtinguishableFireAffector.h:134
Ogre::ExtinguishableFireAffector::msIntensityGrowthCmd
static CmdIntensityGrowth msIntensityGrowthCmd
Definition: ExtinguishableFireAffector.h:140
Ogre
Definition: ExtinguishableFireAffector.cpp:35
Ogre::ExtinguishableFireAffector::firstFrame
bool firstFrame
Definition: ExtinguishableFireAffector.h:158
Ogre::ExtinguishableFireAffector::CmdIntensityGrowth::doSet
void doSet(void *target, const String &val)
Definition: ExtinguishableFireAffector.cpp:230
Ogre::ExtinguishableFireAffector::mIntensity
Real mIntensity
Intensity of the fire.
Definition: ExtinguishableFireAffector.h:151
Ogre::ExtinguishableFireAffector::CmdMaxIntensity
Command object for maximum intensity (see ParamCommand).
Definition: ExtinguishableFireAffector.h:65
Ogre::ExtinguishableFireAffector::mMaxIntensity
Real mMaxIntensity
Definition: ExtinguishableFireAffector.h:160
Ogre::ExtinguishableFireAffector::_affectParticles
void _affectParticles(ParticleSystem *pSystem, Real timeElapsed)
See ParticleAffector.
Definition: ExtinguishableFireAffector.cpp:94
Ogre::ExtinguishableFireAffector::originalDimensions
Vector2 originalDimensions
Definition: ExtinguishableFireAffector.h:157
Ogre::ExtinguishableFireAffector::CmdMaxIntensity::doGet
String doGet(const void *target) const
Definition: ExtinguishableFireAffector.cpp:212