summaryrefslogtreecommitdiff
path: root/indra/llinventory
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llinventory')
-rw-r--r--indra/llinventory/llfoldertype.cpp2
-rw-r--r--indra/llinventory/llsettingssky.cpp41
2 files changed, 23 insertions, 20 deletions
diff --git a/indra/llinventory/llfoldertype.cpp b/indra/llinventory/llfoldertype.cpp
index 067b22ee27..7241b3c0c2 100644
--- a/indra/llinventory/llfoldertype.cpp
+++ b/indra/llinventory/llfoldertype.cpp
@@ -100,7 +100,7 @@ LLFolderDictionary::LLFolderDictionary()
addEntry(LLFolderType::FT_MARKETPLACE_STOCK, new FolderEntry("stock", FALSE));
addEntry(LLFolderType::FT_MARKETPLACE_VERSION, new FolderEntry("version", FALSE));
- addEntry(LLFolderType::FT_SETTINGS, new FolderEntry("settings", FALSE));
+ addEntry(LLFolderType::FT_SETTINGS, new FolderEntry("settings", TRUE));
addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE));
};
diff --git a/indra/llinventory/llsettingssky.cpp b/indra/llinventory/llsettingssky.cpp
index 375bd7cbce..6e583f65d8 100644
--- a/indra/llinventory/llsettingssky.cpp
+++ b/indra/llinventory/llsettingssky.cpp
@@ -36,28 +36,32 @@
static const F32 NIGHTTIME_ELEVATION = -8.0f; // degrees
static const F32 NIGHTTIME_ELEVATION_SIN = (F32)sinf(NIGHTTIME_ELEVATION * DEG_TO_RAD);
-static LLQuaternion convert_azimuth_and_altitude_to_quat(F32 azimuth, F32 altitude)
-{
- F32 sinTheta = sin(azimuth);
- F32 cosTheta = cos(azimuth);
- F32 sinPhi = sin(altitude);
- F32 cosPhi = cos(altitude);
+namespace {
+ LLQuaternion convert_azimuth_and_altitude_to_quat(F32 azimuth, F32 altitude)
+ {
+ F32 sinTheta = sin(azimuth);
+ F32 cosTheta = cos(azimuth);
+ F32 sinPhi = sin(altitude);
+ F32 cosPhi = cos(altitude);
- LLVector3 dir;
- // +x right, +z up, +y at...
- dir.mV[0] = cosTheta * cosPhi;
- dir.mV[1] = sinTheta * cosPhi;
- dir.mV[2] = sinPhi;
+ LLVector3 dir;
+ // +x right, +z up, +y at...
+ dir.mV[0] = cosTheta * cosPhi;
+ dir.mV[1] = sinTheta * cosPhi;
+ dir.mV[2] = sinPhi;
- LLVector3 axis = LLVector3::x_axis % dir;
- axis.normalize();
+ LLVector3 axis = LLVector3::x_axis % dir;
+ axis.normalize();
+ if (mirror_axis)
+ axis *= -1;
- F32 angle = acos(LLVector3::x_axis * dir);
+ F32 angle = acos(LLVector3::x_axis * dir);
- LLQuaternion quat;
- quat.setAngleAxis(angle, axis);
+ LLQuaternion quat;
+ quat.setAngleAxis(angle, axis);
- return quat;
+ return quat;
+ }
}
static LLTrace::BlockTimerStatHandle FTM_BLEND_SKYVALUES("Blending Sky Environment");
@@ -794,11 +798,10 @@ LLSD LLSettingsSky::translateLegacySettings(const LLSD& legacy)
F32 altitude = legacy[SETTING_LEGACY_SUN_ANGLE].asReal();
LLQuaternion sunquat = convert_azimuth_and_altitude_to_quat(azimuth, altitude);
-
// original WL moon dir was diametrically opposed to the sun dir
LLQuaternion moonquat = convert_azimuth_and_altitude_to_quat(azimuth + F_PI, -altitude);
- newsettings[SETTING_SUN_ROTATION] = sunquat.getValue();
+ newsettings[SETTING_SUN_ROTATION] = sunquat.getValue();
newsettings[SETTING_MOON_ROTATION] = moonquat.getValue();
}