Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 27, 2006, 9:49:33 AM (18 years ago)
Author:
amaechler
Message:

branches/atmospheric_engine: glFog implemented in AtmosEngine

File:
1 edited

Legend:

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

    r7381 r7392  
    2020#include "glincl.h"
    2121
    22 
     22#include "shell_command.h"
     23/*SHELL_COMMAND(activateFog, FogEffect, FogEffect::activate)
     24  ->setAlias("aFog");
     25SHELL_COMMAND(deactivateFog, FogEffect, FogEffect::deactivate)
     26  ->setAlias("dFog");*/
    2327
    2428using namespace std;
     
    2630CREATE_FACTORY(FogEffect, CL_FOG_EFFECT);
    2731
    28 
    2932FogEffect::FogEffect(const TiXmlElement* root)
    3033{
    3134  //this->setClassID(CL_FOG_EFFECT, "FogEffect");
    32 /*
     35
    3336  this->fogMode = GL_LINEAR;
    3437  this->fogDensity = 0.001f;
    3538  this->fogStart = 10.0f;
    3639  this->fogEnd = 1000.0f;
    37 */
     40
    3841  if (root != NULL)
    3942    this->loadParams(root);
     
    5457  WeatherEffect::loadParams(root);
    5558
    56 /*
    5759  LoadParam(root, "fog-mode", this, FogEffect, setFogMode);
    5860
    5961  LoadParam(root, "fog-density", this, FogEffect, setFogDensity);
    6062
    61   LoadParam(root, "fog-color", this, FogEffect, setFogColor);*/
     63  LoadParam(root, "fog-color", this, FogEffect, setFogColor);
    6264
    63   LoadParam(root, "test", this, FogEffect, setTest);
     65  // LoadParam(root, "test", this, FogEffect, setTest);
    6466
    6567
     
    7779
    7880bool FogEffect::activate()
    79 {/*
     81{
    8082  PRINTF(0)( "Enabling Fog Effect, mode: %i, density: %f, start: %f, end: %f, color %f, %f, %f\n", this->fogMode, this->fogDensity,
    8183             this->fogStart, this->fogEnd, this->colorVector.x, this->colorVector.y, this->colorVector.z);
    8284
     85  /*PRINTF(0)( "Enabling Fog Effect, mode: %i, density: %f, start: %f, end: %f\n", this->fogMode, this->fogDensity,
     86             this->fogStart, this->fogEnd);*/
     87
    8388  glEnable(GL_FOG);
    8489  {
    85 //     GLfloat fogColor[4] = {0.7, 0.6, 0.6, 1.0};
     90    //GLfloat fogColor[4] = {0.7, 0.6, 0.6, 1.0};
    8691    GLfloat fogColor[4] = { colorVector.x, colorVector.y, colorVector.z, 1.0};
    8792
     
    95100    //glFogi(GL_FOG_COORDINATE_SOURCE, GL_FOG_COORDINATE);
    96101  }
    97   glClearColor(0.5, 0.5, 0.5, 1.0);*/
     102  glClearColor(0.5, 0.5, 0.5, 1.0);
    98103}
    99104
     
    102107bool FogEffect::deactivate()
    103108{
    104   //glDisable(GL_FOG);
     109        glDisable(GL_FOG);
    105110}
    106111
    107112
    108 /*
     113
    109114GLint FogEffect::stringToFogMode(const std::string& mode)
    110115{
     
    118123    return -1;
    119124}
    120 */
    121125
     126
Note: See TracChangeset for help on using the changeset viewer.