- Timestamp:
- May 17, 2011, 12:44:32 AM (14 years ago)
- Location:
- code/branches/environment2/src/orxonox/graphics
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/environment2/src/orxonox/graphics/GlobalGodrayShader.cc
r8491 r8497 52 52 // ThrowException(AbortLoading, "Can't create GlobalGodrayShader, no scene manager given."); 53 53 54 this->skyColor_ = {0.0f, 0.0f, 0.0f, 1.0f};54 this->skyColor_ = ColourValue::Black; 55 55 this->exposure_ = 1.0f; 56 56 this->decay_ = 0.1f; 57 57 this->density_ = 0.7f; 58 59 //// Init //// 58 60 } 59 61 … … 73 75 74 76 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); 79 81 } 80 82 81 83 void GlobalGodrayShader::setSunPosition(const Vector3& position) 82 84 { 83 this->sunPosition.x = position.x; 84 this->sunPosition.y = position.y; 85 this->sunPosition.z = position.z; 85 this->sunPosition_ = position; 86 86 } 87 void GlobalGodrayShader::setSkyColor(const Vector4& color)87 void GlobalGodrayShader::setSkyColor(const ColourValue& color) 88 88 { 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; 93 90 } 94 91 const Vector3& GlobalGodrayShader::getSunPosition() const 95 92 { 96 return sunPosition;93 return this->sunPosition_; 97 94 } 98 const Vector4& GlobalGodrayShader::getSkyColor() const95 const ColourValue& GlobalGodrayShader::getSkyColor() const 99 96 { 100 Vector4 &color = new Vector4(skyColor[0], skyColor[1], skyColor[2], skyColor[3]); 101 return color; 97 return this->skyColor_; 102 98 } 103 99 104 void Global Shader::changedVisibility()100 void GlobalGodrayShader::changedVisibility() 105 101 { 106 SUPER(Global Shader, changedVisibility);102 SUPER(GlobalGodrayShader, changedVisibility); 107 103 108 104 this->globalShader_.setVisible(this->isVisible()); -
code/branches/environment2/src/orxonox/graphics/GlobalGodrayShader.h
r8491 r8497 31 31 @file 32 32 33 @brief Header of the GlobalGodrayShader .33 @brief Header of the GlobalGodrayShader class. 34 34 */ 35 35 … … 42 42 #include "tools/interfaces/Tickable.h" 43 43 #include "core/BaseObject.h" 44 #include "util/Math.h" 44 45 #include "GlobalShader.h" 45 46 … … 67 68 68 69 void setSunPosition(const Vector3& position); 69 void setSkyColor(const Vector4& color);70 void setSkyColor(const ColourValue& color); 70 71 const Vector3& getSunPosition() const; 71 const Vector4& getSkyColor() const;72 const ColourValue& getSkyColor() const; 72 73 73 74 private: … … 76 77 77 78 Vector3 sunPosition_; 78 float skyColor_[4];79 ColourValue skyColor_; 79 80 float exposure_; 80 81 float decay_; -
code/branches/environment2/src/orxonox/graphics/GlobalShader.cc
r8491 r8497 38 38 CreateFactory(GlobalShader); 39 39 40 GlobalShader::GlobalShader(BaseObject* creator) : BaseObject(creator), Synchronisable(creator) ,40 GlobalShader::GlobalShader(BaseObject* creator) : BaseObject(creator), Synchronisable(creator) 41 41 { 42 42 RegisterObject(GlobalShader);
Note: See TracChangeset
for help on using the changeset viewer.