Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8497 for code


Ignore:
Timestamp:
May 17, 2011, 12:44:32 AM (14 years ago)
Author:
marwegma
Message:

Godrays: Implementing in progress.

Location:
code/branches/environment2/src/orxonox/graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/environment2/src/orxonox/graphics/GlobalGodrayShader.cc

    r8491 r8497  
    5252        //            ThrowException(AbortLoading, "Can't create GlobalGodrayShader, no scene manager given.");
    5353       
    54         this->skyColor_ = {0.0f, 0.0f, 0.0f, 1.0f};
     54        this->skyColor_ = ColourValue::Black;
    5555        this->exposure_ = 1.0f;
    5656        this->decay_ = 0.1f;
    5757        this->density_ = 0.7f;
     58       
     59        //// Init ////
    5860    }
    5961   
     
    7375       
    7476        XMLPortParamTemplate(GlobalGodrayShader, "sunPosition", setSunPosition, getSunPosition, xmlelement, mode, const Vector3&);
    75         XMLPortParamTemplate(GlobalGodrayShader, "skyColor", setSkyColor, getSkyColor, xmlelement, mode, const Vector4&);
    76         XMLPortParamVariable(GlobalGodrayShader, exposure_, "exposure", xmlelement, mode);
    77         XMLPortParamVariable(GlobalGodrayShader, decay_, "decay", xmlelement, mode);
    78         XMLPortParamVariable(GlobalGodrayShader, density_, "density", xmlelement, mode);
     77        XMLPortParamTemplate(GlobalGodrayShader, "skyColor", setSkyColor, getSkyColor, xmlelement, mode, const ColourValue&);
     78        XMLPortParamVariable(GlobalGodrayShader, "exposure", exposure_, xmlelement, mode);
     79        XMLPortParamVariable(GlobalGodrayShader, "decay", decay_, xmlelement, mode);
     80        XMLPortParamVariable(GlobalGodrayShader, "density", density_, xmlelement, mode);
    7981    }
    8082   
    8183    void GlobalGodrayShader::setSunPosition(const Vector3& position)
    8284    {
    83         this->sunPosition.x = position.x;
    84         this->sunPosition.y = position.y;
    85         this->sunPosition.z = position.z;
     85        this->sunPosition_ = position;
    8686    }
    87     void GlobalGodrayShader::setSkyColor(const Vector4& color)
     87    void GlobalGodrayShader::setSkyColor(const ColourValue& color)
    8888    {
    89         this->skyColor[0] = color.x;
    90         this->skyColor[1] = color.y;
    91         this->skyColor[2] = color.z;
    92         this->skyColor[3] = color.w;
     89        this->skyColor_ = color;
    9390    }
    9491    const Vector3& GlobalGodrayShader::getSunPosition() const
    9592    {
    96         return sunPosition;
     93        return this->sunPosition_;
    9794    }
    98     const Vector4& GlobalGodrayShader::getSkyColor() const
     95    const ColourValue& GlobalGodrayShader::getSkyColor() const
    9996    {
    100         Vector4 &color = new Vector4(skyColor[0], skyColor[1], skyColor[2], skyColor[3]);
    101         return color;
     97        return this->skyColor_;
    10298    }
    10399   
    104     void GlobalShader::changedVisibility()
     100    void GlobalGodrayShader::changedVisibility()
    105101    {
    106         SUPER(GlobalShader, changedVisibility);
     102        SUPER(GlobalGodrayShader, changedVisibility);
    107103       
    108104        this->globalShader_.setVisible(this->isVisible());
  • code/branches/environment2/src/orxonox/graphics/GlobalGodrayShader.h

    r8491 r8497  
    3131 @file
    3232 
    33  @brief Header of the GlobalGodrayShader.
     33 @brief Header of the GlobalGodrayShader class.
    3434*/
    3535
     
    4242#include "tools/interfaces/Tickable.h"
    4343#include "core/BaseObject.h"
     44#include "util/Math.h"
    4445#include "GlobalShader.h"
    4546
     
    6768       
    6869            void setSunPosition(const Vector3& position);
    69             void setSkyColor(const Vector4& color);
     70            void setSkyColor(const ColourValue& color);
    7071            const Vector3& getSunPosition() const;
    71             const Vector4& getSkyColor() const;
     72            const ColourValue& getSkyColor() const;
    7273       
    7374        private:
     
    7677           
    7778            Vector3 sunPosition_;
    78             float skyColor_[4];
     79            ColourValue skyColor_;
    7980            float exposure_;
    8081            float decay_;
  • code/branches/environment2/src/orxonox/graphics/GlobalShader.cc

    r8491 r8497  
    3838    CreateFactory(GlobalShader);
    3939
    40     GlobalShader::GlobalShader(BaseObject* creator) : BaseObject(creator), Synchronisable(creator),
     40    GlobalShader::GlobalShader(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
    4141    {
    4242        RegisterObject(GlobalShader);
Note: See TracChangeset for help on using the changeset viewer.