27#include <OgreParticleSystem.h>
28#include <OgreParticle.h>
29#include <OgreStringConverter.h>
30#include <OgreParticleSystemManager.h>
31#include <OgreParticle.h>
43 : ParticleAffector(psys)
45 mType =
"FireExtinguisher";
52 if (createParamDictionary(
"FireExtinguisherAffector"))
56 ParamDictionary* dict = getParamDictionary();
57 dict->addParameter(ParameterDef(
"effectiveness",
58 "How effective is your fire extinguisher? Anything higher than one is more effective than water while everything lower than one is less effective than water.",
63 ParticleSystemManager::ParticleAffectorFactoryIterator pafi = ParticleSystemManager::getSingleton().getAffectorFactoryIterator();
64 ParticleAffectorFactory *paf;
66 while(pafi.hasMoreElements())
69 if ( paf->getName() ==
"ExtinguishableFire" )
75 if (!
mEfaf)
LOG(
"ERROR: Couldn't find an ExtinguishableFireAffectorFactory instance. Was it registered in the content manager?");
83 while(affIt.hasMoreElements())
90 Real squaredRadius = Math::Pow(fire->
getRadius(), 2);
93 ParticleIterator pi = pSystem->_getIterator();
100 if ( middlePoint.squaredDistance(p->mPosition) < squaredRadius )
132 return StringConverter::toString(
139 StringConverter::parseReal(val));
Central state/object manager and communications hub.
void LOG(const char *msg)
Legacy alias - formerly a macro.
Factory class for DeflectorPlaneAffector.
affectorIterator getAffectorIterator()
Allow external access to the mFactories iterator.
VectorIterator< vector< ParticleAffector * >::type > affectorIterator
This class defines a ParticleAffector which deflects particles.
String doGet(const void *target) const
void doSet(void *target, const String &val)
This class defines a ParticleAffector which deflects particles.
void setEffectiveness(Real effectiveness)
Sets the bounce value of the deflection.
ExtinguishableFireAffectorFactory * mEfaf
void _affectParticles(ParticleSystem *pSystem, Real timeElapsed)
See ParticleAffector.
Real getEffectiveness(void) const
Gets the bounce value of the deflection.
static CmdEffectiveness msEffectivenessCmd
Command objects.
FireExtinguisherAffector(ParticleSystem *psys)
Default constructor.
Real mEffectiveness
effectiveness factor (1 means as effective as water, everything higher is more effective while anythi...
Real getRadius(void) const
Gets the radius for the interaction with the FireExtiniguisher affector.
ParticleSystem * getParticleSystem()
Vector3 getAbsoluteMiddlePoint(void) const
Real reduceIntensity(Real amount)