28#include <OgreParticleSystem.h>
29#include <OgreParticle.h>
30#include <OgreStringConverter.h>
31#include <OgreSceneNode.h>
46 : ParticleAffector(psys), mPsys(psys)
48 mType =
"ExtinguishableFire";
61 if (createParamDictionary(
"ExtinguishableFireAffector"))
65 ParamDictionary* dict = getParamDictionary();
66 dict->addParameter(ParameterDef(
"middle_point",
67 "The middle point of the sphere on which water particles will interact.",
69 dict->addParameter(ParameterDef(
"intensity",
70 "The amount of water particles that a fire can withstand before being extinguished.",
72 dict->addParameter(ParameterDef(
"max_intensity",
73 "The maximum intensity the fire can grow to.",
75 dict->addParameter(ParameterDef(
"intensity_growth",
76 "The amount by which the intensity of the fire grows per second.",
78 dict->addParameter(ParameterDef(
"radius",
79 "The radius of the sphere.",
106 mPsys->removeAllEmitters();
159 Node* node =
mPsys->getParentNode();
161 return node->convertLocalToWorldPosition(
mMiddlePoint);;
191 return StringConverter::toString(
197 StringConverter::parseVector3(val));
202 return StringConverter::toString(
209 StringConverter::parseReal(val));
214 return StringConverter::toString(
221 StringConverter::parseReal(val));
226 return StringConverter::toString(
233 StringConverter::parseReal(val));
238 return StringConverter::toString(
245 StringConverter::parseReal(val));
250 return !(
mPsys->getParentNode());
Central state/object manager and communications hub.
Command object for intensity growth (see ParamCommand).
Command object for intensity (see ParamCommand).
Command object for maximum intensity (see ParamCommand).
Command object for middle point (see ParamCommand).
Command object for radius (see ParamCommand).
This class defines a ParticleAffector which deflects particles.
int fireEvent(std::string instanceName, float intensity)
Real getRadius(void) const
Gets the radius for the interaction with the FireExtiniguisher affector.
Vector3 mMiddlePoint
sphere middle point
Vector2 originalDimensions
void setMaxIntensity(Real intensity)
Sets the maximum intensity.
bool updateIntensityRequired
String doGet(const void *target) const
Vector3 getMiddlePoint(void) const
Gets the sphere middle point.
Real mRadius
radius of the sphere
void doSet(void *target, const String &val)
static CmdMiddlePoint msMiddlePointCmd
Command objects.
String doGet(const void *target) const
String doGet(const void *target) const
Real getMaxIntensity(void) const
Gets the maximum intensity.
void setRadius(Real radius)
Sets the radius for the interaction with the FireExtiniguisher affector.
Real mIntensity
Intensity of the fire.
void setMiddlePoint(const Vector3 &pos)
Sets the sphere middle point.
Vector3 getAbsoluteMiddlePoint(void) const
Real getIntensityGrowth(void) const
Gets the intensity growth rate.
void doSet(void *target, const String &val)
String doGet(const void *target) const
ExtinguishableFireAffector(ParticleSystem *psys)
Default constructor.
void doSet(void *target, const String &val)
void doSet(void *target, const String &val)
String objectInstanceName
The instance name of the parent object.
Real getIntensity(void) const
Gets the intensity.
Real reduceIntensity(Real amount)
void setIntensity(Real intensity)
Sets the intensity.
static CmdMaxIntensity msMaxIntensityCmd
static CmdRadius msRadiusCmd
void doSet(void *target, const String &val)
String doGet(const void *target) const
static CmdIntensityGrowth msIntensityGrowthCmd
void setIntensityGrowth(Real intensity)
Sets the intensity growth rate.
void _affectParticles(ParticleSystem *pSystem, Real timeElapsed)
See ParticleAffector.
static CmdIntensity msIntensityCmd
~ExtinguishableFireAffector()
Destructor.
ScriptEngine * GetScriptEngine()