diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-05-21 19:39:52 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2019-05-21 19:39:52 +0300 |
commit | c2c8753d2565c9fba41f0d5dd390e14d72cd40b9 (patch) | |
tree | e0db4dce241e3527e98fb5ae84f4d926420e40b5 /indra/newview/llwlparamset.cpp | |
parent | 401868c440fb77b101845f1efc6ec1b1f2ef3352 (diff) |
SL-11012 Ambient setting can be missing from llsd
Diffstat (limited to 'indra/newview/llwlparamset.cpp')
-rw-r--r-- | indra/newview/llwlparamset.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp index 066cb9a0ac..cd7a32abdd 100644 --- a/indra/newview/llwlparamset.cpp +++ b/indra/newview/llwlparamset.cpp @@ -284,6 +284,11 @@ void LLWLParamSet::setEastAngle(float val) mParamValues["east_angle"] = val; } +void LLWLParamSet::setAmbient(const LLVector4& val) +{ + set("ambient", val); +} + void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight) { // set up the iterators @@ -379,6 +384,19 @@ void LLWLParamSet::mix(LLWLParamSet& src, LLWLParamSet& dest, F32 weight) setSunAngle((1 - weight) * srcSunAngle + weight * destSunAngle); setEastAngle((1 - weight) * srcEastAngle + weight * destEastAngle); + + // ambient + + LLVector4 srcAmbient = src.getAmbient(); + LLVector4 destAmbient = dest.getAmbient(); + LLVector4 rsltAmbient; + + for (int i = 0; i < LENGTHOFVECTOR4; ++i) + { + rsltAmbient.mV[i] = srcAmbient.mV[i] + ((destAmbient.mV[i] - srcAmbient.mV[i]) * weight); + } + + setAmbient(rsltAmbient); // now setup the sun properly |