summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsettingswater.h
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2017-11-30 11:32:22 -0800
committerRider Linden <rider@lindenlab.com>2017-11-30 11:32:22 -0800
commitd7dd10b88bc3fda88f6528ecc5936e4889f019f3 (patch)
tree50ace17809cc3af599bc991f3ac969ca8748c5ca /indra/llinventory/llsettingswater.h
parente947481d30b51e731947d85de45065d5b0c02e45 (diff)
Split for viewer/simhost sync LLSD with simhost.
Diffstat (limited to 'indra/llinventory/llsettingswater.h')
-rw-r--r--indra/llinventory/llsettingswater.h227
1 files changed, 227 insertions, 0 deletions
diff --git a/indra/llinventory/llsettingswater.h b/indra/llinventory/llsettingswater.h
new file mode 100644
index 0000000000..5d6a482d56
--- /dev/null
+++ b/indra/llinventory/llsettingswater.h
@@ -0,0 +1,227 @@
+/**
+* @file llsettingssky.h
+* @author optional
+* @brief A base class for asset based settings groups.
+*
+* $LicenseInfo:2011&license=viewerlgpl$
+* Second Life Viewer Source Code
+* Copyright (C) 2017, Linden Research, Inc.
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU Lesser General Public
+* License as published by the Free Software Foundation;
+* version 2.1 of the License only.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*
+* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
+* $/LicenseInfo$
+*/
+
+#ifndef LL_SETTINGS_WATER_H
+#define LL_SETTINGS_WATER_H
+
+#include "llsettingsbase.h"
+
+class LLSettingsWater : public LLSettingsBase
+{
+public:
+ static const std::string SETTING_BLUR_MULTIPILER;
+ static const std::string SETTING_FOG_COLOR;
+ static const std::string SETTING_FOG_DENSITY;
+ static const std::string SETTING_FOG_MOD;
+ static const std::string SETTING_FRESNEL_OFFSET;
+ static const std::string SETTING_FRESNEL_SCALE;
+ static const std::string SETTING_NORMAL_MAP;
+ static const std::string SETTING_NORMAL_SCALE;
+ static const std::string SETTING_SCALE_ABOVE;
+ static const std::string SETTING_SCALE_BELOW;
+ static const std::string SETTING_WAVE1_DIR;
+ static const std::string SETTING_WAVE2_DIR;
+
+ static const LLUUID DEFAULT_WATER_NORMAL_ID;
+
+ typedef boost::shared_ptr<LLSettingsWater> ptr_t;
+
+ //---------------------------------------------------------------------
+ LLSettingsWater(const LLSD &data);
+ virtual ~LLSettingsWater() { };
+
+ virtual ptr_t buildClone() = 0;
+
+ //---------------------------------------------------------------------
+ virtual std::string getSettingType() const { return std::string("water"); }
+
+ // Settings status
+ virtual void blend(const LLSettingsBase::ptr_t &end, F32 blendf);
+
+ static LLSD defaults();
+
+ //---------------------------------------------------------------------
+ F32 getBlurMultiplier() const
+ {
+ return mSettings[SETTING_BLUR_MULTIPILER].asReal();
+ }
+
+ void setBlurMultiplier(F32 val)
+ {
+ setValue(SETTING_BLUR_MULTIPILER, val);
+ }
+
+ LLColor3 getFogColor() const
+ {
+ return LLColor3(mSettings[SETTING_FOG_COLOR]);
+ }
+
+ void setFogColor(LLColor3 val)
+ {
+ setValue(SETTING_FOG_COLOR, val);
+ }
+
+ F32 getFogDensity() const
+ {
+ return mSettings[SETTING_FOG_DENSITY].asReal();
+ }
+
+ void setFogDensity(F32 val)
+ {
+ setValue(SETTING_FOG_DENSITY, val);
+ }
+
+ F32 getFogMod() const
+ {
+ return mSettings[SETTING_FOG_MOD].asReal();
+ }
+
+ void setFogMod(F32 val)
+ {
+ setValue(SETTING_FOG_MOD, val);
+ }
+
+ F32 getFresnelOffset() const
+ {
+ return mSettings[SETTING_FRESNEL_OFFSET].asReal();
+ }
+
+ void setFresnelOffset(F32 val)
+ {
+ setValue(SETTING_FRESNEL_OFFSET, val);
+ }
+
+ F32 getFresnelScale() const
+ {
+ return mSettings[SETTING_FRESNEL_SCALE].asReal();
+ }
+
+ void setFresnelScale(F32 val)
+ {
+ setValue(SETTING_FRESNEL_SCALE, val);
+ }
+
+ LLUUID getNormalMapID() const
+ {
+ return mSettings[SETTING_NORMAL_MAP].asUUID();
+ }
+
+ void setNormalMapID(LLUUID val)
+ {
+ setValue(SETTING_NORMAL_MAP, val);
+ }
+
+ LLVector3 getNormalScale() const
+ {
+ return LLVector3(mSettings[SETTING_NORMAL_SCALE]);
+ }
+
+ void setNormalScale(LLVector3 val)
+ {
+ setValue(SETTING_NORMAL_SCALE, val);
+ }
+
+ F32 getScaleAbove() const
+ {
+ return mSettings[SETTING_SCALE_ABOVE].asReal();
+ }
+
+ void setScaleAbove(F32 val)
+ {
+ setValue(SETTING_SCALE_ABOVE, val);
+ }
+
+ F32 getScaleBelow() const
+ {
+ return mSettings[SETTING_SCALE_BELOW].asReal();
+ }
+
+ void setScaleBelow(F32 val)
+ {
+ setValue(SETTING_SCALE_BELOW, val);
+ }
+
+ LLVector2 getWave1Dir() const
+ {
+ return LLVector2(mSettings[SETTING_WAVE1_DIR]);
+ }
+
+ void setWave1Dir(LLVector2 val)
+ {
+ setValue(SETTING_WAVE1_DIR, val);
+ }
+
+ LLVector2 getWave2Dir() const
+ {
+ return LLVector2(mSettings[SETTING_WAVE2_DIR]);
+ }
+
+ void setWave2Dir(LLVector2 val)
+ {
+ setValue(SETTING_WAVE2_DIR, val);
+ }
+
+ //-------------------------------------------
+ LLVector4 getWaterPlane() const
+ {
+ update();
+ return mWaterPlane;
+ }
+
+ F32 getWaterFogKS() const
+ {
+ update();
+ return mWaterFogKS;
+ }
+
+protected:
+ LLSettingsWater();
+
+ virtual validation_list_t getValidationList() const;
+
+ static LLSD translateLegacySettings(LLSD legacy);
+
+ LLVector4 mWaterPlane;
+ F32 mWaterFogKS;
+
+private:
+ static const std::string SETTING_LEGACY_BLUR_MULTIPILER;
+ static const std::string SETTING_LEGACY_FOG_COLOR;
+ static const std::string SETTING_LEGACY_FOG_DENSITY;
+ static const std::string SETTING_LEGACY_FOG_MOD;
+ static const std::string SETTING_LEGACY_FRESNEL_OFFSET;
+ static const std::string SETTING_LEGACY_FRESNEL_SCALE;
+ static const std::string SETTING_LEGACY_NORMAL_MAP;
+ static const std::string SETTING_LEGACY_NORMAL_SCALE;
+ static const std::string SETTING_LEGACY_SCALE_ABOVE;
+ static const std::string SETTING_LEGACY_SCALE_BELOW;
+ static const std::string SETTING_LEGACY_WAVE1_DIR;
+ static const std::string SETTING_LEGACY_WAVE2_DIR;
+
+};
+
+#endif