diff options
Diffstat (limited to 'indra/newview/llsky.cpp')
-rw-r--r-- | indra/newview/llsky.cpp | 68 |
1 files changed, 23 insertions, 45 deletions
diff --git a/indra/newview/llsky.cpp b/indra/newview/llsky.cpp index 3ef89ba920..fb3123fd81 100644 --- a/indra/newview/llsky.cpp +++ b/indra/newview/llsky.cpp @@ -51,7 +51,6 @@ #include "llvosky.h" #include "llcubemap.h" #include "llviewercontrol.h" -#include "llenvmanager.h" #include "llvowlsky.h" @@ -77,7 +76,6 @@ LLSky::LLSky() mLightingGeneration = 0; mUpdatedThisFrame = TRUE; - mOverrideSimSunPosition = FALSE; mSunPhase = 0.f; } @@ -134,33 +132,13 @@ void LLSky::resetVertexBuffers() } } -void LLSky::setOverrideSun(BOOL override) -{ - if (!mOverrideSimSunPosition && override) - { - mLastSunDirection = getSunDirection(); - } - else if (mOverrideSimSunPosition && !override) - { - setSunDirection(mLastSunDirection, LLVector3::zero); - } - mOverrideSimSunPosition = override; -} - -void LLSky::setSunDirection(const LLVector3 &sun_direction, const LLVector3 &sun_ang_velocity) +void LLSky::setSunDirection(const LLVector3 &sun_direction, const LLVector3 &moon_direction) { if(mVOSkyp.notNull()) { - mVOSkyp->setSunDirection(sun_direction, sun_ang_velocity); + mVOSkyp->setSunDirection(sun_direction, moon_direction); } } - -void LLSky::setSunTargetDirection(const LLVector3 &sun_direction, const LLVector3 &sun_ang_velocity) -{ - mSunTargDir = sun_direction; -} - - LLVector3 LLSky::getSunDirection() const { if (mVOSkyp) @@ -328,13 +306,13 @@ void LLSky::init(const LLVector3 &sun_direction) LLGLState::checkStates(); LLGLState::checkTextureChannels(); - if (gSavedSettings.getBOOL("SkyOverrideSimSunPosition") || mOverrideSimSunPosition) + if (gSavedSettings.getBOOL("SkyOverrideSimSunPosition")) { - setSunDirection(mSunDefaultPosition, LLVector3(0.f, 0.f, 0.f)); + setSunDirection(mSunDefaultPosition, -mSunDefaultPosition); } else { - setSunDirection(sun_direction, LLVector3(0.f, 0.f, 0.f)); + setSunDirection(sun_direction, -sun_direction); } LLGLState::checkStates(); @@ -364,24 +342,24 @@ 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, LLVector3()); - } - } - } +// 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 |