00001 #include "Emitter.h"
00002
00003
00004 #include "ani/Dynamics/operators/SpiralEmitter.h"
00005 #include "ani/Dynamics/operators/ViscousDragOperator.h"
00006 #include "ani/Dynamics/operators/GrimReaperOperator.h"
00007 #include "ani/Dynamics/operators/CurrentOperator.h"
00008 #include "ani/Dynamics/operators/ColorWithAgeOperator.h"
00009 #include "ani/Dynamics/operators/GrowWithAgeOperator.h"
00010
00012 class SpiralThing : public ParticleSystem
00013 {
00014 public:
00015 SpiralThing() : ParticleSystem()
00016 {
00017
00018 std::vector<gmtl::Vec4f> colorTransitions;
00019 gmtl::Vec4f a;
00020 a.setInteger( 255, 255, 255, 255 );
00021 colorTransitions.push_back( a );
00022
00023 a.setInteger( 0, 0, 255, 255 );
00024 colorTransitions.push_back( a );
00025
00026 a.setInteger( 100, 255, 100, 255 );
00027 colorTransitions.push_back( a );
00028
00029 a.setInteger( 131, 129, 155, 189 );
00030 colorTransitions.push_back( a );
00031
00032
00033
00034 ODEsolver* solver = new EulerODEsolver;
00035 this->setSolver( solver );
00036
00037
00038 SpiralEmitterOperatorPtr se( new SpiralEmitter );
00039 se->setEmissionRate( 0.08 );
00040 this->add( se );
00041 GravityOperatorPtr gravity( new GravityOperator );
00042 this->add( gravity );
00043 GrimReaperOperatorPtr reaper( new GrimReaperOperator );
00044 this->add( reaper );
00045 ColorWithAgeOperatorPtr cwa( new ColorWithAgeOperator );
00046 cwa->setColors( colorTransitions );
00047 this->add( cwa );
00048
00049 GrowWithAgeOperatorPtr gwa( new GrowWithAgeOperator );
00050 std::vector<float> v;
00051 v.push_back( 1.0f );
00052 v.push_back( 5.0f );
00053 v.push_back( 10.0f );
00054 v.push_back( 12.5f );
00055 v.push_back( 15.0f );
00056 v.push_back( 17.5f );
00057 v.push_back( 20.0f );
00058 v.push_back( 100.0f );
00059 gwa->setVolumes( v );
00060 this->add( gwa );
00061 }
00062
00063 };
00064
00065
00066