|
RigsofRods
Soft-body Physics Simulation
|
Go to the documentation of this file.
21 #ifdef USE_ANGELSCRIPT
28 #include <OgreParticleSystem.h>
29 #include <OgreParticle.h>
30 #include <OgreStringConverter.h>
31 #include <OgreSceneNode.h>
45 ExtinguishableFireAffector::ExtinguishableFireAffector(ParticleSystem* psys)
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());
261 #endif // USE_ANGELSCRIPT
void doSet(void *target, const String &val)
Vector3 mMiddlePoint
sphere middle point
void setMiddlePoint(const Vector3 &pos)
Sets the sphere middle point.
Real getIntensityGrowth(void) const
Gets the intensity growth rate.
void setIntensity(Real intensity)
Sets the intensity.
Real getRadius(void) const
Gets the radius for the interaction with the FireExtiniguisher affector.
String doGet(const void *target) const
Vector3 getAbsoluteMiddlePoint(void) const
static CmdRadius msRadiusCmd
void setMaxIntensity(Real intensity)
Sets the maximum intensity.
ScriptEngine * GetScriptEngine()
static CmdMaxIntensity msMaxIntensityCmd
Real mRadius
radius of the sphere
Command object for intensity (see ParamCommand).
Command object for middle point (see ParamCommand).
static CmdIntensity msIntensityCmd
String doGet(const void *target) const
Real getMaxIntensity(void) const
Gets the maximum intensity.
Real reduceIntensity(Real amount)
Command object for radius (see ParamCommand).
void doSet(void *target, const String &val)
String doGet(const void *target) const
Central state/object manager and communications hub.
static CmdMiddlePoint msMiddlePointCmd
Command objects.
Vector3 getMiddlePoint(void) const
Gets the sphere middle point.
Command object for intensity growth (see ParamCommand).
void doSet(void *target, const String &val)
This class defines a ParticleAffector which deflects particles.
Real getIntensity(void) const
Gets the intensity.
void setIntensityGrowth(Real intensity)
Sets the intensity growth rate.
int fireEvent(std::string instanceName, float intensity)
void doSet(void *target, const String &val)
bool updateIntensityRequired
String doGet(const void *target) const
void setRadius(Real radius)
Sets the radius for the interaction with the FireExtiniguisher affector.
~ExtinguishableFireAffector()
Destructor.
String objectInstanceName
The instance name of the parent object.
void doSet(void *target, const String &val)
Real mIntensity
Intensity of the fire.
Command object for maximum intensity (see ParamCommand).
void _affectParticles(ParticleSystem *pSystem, Real timeElapsed)
See ParticleAffector.
Vector2 originalDimensions
String doGet(const void *target) const