diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 1 | ||||
-rw-r--r-- | indra/newview/llenvironment.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llsettingsvo.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llsky.cpp | 55 | ||||
-rw-r--r-- | indra/newview/llsky.h | 16 |
5 files changed, 11 insertions, 73 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index f936cdc202..6231a0f432 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4954,7 +4954,6 @@ void LLAppViewer::idle() // // Update weather effects // - gSky.propagateHeavenlyBodies(gFrameDTClamped); // moves sun, moon, and planets // Update wind vector LLVector3 wind_position_region; diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp index cc3a30d0b1..1e14a0c5fb 100644 --- a/indra/newview/llenvironment.cpp +++ b/indra/newview/llenvironment.cpp @@ -379,14 +379,12 @@ F32 LLEnvironment::getWaterHeight() const bool LLEnvironment::getIsSunUp() const { - LLVector3 sunDir = mCurrentEnvironment->getSky()->getSunDirection(); - return sunDir.mV[2] > NIGHTTIME_ELEVATION_SIN; + return mCurrentEnvironment->getSky()->getIsSunUp(); } bool LLEnvironment::getIsMoonUp() const { - LLVector3 moonDir = mCurrentEnvironment->getSky()->getMoonDirection(); - return moonDir.mV[2] > NIGHTTIME_ELEVATION_SIN; + return mCurrentEnvironment->getSky()->getIsMoonUp(); } //------------------------------------------------------------------------- diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp index 804e4671ab..68513e37ac 100644 --- a/indra/newview/llsettingsvo.cpp +++ b/indra/newview/llsettingsvo.cpp @@ -464,8 +464,10 @@ LLSD LLSettingsVOSky::convertToLegacy(const LLSettingsSky::ptr_t &psky, bool isA legacy[SETTING_STAR_BRIGHTNESS] = settings[SETTING_STAR_BRIGHTNESS]; legacy[SETTING_SUNLIGHT_COLOR] = ensureArray4(settings[SETTING_SUNLIGHT_COLOR], 1.0f); +// convert to azimuth (yaw) from east and alt (pitch) from horizon +// in +x is at (north), +z up, +y right (east) LLSettingsSky::azimalt_t azialt = psky->getSunRotationAzAl(); - + legacy[SETTING_LEGACY_EAST_ANGLE] = azialt.first; legacy[SETTING_LEGACY_SUN_ANGLE] = azialt.second; @@ -480,6 +482,8 @@ void LLSettingsVOSky::updateSettings() LLVector3 sun_direction = getSunDirection(); LLVector3 moon_direction = getMoonDirection(); + // axis swap converts from +x right, +y up, +z at + // to CFR (+x at, +z up, +y right) // set direction (in CRF) and don't allow overriding LLVector3 crf_sunDirection(sun_direction.mV[2], sun_direction.mV[0], sun_direction.mV[1]); LLVector3 crf_moonDirection(moon_direction.mV[2], moon_direction.mV[0], moon_direction.mV[1]); diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index a81e74b6ed..4ad579b33f 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -74,7 +74,6 @@ LLSky::LLSky() mLightingGeneration = 0; mUpdatedThisFrame = TRUE; - mSunPhase = 0.f; } @@ -292,27 +291,6 @@ void LLSky::init(const LLVector3 &sun_direction) gSky.setFogRatio(gSavedSettings.getF32("RenderFogRatio")); - //////////////////////////// - // - // Legacy code, ignore - // - // - - // Get the parameters. - mSunDefaultPosition = gSavedSettings.getVector3("SkySunDefaultPosition"); - - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - - if (gSavedSettings.getBOOL("SkyOverrideSimSunPosition")) - { - setSunDirection(mSunDefaultPosition, -mSunDefaultPosition); - } - else - { - setSunDirection(sun_direction, -sun_direction); - } - LLGLState::checkStates(); LLGLState::checkTextureChannels(); @@ -337,39 +315,6 @@ void LLSky::setWind(const LLVector3& average_wind) } } - -void LLSky::propagateHeavenlyBodies(F32 dt) -{ -// if (!mOverrideSimSunPosition) -// { -// LLVector3 curr_dir = getSunDirection(); -// LLVector3 diff = mSunTargDir - curr_dir; -// const F32 dist = diff.normVec(); -// if (dist > 0) -// { -// const F32 step = llmin (dist, 0.00005f); -// //const F32 step = min (dist, 0.0001); -// diff *= step; -// curr_dir += diff; -// curr_dir.normVec(); -// if (mVOSkyp) -// { -// mVOSkyp->setSunDirection(curr_dir); -// } -// } -// } -} - -F32 LLSky::getSunPhase() const -{ - return mSunPhase; -} - -void LLSky::setSunPhase(const F32 phase) -{ - mSunPhase = phase; -} - ////////////////////////////////////////////////////////////////////// // Private Methods ////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llsky.h b/indra/newview/llsky.h index 27029b254b..8b4f91b7d7 100644 --- a/indra/newview/llsky.h +++ b/indra/newview/llsky.h @@ -63,8 +63,6 @@ public: void updateCull(); void updateSky(); - void propagateHeavenlyBodies(F32 dt); // dt = seconds - S32 mLightingGeneration; BOOL mUpdatedThisFrame; @@ -81,8 +79,8 @@ public: LLColor4 getTotalAmbientColor() const; BOOL sunUp() const; - F32 getSunPhase() const; - void setSunPhase(const F32 phase); + // Legacy + void setSunPhase(const F32) { } void destroyGL(); void restoreGL(); @@ -91,17 +89,11 @@ public: public: LLPointer<LLVOSky> mVOSkyp; // Pointer to the LLVOSky object (only one, ever!) LLPointer<LLVOGround> mVOGroundp; - LLPointer<LLVOWLSky> mVOWLSkyp; - // Legacy stuff - LLVector3 mSunDefaultPosition; - protected: - F32 mSunPhase; - LLColor4 mFogColor; // Color to use for fog and haze - + LLColor4 mFogColor; }; -extern LLSky gSky; +extern LLSky gSky; #endif |