Changeset 4305 in orxonox.OLD for orxonox/branches/physics/src
- Timestamp:
- May 26, 2005, 4:04:18 PM (20 years ago)
- Location:
- orxonox/branches/physics/src/subprojects/particles
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/physics/src/subprojects/particles/framework.cc
r4304 r4305 30 30 int verbose; 31 31 32 void Framework::initModule() 33 { 34 // Creating a Test Particle System 35 ParticleSystem* system = new ParticleSystem(100000, PARTICLE_SPRITE); 36 system->setLifeSpan(5); 37 system->setConserve(.99); 38 system->setRadius(4, 3, 1, 2); 39 system->setColor(.5,0,0,.5, 1,1,0,1, 0,0,0,0); 40 41 // Creating a Test Particle Emitter 42 ParticleEmitter* emitter = new ParticleEmitter(Vector(0 , 1, 0), M_PI_4, 20, .1); 43 emitter->setType(EMITTER_DOT ); 44 emitter->setSize(0); 45 emitter->setRelCoor(Vector(0,0,0)); 46 47 // Add the Flow from the Emitter into the System 48 ParticleEngine::getInstance()->addConnection(emitter, system); 49 } 50 32 51 bool Framework::mainLoop() 33 52 { … … 79 98 // And poll for events 80 99 SDL_Event event; 81 SDL_PollEvent(&event) ;100 while(SDL_PollEvent(&event)) 82 101 { 83 102 switch (event.type) { … … 232 251 ResourceManager::getInstance()->setDataDir(DATA_DIRECTORY); 233 252 234 // Creating a Test Particle System 235 ParticleSystem* system = new ParticleSystem(100000, PARTICLE_SPRITE); 236 system->setLifeSpan(5); 237 system->setConserve(.99); 238 system->setRadius(4, 3, 1, 2); 239 system->setColor(.5,0,0,.5, 1,1,0,1, 0,0,0,0); 240 241 // Creating a Test Particle Emitter 242 ParticleEmitter* emitter = new ParticleEmitter(Vector(0 , 1, 0), M_PI_4, 20, .1); 243 emitter->setType(EMITTER_DOT ); 244 emitter->setSize(0); 245 emitter->setRelCoor(Vector(0,0,0)); 246 247 // Add the Flow from the Emitter into the System 248 ParticleEngine::getInstance()->addConnection(emitter, system); 253 254 initModule(); 249 255 250 256 camera = new Camera(); 251 257 252 State::getInstance()->setCamera(camera, emitter);258 State::getInstance()->setCamera(camera, camera->getTarget()); 253 259 254 260 camera->setAbsCoor(Vector(10, 10, 0)); -
orxonox/branches/physics/src/subprojects/particles/framework.h
r4300 r4305 27 27 ~Framework(); 28 28 29 void initModule(); 29 30 bool mainLoop(); 30 31 bool draw(float dt);
Note: See TracChangeset
for help on using the changeset viewer.