From c6832d25139cbe363eca755fdc74399c7f52593a Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 3 Oct 2002 19:00:01 +0000 Subject: [PATCH] Fixes from Mark Harris. --- simgear/scene/sky/clouds3d/SkyCloud.cpp | 11 +++++++---- simgear/scene/sky/clouds3d/SkyTextureState.cpp | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/simgear/scene/sky/clouds3d/SkyCloud.cpp b/simgear/scene/sky/clouds3d/SkyCloud.cpp index dedd8044..e682030c 100644 --- a/simgear/scene/sky/clouds3d/SkyCloud.cpp +++ b/simgear/scene/sky/clouds3d/SkyCloud.cpp @@ -190,11 +190,12 @@ SKYRESULT SkyCloud::Display(const Camera &camera, SkyRenderableInstance *pInstan // don't just use the camera position -- if it is too far away from the cloud, then // precision limitations may cause the STL sort to hang. Instead, put the sort position // just outside the bounding sphere of the cloud in the direction of the camera. - Vec3f vecSortPos = -cam.ViewDir(); - vecSortPos *= (1.1 * _boundingBox.GetRadius()); + _vecSortPos = -cam.ViewDir(); + _vecSortPos *= (1.1 * _boundingBox.GetRadius()); + _vecSortPos += _boundingBox.GetCenter(); // sort the particles from back to front wrt the camera position. - _SortParticles(cam.ViewDir(), vecSortPos, SKY_CLOUD_SORT_TOWARD); + _SortParticles(cam.ViewDir(), _vecSortPos, SKY_CLOUD_SORT_TOWARD); //_vecLastSortViewDir = GLVU::GetCurrent()->GetCurrentCam()->ViewDir(); //_vecLastSortCamPos = GLVU::GetCurrent()->GetCurrentCam()->Orig; @@ -292,6 +293,7 @@ SKYRESULT SkyCloud::DisplaySplit(const Camera &camera, // just outside the bounding sphere of the cloud in the direction of the camera. _vecSortPos = -cam.ViewDir(); _vecSortPos *= (1.1 * _boundingBox.GetRadius()); + _vecSortPos += _boundingBox.GetCenter(); // sort the particles from back to front wrt the camera position. _SortParticles(cam.ViewDir(), _vecSortPos, SKY_CLOUD_SORT_TOWARD); @@ -299,7 +301,8 @@ SKYRESULT SkyCloud::DisplaySplit(const Camera &camera, // we can't use the view direction optimization when the cloud is split, or we get a lot // of popping of objects in and out of cloud cover. For consistency, though, we need to update // the cached sort direction, since we just sorted the particles. - ///_vecLastSortViewDir = GLVU::GetCurrent()->GetCurrentCam()->ViewDir(); + // _vecLastSortViewDir = GLVU::GetCurrent()->GetCurrentCam()->ViewDir(); + // _vecLastSortCamPos = GLVU::GetCurrent()->GetCurrentCam()->Orig; // compute the split distance. vecCloudSpaceSplit -= _vecSortPos; diff --git a/simgear/scene/sky/clouds3d/SkyTextureState.cpp b/simgear/scene/sky/clouds3d/SkyTextureState.cpp index 16d33704..3c9b2a78 100644 --- a/simgear/scene/sky/clouds3d/SkyTextureState.cpp +++ b/simgear/scene/sky/clouds3d/SkyTextureState.cpp @@ -145,7 +145,7 @@ SKYRESULT SkyTextureState::Activate() if (pCurrent->GetTextureParameter(i, GL_TEXTURE_MAG_FILTER) != paramValue) { FAIL_RETURN(pCurrent->SetTextureParameter(i, GL_TEXTURE_MAG_FILTER, paramValue)); - glTexParameteri(eTarget, GL_TEXTURE_MIN_FILTER, paramValue); + glTexParameteri(eTarget, GL_TEXTURE_MAG_FILTER, paramValue); } //GLVU::CheckForGLError("SkyTextureState::Activate()"); } -- 2.39.5