Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7379 in orxonox.OLD


Ignore:
Timestamp:
Apr 26, 2006, 3:52:46 PM (18 years ago)
Author:
hdavid
Message:

branches/atmospheric_engine: basic framework

Location:
branches/atmospheric_engine/src
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/atmospheric_engine/src/defs/class_id.h

    r7256 r7379  
    286286
    287287
     288  //CL_ATMOSPHERIC_ENGINE         =    0x        ,
     289  //CL_SUN_EFFECTS                =    0x        ,
     290  //CL_WEATHER_EFFECTS            =    0x        ,
     291
    288292  // Particles
    289293  CL_PARTICLE_SYSTEM            =    0x00a02000,
  • branches/atmospheric_engine/src/lib/graphics/Makefile.am

    r7165 r7379  
    1717                           \
    1818                           effects/graphics_effect.cc \
     19                           effects/atmospheric_engine.cc \
     20                           effects/weather_effects.cc \
     21                           effects/sun_effects.cc \
    1922                           effects/fog_effect.cc \
    2023                           effects/lense_flare.cc
     
    3538                 \
    3639                 effects/graphics_effect.h \
     40                 effects/atmospheric_engine.h \
     41                 effects/weather_effects.h \
     42                 effects/sun_effects.h \
    3743                 effects/fog_effect.h \
    3844                 effects/lense_flare.h
  • branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.cc

    r7221 r7379  
    1 
    2 
    31/*
    42   orxonox - the future of 3D-vertical-scrollers
     
    1210
    1311### File Specific:
    14    main-programmer: Patrick Boenzli
     12   main-programmer: hdavid, amaechler
    1513*/
    16 
    17 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_GRAPHICS
    1814
    1915#include "fog_effect.h"
     
    3127
    3228
    33 /**
    34  *  default constructor
    35  * @param root The XML-element to load the FogEffect from
    36  */
    37  FogEffect::FogEffect(const TiXmlElement* root)
     29FogEffect::FogEffect(const TiXmlElement* root)
    3830{
    39   this->setClassID(CL_FOG_EFFECT, "FogEffect");
    40 
     31  //this->setClassID(CL_FOG_EFFECT, "FogEffect");
     32/*
    4133  this->fogMode = GL_LINEAR;
    4234  this->fogDensity = 0.001f;
    4335  this->fogStart = 10.0f;
    4436  this->fogEnd = 1000.0f;
    45 
     37*/
    4638  if (root != NULL)
    4739    this->loadParams(root);
     
    5143
    5244
    53 /**
    54  *  destroys a FogEffect
    55  */
     45
    5646FogEffect::~FogEffect()
    5747{
     
    6050
    6151
    62 /**
    63  * @param root The XML-element to load the FogEffect from
    64  */
    6552void FogEffect::loadParams(const TiXmlElement* root)
    6653{
    67   GraphicsEffect::loadParams(root);
     54  WeatherEffects::loadParams(root);
    6855
     56/*
     57  LoadParam(root, "fog-mode", this, FogEffect, setFogMode);
    6958
    70   LoadParam(root, "fog-mode", this, FogEffect, setFogMode)
    71       .describe("sets the the fog mode {GL_LINEAR, GL_EXP, GL_EXP2}");
     59  LoadParam(root, "fog-density", this, FogEffect, setFogDensity);
    7260
    73   LoadParam(root, "fog-density", this, FogEffect, setFogDensity)
    74       .describe("sets the the fog density of the exponentionl functions");
     61  LoadParam(root, "fog-color", this, FogEffect, setFogColor);*/
    7562
    76   LoadParam(root, "fog-color", this, FogEffect, setFogColor)
    77       .describe("sets the fog color");
     63  LoadParam(root, "test", this, FogEffect, setTest);
     64
    7865
    7966}
    8067
     68void FogEffect::setTest(int test)
     69{
     70  PRINTF(0)("\n\ntest: %i\n\n", test);
     71}
    8172
    82 /**
    83  * initializes the fog effect
    84  */
    8573bool FogEffect::init()
    8674{}
    8775
    8876
    89 /**
    90  * activates the fog effect
    91  */
     77
    9278bool FogEffect::activate()
    93 {
     79{/*
    9480  PRINTF(0)( "Enabling Fog Effect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity,
    9581             this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z);
     
    10995    //glFogi(GL_FOG_COORDINATE_SOURCE, GL_FOG_COORDINATE);
    11096  }
    111   glClearColor(0.5, 0.5, 0.5, 1.0);
     97  glClearColor(0.5, 0.5, 0.5, 1.0);*/
    11298}
    11399
    114100
    115 /**
    116  * deactivates the fog effect
    117  */
     101
    118102bool FogEffect::deactivate()
    119103{
    120   glDisable(GL_FOG);
     104  //glDisable(GL_FOG);
    121105}
    122106
    123107
    124 /**
    125  * converts a gl mode char to a GLint
    126  * @param mode the mode character
    127  */
     108/*
    128109GLint FogEffect::stringToFogMode(const std::string& mode)
    129110{
     
    137118    return -1;
    138119}
     120*/
    139121
  • branches/atmospheric_engine/src/lib/graphics/effects/fog_effect.h

    r7221 r7379  
    11/**
    22 * @file fog_effect.h
    3  *  atmospheric fog
    43 */
    54
     
    76#define _FOG_EFFECT
    87
    9 #include "vector.h"
    10 #include "graphics_effect.h"
     8#include "weather_effects.h"
    119
    12 class TiXmlElement;
    13 
    14 //! A class that handles FogEffects. The FogEffectManager operates on this.
    15 class FogEffect : public GraphicsEffect
     10class FogEffect : public WeatherEffects
    1611{
    1712  public:
     
    2621    virtual bool deactivate();
    2722
    28     inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); }
     23
     24    void setTest(int test);
     25
     26    /*inline void setFogMode(const std::string& mode) { this->fogMode = this->stringToFogMode(mode); }
    2927    inline void setFogDensity(float density) { this->fogDensity = density; }
    3028    inline void setFogRange(float start, float end) { this->fogStart = start; this->fogEnd = end; }
    3129    inline void setFogColor(float r, float g, float b) { this->colorVector = Vector(r, g, b); }
     30*/
     31
     32  private:
     33    //GLint stringToFogMode(const std::string& mode);
    3234
    3335
    3436  private:
    35     GLint stringToFogMode(const std::string& mode);
    36 
    37 
    38   private:
    39     GLint                   fogMode;
     37   /* GLint                   fogMode;
    4038    GLfloat                 fogDensity;
    4139    GLfloat                 fogStart;
    4240    GLfloat                 fogEnd;
    43     Vector                  colorVector;
     41    Vector                  colorVector;*/
    4442};
    4543
    4644
    47 #endif /* _FOG_EFFECT */
     45#endif  /* _FOG_EFFECT */
  • branches/atmospheric_engine/src/story_entities/game_world_data.cc

    r7370 r7379  
    4545
    4646#include "graphics_engine.h"
     47#include "effects/atmospheric_engine.h"
    4748#include "event_handler.h"
    4849#include "sound_engine.h"
     
    322323  LoadParamXML(root, "LightManager", LightManager::getInstance(), LightManager, loadParams);
    323324  LoadParamXML(root, "GraphicsEngine", GraphicsEngine::getInstance(), GraphicsEngine, loadParams);
     325  LoadParamXML(root, "AtmosphericEngine", AtmosphericEngine::getInstance(), AtmosphericEngine, loadParams);
    324326
    325327  LoadParam(root, "Music", this, GameWorldData, setSoundTrack);
Note: See TracChangeset for help on using the changeset viewer.