Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8242 in orxonox.OLD


Ignore:
Timestamp:
Jun 8, 2006, 2:04:37 PM (18 years ago)
Author:
amaechler
Message:

branches/atmospheric_engine: general activate, cleanups

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

Legend:

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

    r8175 r8242  
    2727#include "p_node.h"
    2828#include "shader.h"
     29#include "shell_command.h"
    2930
    3031#include "parser/tinyxml/tinyxml.h"
     
    3334
    3435using namespace std;
     36
     37SHELL_COMMAND(activate, CloudEffect, activateCloud);
     38SHELL_COMMAND(deactivate, CloudEffect, deactivateCloud);
    3539
    3640CREATE_FACTORY(CloudEffect, CL_CLOUD_EFFECT);
     
    4549                this->loadParams(root);
    4650
    47         this->activate();
     51        if(cloudActivate)
     52                this->activate();
    4853}
    4954
     
    5459        delete this->cloudMaterial;
    5560
    56         g_sky_model.Delete();
    57         Shader::unload(this->skyShader);
     61        cloudModel.Delete();
     62        Shader::unload(this->cloudShader);
    5863
    5964}
     
    6368{
    6469        PRINTF(1)("Initializing CloudEffect\n");
     70
     71        // Default values
     72        this->cloudActivate = false;
     73        this->cloudTint[4] = ( 0.9f, 0.7f, 0.7f, 1.0f );
     74        this->cloudScroll = 1.0f;
     75        this->time = 0.0f;
     76        //g_cloud_texture = 0;
     77
     78        this->cloudTexture = "pictures/sky/cloud1.jpg";
     79
     80        cloudModel.Load("sky.sgl");
     81        cloudModel.Unitize();
     82
     83        // Get the bounding box of the sky dome
     84        float bbox[3] = {0};
     85        cloudModel.GetDimensions(bbox[0], bbox[1], bbox[2]);
     86       
     87        // Load Shaders
     88        this->cloudShader = new Shader( ResourceManager::getInstance()->getDataDir() + "/shaders/sky.vert", ResourceManager::getInstance()->getDataDir() +"/shaders/sky.frag");
     89
     90        // Tell the shader the bounding box of the sky dome
     91        this->cloudShader->bindShader("bbox", bbox, 4);
     92
     93        // Initialze Cloud Material
     94        this->cloudMaterial = new Material("Sky");
     95        this->cloudMaterial->setIllum(3);
     96        this->cloudMaterial->setAmbient(1.0, 1.0, 1.0);
     97        this->cloudMaterial->setDiffuseMap(this->cloudTexture);
     98
     99}
     100
     101
     102void CloudEffect::loadParams(const TiXmlElement* root)
     103{
     104        WeatherEffect::loadParams(root);
     105
     106        // LoadParam(root, "speed", this, CloudEffect, setCloudAnimation);
     107        // LoadParam(root, "texture", this, CloudEffect, setCloudTexture);
     108
     109        LOAD_PARAM_START_CYCLE(root, element);
     110        {
     111                LoadParam_CYCLE(element, "option", this, CloudEffect, setCloudOption);
     112        }
     113        LOAD_PARAM_END_CYCLE(element);
     114}
     115
     116
     117bool CloudEffect::activate()
     118{
     119        PRINTF(0)( "Activating CloudEffect with Material %s\n", this->cloudTexture.c_str());
     120
     121        this->cloudActivate = true;
     122       
     123}
     124
     125bool CloudEffect::deactivate()
     126{
     127        PRINTF(0)("Deactivating CloudEffect\n");
     128
     129        this->cloudActivate = false;
     130}
     131
     132void CloudEffect::draw() const
     133{
     134        if (!this->cloudActivate)
     135                return;
     136               
     137        //      glMatrixMode(GL_MODELVIEW);
     138        //      glPushMatrix();
     139        //
     140        //      // Move sphere along with the camera
     141        //      Vector r = State::getCameraNode()->getAbsCoor();
     142        //      glTranslatef(r.x, r.y, r.z);
     143        //
     144        //      // Sky movement
     145        //      glRotatef(mover, 0, 0, 1);
     146        //
     147        //      cloudMaterial->select();
     148        //      gluSphere(this->sphereObj, this->sphereRadius, 20, 20);
     149        //      glPopMatrix();
     150
     151        // ******
     152
     153        glMatrixMode(GL_MODELVIEW);
     154        glPushMatrix();
    65155
    66156        // glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
     
    72162       
    73163        glLineWidth(3.0f);
    74        
    75         float diffuse[]  = {1.0f, 1.0f, 1.0f, 1.0f};
    76         float position[] = {0.0f, 2.0f, 0.0f, 1.0f};
    77         float specular[] = {1.0f, 1.0f, 1.0f, 1.0f};
    78        
    79         glEnable(GL_LIGHTING);
    80         glEnable( GL_LIGHT0);
    81         glLightfv(GL_LIGHT0, GL_DIFFUSE,  diffuse);
    82         glLightfv(GL_LIGHT0, GL_POSITION, position);
    83         glLightfv(GL_LIGHT0, GL_SPECULAR, specular);
    84        
    85         float shininess = 5.0f;
    86         glEnable(GL_COLOR_MATERIAL);
    87         glMaterialf( GL_FRONT, GL_SHININESS, shininess);
    88         glMaterialfv(GL_FRONT, GL_SPECULAR,  specular);
    89 
    90         this->cloudTexture = "pictures/sky/cloud1.jpg";
    91 
    92         g_sky_model.Load("sky.sgl");
    93         g_sky_model.Unitize();
    94 
    95         /* Get the bounding box of the sky dome. */
    96         float bbox[3] = {0};
    97         g_sky_model.GetDimensions(bbox[0], bbox[1], bbox[2]);
    98        
    99         // this->skyShader = (Shader*)ResourceManager::getInstance()->load("shaders/sky.vert", SHADER, RP_GAME, "shaders/skyfrag");
    100         this->skyShader = new Shader( ResourceManager::getInstance()->getDataDir() + "/shaders/sky.vert", ResourceManager::getInstance()->getDataDir() +"/shaders/sky.frag");
    101 
    102         /* Tell the shader the bounding box of the sky dome. */
    103         this->skyShader->bindShader("bbox", bbox, 4);
    104 
    105         //g_cloud_texture = 0;
    106 
    107         g_tint[4] = ( 0.9f, 0.7f, 0.7f, 1.0f );
    108         g_scroll = 1.0f;
    109         time = 0.0f;
    110 }
    111 
    112 
    113 void CloudEffect::loadParams(const TiXmlElement* root)
    114 {
    115         WeatherEffect::loadParams(root);
    116 
    117         LoadParam(root, "speed", this, CloudEffect, setCloudAnimation);
    118         LoadParam(root, "texture", this, CloudEffect, setCloudTexture);
    119 }
    120 
    121 
    122 bool CloudEffect::activate()
    123 {
    124         PRINTF(0)( "Activating CloudEffect with Material %s\n", this->cloudTexture.c_str());
    125 
    126         this->cloudMaterial = new Material("Sky");
    127         this->cloudMaterial->setIllum(3);
    128         this->cloudMaterial->setAmbient(1.0, 1.0, 1.0);
    129         this->cloudMaterial->setDiffuseMap(this->cloudTexture);
    130 }
    131 
    132 bool CloudEffect::deactivate()
    133 {
    134         PRINTF(0)("Deactivating CloudEffect\n");
    135 }
    136 
    137 void CloudEffect::draw() const
    138 {
    139 
    140 //      glMatrixMode(GL_MODELVIEW);
    141 //      glPushMatrix();
    142 //
    143 //      // Move sphere along with the camera
    144 //      Vector r = State::getCameraNode()->getAbsCoor();
    145 //      glTranslatef(r.x, r.y, r.z);
    146 //
    147 //      // Sky movement
    148 //      glRotatef(mover, 0, 0, 1);
    149 //
    150 //      cloudMaterial->select();
    151 //      gluSphere(this->sphereObj, this->sphereRadius, 20, 20);
    152 //      glPopMatrix();
    153 
    154         // ******
    155 
    156         glMatrixMode(GL_MODELVIEW);
    157         glPushMatrix();
    158164
    159165        static float time = 0.0f;
     
    164170        // gluLookAt(eye[x], eye[y], eye[z], look[x], look[y], look[z], up[x], up[y], up[z]);
    165171
    166         /* Turn off the depth buffer when rendering the background. */
     172        // Turn off the depth buffer when rendering the background
    167173        // glDisable(GL_DEPTH_TEST);
    168174
    169         this->skyShader->activateShader();
     175        this->cloudShader->activateShader();
    170176
    171177        /* Select the shader program and update parameters. */
    172178        /* The "time" parameter controls the cloud scrolling. */
    173         this->skyShader->bindShader("time", &time, 1);
     179        this->cloudShader->bindShader("time", &time, 1);
    174180        /* The "horizon" parameter controls the sky tinting. */
    175         this->skyShader->bindShader("horizon", g_tint, 4);
    176        
     181        this->cloudShader->bindShader("horizon", cloudTint, 4);
     182
    177183        glActiveTexture(GL_TEXTURE0 + 0);
    178184        glActiveTexture(GL_TEXTURE0 + 1);
    179         /* Load the cloud texture. */
     185
     186        // Load the cloud texture
    180187        //glBindTexture(GL_TEXTURE_2D, g_cloud_texture);
    181188        this->cloudMaterial->select();
    182        
    183         /* Render the sky dome. */
    184         g_sky_model.Render();
    185        
    186         /* Unselect the shader. */
     189
     190        // Render the sky dome
     191        cloudModel.Render();
     192
     193        // Unselect the shader
    187194        Shader::deactivateShader();
    188195
     
    203210
    204211        glPopMatrix();
     212       
    205213}
    206214
    207215void CloudEffect::tick (float dt)
    208216{
    209         // mover = mover + this->cloudSpeed * dt;
    210 
    211         /* Update the timer for scrolling the clouds. */
    212         time = time + ((1.0f / 2000.0f) * g_scroll);
    213 }
    214 
     217        if (!this->cloudActivate)
     218                return;
     219
     220        // Update the timer for scrolling the clouds
     221        time = time + ((1.0f / 2000.0f) * cloudScroll);
     222}
     223
  • branches/atmospheric_engine/src/lib/graphics/effects/cloud_effect.h

    r8175 r8242  
    3333                virtual bool deactivate();
    3434
     35                inline void activateCloud() { this->activate(); }
     36                inline void deactivateCloud() { this->deactivate(); }
     37               
    3538                virtual void draw() const;
    3639                virtual void tick(float dt);
    3740
    38                 // void setRadius(float radius);
    39                 // void setTexture(char* fileName);
     41                inline void setCloudOption(const std::string& option) {
     42                        if (option == "activate") this->cloudActivate = true;
     43                }
    4044
    4145
     
    4347                void initialize(char* fileName);
    4448
    45                 // GLUquadricObj*               sphereObj;              // A Placeholder for the Sphere.
     49                bool                            cloudActivate;
     50
    4651                Material*                       cloudMaterial;          // A Material for the Sphere.
    47                 float                           sphereRadius;           // Radius of the Sphere.
    4852
    49                 float                           mover;
    50                 float                           cloudSpeed;
    5153                std::string                     cloudTexture;
    5254
    53                 inline void setCloudTexture(const std::string& file) { this->cloudTexture = file; }
    54                 inline void setCloudAnimation(float speed) { this->cloudSpeed = speed; }
     55                Sglmodel_sgl                    cloudModel;
     56                Shader*                         cloudShader;
    5557
    56                 Sglmodel_sgl g_sky_model;
    57                 Shader* skyShader;
     58                GLfloat                         cloudTint[4];
     59                GLfloat                         cloudScroll;
    5860
    59                 float g_tint[4];
    60                 float g_scroll;
    61 
    62                 float time;
    63 
     61                float                           time;
    6462
    6563};
  • branches/atmospheric_engine/src/lib/graphics/effects/rain_effect.cc

    r8181 r8242  
    125125        PRINTF(0)( "Activating RainEffect, coord: %f, %f, %f, size: %f, %f, rate: %f, velocity: %f, moveRain: %s\n", this->rainCoord.x, this->rainCoord.y, this->rainCoord.z, this->rainSize.x, this-> rainSize.y, this->rainRate, this->rainVelocity, this->rainMove ? "true" : "false" );
    126126
     127        this->rainActivate = true;
     128
    127129        if (unlikely(RainEffect::rainParticles == NULL))
    128130        {
     
    134136                RainEffect::rainParticles->setRadius(0.2, 0.02);
    135137                RainEffect::rainParticles->setRadius(1, 0.01);
    136                 RainEffect::rainParticles->setColor(0, 0.3, 0.3, 0.5, 0.2); // grey blue 1
    137                 RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2); // grey blue 2
    138                 RainEffect::rainParticles->setColor(1, 0.7, 0.7, 0.7, 0.2); // light grey
     138                RainEffect::rainParticles->setColor(0, 0.3, 0.3, 0.5, 0.2);     // grey blue 1
     139                RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2);   // grey blue 2
     140                RainEffect::rainParticles->setColor(1, 0.7, 0.7, 0.7, 0.2);     // light grey
    139141        }
    140142
     
    158160{
    159161        PRINTF(0)("Deactivating RainEffect\n");
     162       
     163        this->rainActivate = false;
    160164        this->emitter->setSystem(NULL);
    161 
    162165        this->soundSource.stop();
    163166
     
    167170void RainEffect::tick (float dt)
    168171{
    169         if (RainEffect::rainParticles != NULL) {
    170                 if (this->rainMove) {
    171                         this->rainCoord = State::getCameraNode()->getAbsCoor();
    172                         this->emitter->setRelCoor(this->rainCoord.x , this->rainCoord.y+800, this->rainCoord.z);
    173                 }
     172        if (!this->rainActivate)
     173                return;
     174               
     175        if (this->rainMove) {
     176                this->rainCoord = State::getCameraNode()->getAbsCoor();
     177                this->emitter->setRelCoor(this->rainCoord.x , this->rainCoord.y+800, this->rainCoord.z);
     178        }
     179
     180        if (this->rainStartDuration != 0 && this->localTimer < this->rainStartDuration) {
     181                this->localTimer += dt;
     182                float progress = this->localTimer / this->rainStartDuration;
     183
     184                // PRINTF(0)("Progress %f: \n", progress);
     185
     186                // use alpha in color to fade in
     187                RainEffect::rainParticles->setColor(0,   0.3, 0.3, 0.5, 0.2 * progress); // grey blue 1
     188                RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2 * progress); // grey blue 2
     189                RainEffect::rainParticles->setColor(1,   0.7, 0.7, 0.7, 0.2 * progress); // light grey
     190
     191                // increase radius for more "heavy" rain
     192                RainEffect::rainParticles->setRadius(0, 0.03 * progress);
     193                RainEffect::rainParticles->setRadius(0.2, 0.02 * progress);
     194                RainEffect::rainParticles->setRadius(1, 0.01 * progress);
     195
     196                // increase sound volume
     197                // this->soundSource.fadein(this->rainBuffer, 10);
     198        }
    174199       
    175                 if (this->rainStartDuration != 0 && this->localTimer < this->rainStartDuration) {
    176                         this->localTimer += dt;
    177                         float progress = this->localTimer / this->rainStartDuration;
    178        
    179                         // PRINTF(0)("Progress %f: \n", progress);
    180        
    181                         // use alpha in color to fade in
    182                         RainEffect::rainParticles->setColor(0,   0.3, 0.3, 0.5, 0.2 * progress); // grey blue 1
    183                         RainEffect::rainParticles->setColor(0.5, 0.4, 0.4, 0.5, 0.2 * progress); // grey blue 2
    184                         RainEffect::rainParticles->setColor(1,   0.7, 0.7, 0.7, 0.2 * progress); // light grey
    185        
    186                         // increase radius for more "heavy" rain
    187                         RainEffect::rainParticles->setRadius(0, 0.03 * progress);
    188                         RainEffect::rainParticles->setRadius(0.2, 0.02 * progress);
    189                         RainEffect::rainParticles->setRadius(1, 0.01 * progress);
    190        
    191                         // increase sound volume
    192                         // this->soundSource.fadein(this->rainBuffer, 10);
    193                 }
    194         }
    195200}
    196201
    197202void RainEffect::startRaining() {
    198203
    199         if (RainEffect::rainParticles != NULL)
     204        if (this->rainActivate)
    200205                this->deactivate();
    201206
  • branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.cc

    r8023 r8242  
    5353        }
    5454
    55   if(snowActivate)
    56     this->activate();
     55        if(snowActivate)
     56                this->activate();
    5757}
    5858
     
    7676        LoadParam(root, "emissionRate", this, SnowEffect, emissionRate);
    7777        LoadParam(root, "emissionVelocity", this, SnowEffect, emissionVelocity);
    78   LoadParam(root, "wind", this, SnowEffect, wind);
     78        LoadParam(root, "wind", this, SnowEffect, wind);
    7979        LoadParam(root, "size", this, SnowEffect, size);
    8080        LoadParam(root, "coord", this, SnowEffect, coord);
    8181 
    82   LOAD_PARAM_START_CYCLE(root, element);
    83   {
    84     LoadParam_CYCLE(element, "option", this, SnowEffect, setSnowOption);
    85   }
    86   LOAD_PARAM_END_CYCLE(element);
     82        LOAD_PARAM_START_CYCLE(root, element);
     83        {
     84                LoadParam_CYCLE(element, "option", this, SnowEffect, setSnowOption);
     85        }
     86        LOAD_PARAM_END_CYCLE(element);
    8787}
    8888
     
    9292
    9393        // Default values
    94   this->snowActivate = false;
    95   this->snowMove = false;
     94        this->snowActivate = false;
     95        this->snowMove = false;
    9696        this->particles = 12000;
    9797        this->texture = "maps/snow_flake_01_32x32.png";
     
    109109        this->alpha = 0.5;
    110110        this->snowSize = Vector2D(2500, 2500);
    111   this->snowCoord = Vector(100,450,400);
     111        this->snowCoord = Vector(100,450,400);
    112112        this->snowWindForce = 1;
    113 
    114 //      this->activated = false;
    115113}
    116114
     
    118116{
    119117        PRINTF(0)("Activating SnowEffect\n");
    120 //      activated = true;
     118
     119        this->snowActivate = true;
    121120
    122121        SnowEffect::snowParticles = new SpriteParticles(particles);
     
    140139        this->emitter->setSize(snowSize);
    141140
    142   //SnowEffect::snowParticles->precache(8);
     141        // SnowEffect::snowParticles->precache(8);
    143142
    144143        if (this->snowWindForce > 1)
     
    150149{
    151150        PRINTF(0)("Deactivating SnowEffect\n");
    152         //activated = false;
    153 
     151
     152        this->snowActivate = false;
    154153        this->emitter->setSystem(NULL);
    155154
     
    161160void SnowEffect::draw() const
    162161{
     162        if (!this->snowActivate)
     163                return;
    163164}
    164165
    165166void SnowEffect::tick(float dt)
    166 {/*
    167   float distance = (State::getCameraNode()->getAbsCoor() - Vector(snowCoord.x, State::getCameraNode()->getAbsCoor().y, snowCoord.z)).len();
    168  
    169   if(activated)
    170   {
    171     if(distance > 0.3*snowSize.x || distance > 0.3*snowSize.y)
    172                   this->deactivate();
    173     else if(distance > 0.25*snowSize.x || distance > 0.25*snowSize.y)
    174       this->alpha = 0.15;
    175     else if(distance > 0.2*snowSize.x || distance > 0.2*snowSize.y)
    176       this->alpha = 0.25;
    177     else if(distance > 0.1*snowSize.x || distance > 0.1*snowSize.y)
    178       this->alpha = 0.4;
    179 
    180     SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
    181     SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
    182     SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
    183   }
    184   else
    185   {
    186   if(distance < 0.3*snowSize.x || distance < 0.3*snowSize.y )
    187     this->activate();
    188   if( distance < 0.25*snowSize.x || distance < 0.25*snowSize.y )
    189     this->alpha = 0.25;
    190   else if( distance < 0.2*snowSize.x || distance < 0.2*snowSize.y )
    191     this->alpha = 0.4;
    192   else if( distance < 0.1*snowSize.x || distance < 0.1*snowSize.y )
    193     this->alpha = 0.5;
    194 
    195     SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
    196     SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
    197     SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
    198 }*/
    199   if (this->snowMove) {
    200     this->snowCoord = State::getCameraNode()->getAbsCoor();
    201     this->emitter->setRelCoor(this->snowCoord.x , this->snowCoord.y+300, this->snowCoord.z);
    202   }
    203 }
    204 
     167{
     168        if (!this->snowActivate)
     169                return;
     170
     171        /*
     172        float distance = (State::getCameraNode()->getAbsCoor() - Vector(snowCoord.x, State::getCameraNode()->getAbsCoor().y, snowCoord.z)).len();
     173       
     174        if(activated)
     175        {
     176        if(distance > 0.3*snowSize.x || distance > 0.3*snowSize.y)
     177                        this->deactivate();
     178        else if(distance > 0.25*snowSize.x || distance > 0.25*snowSize.y)
     179        this->alpha = 0.15;
     180        else if(distance > 0.2*snowSize.x || distance > 0.2*snowSize.y)
     181        this->alpha = 0.25;
     182        else if(distance > 0.1*snowSize.x || distance > 0.1*snowSize.y)
     183        this->alpha = 0.4;
     184       
     185        SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
     186        SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
     187        SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
     188        }
     189        else
     190        {
     191        if(distance < 0.3*snowSize.x || distance < 0.3*snowSize.y )
     192        this->activate();
     193        if( distance < 0.25*snowSize.x || distance < 0.25*snowSize.y )
     194        this->alpha = 0.25;
     195        else if( distance < 0.2*snowSize.x || distance < 0.2*snowSize.y )
     196        this->alpha = 0.4;
     197        else if( distance < 0.1*snowSize.x || distance < 0.1*snowSize.y )
     198        this->alpha = 0.5;
     199       
     200        SnowEffect::snowParticles->setColor(0,1, 1, 1, alpha);
     201        SnowEffect::snowParticles->setColor(.5, .6, .6, .6, alpha/2);
     202        SnowEffect::snowParticles->setColor(1, .0, .0, .0, .0);
     203        }*/
     204
     205        if (this->snowMove) {
     206                this->snowCoord = State::getCameraNode()->getAbsCoor();
     207                this->emitter->setRelCoor(this->snowCoord.x , this->snowCoord.y+300, this->snowCoord.z);
     208        }
     209}
  • branches/atmospheric_engine/src/lib/graphics/effects/snow_effect.h

    r8023 r8242  
    3333                virtual bool deactivate();
    3434
     35                inline void activateSnow() { this->activate(); }
     36                inline void deactivateSnow() { this->deactivate(); }
     37               
    3538                virtual void draw() const;
    3639                virtual void tick(float dt);
    3740
    38     void activateSnow() { this->activate(); }
    39     void deactivateSnow() { this->deactivate(); }
    4041
    4142                inline void numParticles(int n) { this->particles = n; }
     
    4849                inline void size(float sizeX, float sizeY) { this->snowSize = Vector2D(sizeX, sizeY); }
    4950                inline void coord(float x, float y, float z) { this->snowCoord = Vector(x, y, z); }
    50     inline void wind(int force) { this->snowWindForce = force; }
    51     inline void setSnowOption(const std::string& option) { /*if (option == "fade") this->snowFade = true;*/
    52                                                                                   if (option == "movesnow") this->snowMove = true;
    53                                                                                   if (option == "activate") this->snowActivate = true; }
     51                inline void wind(int force) { this->snowWindForce = force; }
     52
     53                inline void setSnowOption(const std::string& option) {
     54                        /*if (option == "fade") this->snowFade = true;*/
     55                        if (option == "movesnow") this->snowMove = true;
     56                        if (option == "activate") this->snowActivate = true;
     57                }
    5458
    5559
    5660        private:
    57                 int                                                                                                                             particles;
    58                 std::string                                                                                             texture;
    59                 float                                                                                                                   life, randomLife;
    60                 float                                                                                                                           snowRadius, randomRadius;
    61                 float                                                                                                                           snowMass, randomMass;
    62                 float                                                                                                                   rate;
    63                 float                                                                                                                   velocity, randomVelocity;
    64                 float                                                                                                                   angle, randomAngle;
    65                 float                                                                                                                   alpha;
    66                 Vector                                                                                                                  snowCoord;
    67                 Vector2D                                                                                                                snowSize;
    68                 int                                                                                                                                     snowWindForce;
     61                int                             particles;
     62                std::string                     texture;
     63                float                           life, randomLife;
     64                float                           snowRadius, randomRadius;
     65                float                           snowMass, randomMass;
     66                float                           rate;
     67                float                           velocity, randomVelocity;
     68                float                           angle, randomAngle;
     69                float                           alpha;
     70                Vector                          snowCoord;
     71                Vector2D                        snowSize;
     72                int                             snowWindForce;
    6973
    70                 //bool                                                                                                                          activated;
    71     bool                              snowMove;
    72     bool                              snowActivate;
    73    
    74                 PlaneEmitter*                                                                                           emitter;
     74                bool                            snowMove;
     75                bool                            snowActivate;
    7576
    76                 static SpriteParticles*                                                 snowParticles;
    77                 OrxSound::SoundSource              soundSource;
    78                 OrxSound::SoundBuffer*             windBuffer;
     77                PlaneEmitter*                   emitter;
     78
     79                static SpriteParticles*         snowParticles;
     80                OrxSound::SoundSource           soundSource;
     81                OrxSound::SoundBuffer*          windBuffer;
    7982
    8083};
Note: See TracChangeset for help on using the changeset viewer.