00001
00032 #ifndef LL_WATER_PARAM_SET_H
00033 #define LL_WATER_PARAM_SET_H
00034
00035 #include <string>
00036 #include <map>
00037
00038 #include "v4math.h"
00039 #include "v4color.h"
00040 #include "llglslshader.h"
00041
00042 class LLFloaterWater;
00043 class LLWaterParamSet;
00044
00046 class LLWaterParamSet
00047 {
00048 friend class LLWaterParamManager;
00049
00050 public:
00051 LLString mName;
00052
00053 private:
00054
00055 LLSD mParamValues;
00056
00057 public:
00058
00059 LLWaterParamSet();
00060
00062 void update(LLGLSLShader * shader) const;
00063
00065 void setAll(const LLSD& val);
00066
00068 const LLSD& getAll();
00069
00073 void set(const char * paramName, float x);
00074
00079 void set(const char * paramName, float x, float y);
00080
00086 void set(const char * paramName, float x, float y, float z);
00087
00094 void set(const char * paramName, float x, float y, float z, float w);
00095
00099 void set(const char * paramName, const float * val);
00100
00104 void set(const char * paramName, const LLVector4 & val);
00105
00109 void set(const char * paramName, const LLColor4 & val);
00110
00114 LLVector4 getVector4(const char * paramName, bool& error);
00115
00119 LLVector3 getVector3(const char * paramName, bool& error);
00120
00124 LLVector2 getVector2(const char * paramName, bool& error);
00125
00129 F32 getFloat(const char * paramName, bool& error);
00130
00135 void mix(LLWaterParamSet& src, LLWaterParamSet& dest,
00136 F32 weight);
00137
00138 };
00139
00140 inline void LLWaterParamSet::setAll(const LLSD& val)
00141 {
00142 if(val.isMap()) {
00143 LLSD::map_const_iterator mIt = val.beginMap();
00144 for(; mIt != val.endMap(); mIt++)
00145 {
00146 mParamValues[mIt->first] = mIt->second;
00147 }
00148 }
00149 }
00150
00151 inline const LLSD& LLWaterParamSet::getAll()
00152 {
00153 return mParamValues;
00154 }
00155
00156 #endif // LL_WaterPARAM_SET_H