Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7576 in orxonox.OLD for branches/atmospheric_engine/src/lib


Ignore:
Timestamp:
May 10, 2006, 5:03:37 PM (19 years ago)
Author:
hdavid
Message:

branches/atmospheric_engine: basic snow

Location:
branches/atmospheric_engine/src/lib/graphics/effects
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc

    r7573 r7576  
    1919
    2020#include "glincl.h"
     21#include "debug.h"
    2122
    2223#include "state.h"
     
    2526
    2627#include "parser/tinyxml/tinyxml.h"
     28
     29//SHELL_COMMAND(activate, SnowEffect, activateSnow);
    2730
    2831using namespace std;
     
    3437  this->setClassID(CL_SNOW_EFFECT, "SnowEffect");
    3538
    36 //   this->snowMode = GL_LINEAR;
    37 //   this->snowDensity = 0.001f;
    38 //   this->snowStart = 10.0f;
    39 //   this->snowEnd = 1000.0f;
    40 
    4139  if (root != NULL)
    4240    this->loadParams(root);
     
    4644  this->activate();
    4745}
    48 
    4946
    5047
     
    6966bool SnowEffect::init()
    7067{
    71   Vector2D      size;
    72   size.x = 1200;
    73   size.y = 1200;
    74   this->emitter = new PlaneEmitter(size, 900, 40, 5);
     68  this->emitter = new PlaneEmitter();
    7569}
    7670
     
    8074{
    8175  PRINTF(0)("Activating Snow Effect\n");
    82   /*
    83   SnowEffect::snowParticles = new SpriteParticles(2000);
     76 
     77  SnowEffect::snowParticles = new SpriteParticles(10000);
    8478  SnowEffect::snowParticles->setName("SnowEffectTrailParticles");
    85   SnowEffect::snowParticles->setMaterialTexture("maps/radial-trans-noise.png");
    86   SnowEffect::snowParticles->setLifeSpan(1.0, .3);
    87   SnowEffect::snowParticles->setRadius(0.0, .5);
    88   SnowEffect::snowParticles->setRadius(0.2, 2.0);
    89   SnowEffect::snowParticles->setRadius(.5, .8);
    90   SnowEffect::snowParticles->setRadius(1.0, .8);
    91   SnowEffect::snowParticles->setColor(0.0, 1,0,0,.7);
    92   SnowEffect::snowParticles->setColor(0.2, .8,.8,0,.5);
    93   SnowEffect::snowParticles->setColor(0.5, .8,.8,.8,.8);
    94   SnowEffect::snowParticles->setColor(1.0, .8,.8,.8,.0);
     79  SnowEffect::snowParticles->setMaterialTexture("maps/snow_flake_01_32x32.png");
     80  //SnowEffect::snowParticles->setSize(1);
     81  SnowEffect::snowParticles->setLifeSpan(8, 2);
     82  SnowEffect::snowParticles->setRadius(0.0, 5.0, 10.0);
     83  SnowEffect::snowParticles->setRadius(0.2, 5.0, 10);
     84  SnowEffect::snowParticles->setRadius(1.0, 5.0, 10);
     85  SnowEffect::snowParticles->setMass(0, 1.0, .3);
     86  SnowEffect::snowParticles->setColor(0,1, 1, 1,.5);
     87  SnowEffect::snowParticles->setColor(.5, .6, .6, .6, .2);
     88  SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
     89
    9590 
    9691  this->emitter->setSystem(SnowEffect::snowParticles);
    97 
    98   this->updateNode(0);
    99   this->emitter->setEmissionRate(45.0);
    100   this->emitter->setEmissionVelocity(0.0);*/
     92 
     93 // this->updateNode(0);
     94  this->emitter->setEmissionRate(900);
     95  this->emitter->setEmissionVelocity(150, 50);
     96  this->emitter->setSpread(0, .3);
     97  this->emitter->setSize(1200, 1200);
    10198}
    10299
     
    105102{
    106103  PRINTF(0)("Deactivating Snow Effect\n");
     104 
     105  this->emitter->setSystem(NULL);
    107106}
    108107
  • branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.h

    r7573 r7576  
    1414
    1515class SpriteParticles;
     16class PlaneEmitter;
    1617
    1718class SnowEffect : public WeatherEffect
     
    3031    virtual void draw() const;
    3132    virtual void tick(float dt);
     33   
     34    void activateSnow();
    3235
    3336//     inline void setSnowMode(const std::string& mode) { this->snowMode = this->stringToSnowMode(mode); }
     
    4346    static SpriteParticles* snowParticles;
    4447   
    45     ParticleEmitter*          emitter;
     48    PlaneEmitter*          emitter;
    4649};
    4750
Note: See TracChangeset for help on using the changeset viewer.