[Gcblue-commits] gcb_wx/src/graphics cspSky.cpp, 1.17, 1.18 tc3DViewer.cpp, 1.39, 1.40 tcConsoleBox
Status: Alpha
Brought to you by:
ddcforge
From: Dewitt C. <ddc...@us...> - 2006-10-24 01:34:09
|
Update of /cvsroot/gcblue/gcb_wx/src/graphics In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv8446/src/graphics Modified Files: cspSky.cpp tc3DViewer.cpp tcConsoleBox.cpp tcCreditView.cpp tcEditBox.cpp tcGameView.cpp tcMapView.cpp tcNetworkView.cpp tcScrollBar.cpp Log Message: Index: tcScrollBar.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcScrollBar.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tcScrollBar.cpp 20 Aug 2006 22:24:02 -0000 1.2 --- tcScrollBar.cpp 24 Oct 2006 01:34:04 -0000 1.3 *************** *** 174,177 **** --- 174,179 ---- autoScrollIncrement = clickScrollAmount; } + + SendRedrawMessage(); } *************** *** 190,193 **** --- 192,197 ---- autoScrollIncrement = 0; autoScroll = false; + + SendRedrawMessage(); } *************** *** 203,206 **** --- 207,212 ---- overArrowUp = false; overArrowDown = false; + + SendRedrawMessage(); } *************** *** 229,237 **** } ! if (!scrollDrag) return; ! float dy = float(pos.y - scrollDragStart.y); ! UpdateYbar(ybarStart + dy); } --- 235,246 ---- } ! if (scrollDrag) ! { ! float dy = float(pos.y - scrollDragStart.y); ! UpdateYbar(ybarStart + dy); ! } ! SendRedrawMessage(); } *************** *** 243,247 **** wxCommandEvent cmd(wxEVT_COMMAND_SCROLLBAR_UPDATED, 1); cmd.SetEventObject(this); ! cmd.m_extraLong = long(ybar * 4.0f / barFraction); --- 252,269 ---- wxCommandEvent cmd(wxEVT_COMMAND_SCROLLBAR_UPDATED, 1); cmd.SetEventObject(this); ! ! if (scrollFromBottom) ! { ! float rectHeight = float(mnHeight) - 2*float(mnWidth); ! float barHeight = barFraction*rectHeight; ! ! cmd.m_extraLong = long((rectHeight - barHeight - ybar)* 4.0f / barFraction * (float(mnHeight)/rectHeight)); ! if (cmd.m_extraLong < 0) cmd.m_extraLong = 0; ! } ! else ! { ! float rectHeight = float(mnHeight) - 2*float(mnWidth); ! cmd.m_extraLong = long(ybar * 4.0f / barFraction * (float(mnHeight)/rectHeight)); ! } *************** *** 250,253 **** --- 272,287 ---- + void tcScrollBar::SetActive(bool abActive) + { + if (barFraction >= 1.0) + { + tc3DWindow::SetActive(false); + } + else + { + tc3DWindow::SetActive(abActive); + } + } + /** * *************** *** 263,272 **** if (barFraction == val) return; barFraction = val; if (barFraction < 0.005) barFraction = 0.005; SetActive(barFraction < 1.0); ! ybar = 0; } /** --- 297,346 ---- if (barFraction == val) return; + float barFractionPrev = barFraction; + barFraction = val; if (barFraction < 0.005) barFraction = 0.005; + else if (barFraction > 1.0) barFraction = 1.0; + SetActive(barFraction < 1.0); ! ! float ybar_adjust = 0; ! if (scrollFromBottom) ! { ! float rectHeight = float(mnHeight) - 2*float(mnWidth); ! ybar_adjust = (barFractionPrev - barFraction) * rectHeight; ! } ! ! UpdateYbar(ybar + ybar_adjust); ! } ! ! void tcScrollBar::SendRedrawMessage() ! { ! if (!sendRedraw) return; ! ! wxCommandEvent cmd(wxEVT_COMMAND_BUTTON_CLICKED, ID_BUTTONREDRAW); ! cmd.SetEventObject(this); ! ! AddPendingEvent(cmd); ! } ! ! void tcScrollBar::SetScrollFromBottom(bool state) ! { ! scrollFromBottom = state; ! ! if (scrollFromBottom) ! { ! ybar = 99999.9f; ! } ! else ! { ! ybar = 0; ! } } + void tcScrollBar::SetSendRedraw(bool state) + { + sendRedraw = state; + } /** *************** *** 301,305 **** ybar = ynew; ! float ybarMax = float(mnHeight) - float(2*mnWidth) - barRect.Height(); if (ybar < 0) ybar = 0; --- 375,379 ---- ybar = ynew; ! float ybarMax = (float(mnHeight) - float(2*mnWidth))*(1.0-barFraction); if (ybar < 0) ybar = 0; *************** *** 323,327 **** scrollDrag(false), backgroundAlpha(0.8f), ! barFraction(1.1f), ybar(0), lastybar(9999.9f), --- 397,401 ---- scrollDrag(false), backgroundAlpha(0.8f), ! barFraction(1.234f), ybar(0), lastybar(9999.9f), *************** *** 329,333 **** autoScroll(false), autoScrollIncrement(0), ! buttonDownTime(0) { LoadImages(); --- 403,410 ---- autoScroll(false), autoScrollIncrement(0), ! buttonDownTime(0), ! sendRedraw(false), ! scrollFromBottom(false), ! barRect(0, 0, 0, 0) { LoadImages(); Index: tcNetworkView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcNetworkView.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** tcNetworkView.cpp 21 Apr 2006 23:29:09 -0000 1.13 --- tcNetworkView.cpp 24 Oct 2006 01:34:04 -0000 1.14 *************** *** 36,39 **** --- 36,40 ---- #include "common/tcOptions.h" #include "tcUserInfo.h" + #include "ai/Blackboard.h" *************** *** 82,97 **** x = (float)statusBoxBounds.x + 10.0f; ! const std::list<int>& connectionList = tcMultiplayerInterface::Get()->GetConnectionList(); ! std::list<int>::const_iterator iter = connectionList.begin(); ! for ( ; iter != connectionList.end(); ++iter) { ! y += 14.0f; ! std::string connectionStatus = tcMultiplayerInterface::Get()->GetConnectionStatus(*iter); DrawTextR(connectionStatus.c_str(), x, y, defaultFont.get(), color, 14.0f, LEFT_CENTER); ! } ! wxString s = wxString::Format("Max update: %d", tcMultiplayerInterface::Get()->updateCount); DrawTextR(s.c_str(), x, (float)statusBoxBounds.y - 15.0f, defaultFont.get(), color, 12.0f, LEFT_CENTER); --- 83,110 ---- x = (float)statusBoxBounds.x + 10.0f; ! tcMultiplayerInterface* mp = tcMultiplayerInterface::Get(); ! if (!mp->IsConnecting()) { ! const std::list<int>& connectionList = tcMultiplayerInterface::Get()->GetConnectionList(); ! std::list<int>::const_iterator iter = connectionList.begin(); ! for ( ; iter != connectionList.end(); ++iter) ! { ! y += 14.0f; ! std::string connectionStatus = mp->GetConnectionStatus(*iter); ! ! DrawTextR(connectionStatus.c_str(), x, y, defaultFont.get(), color, 14.0f, ! LEFT_CENTER); ! } ! } ! else ! { ! y += 14.0f; ! std::string connectionStatus = mp->GetConnectionStatus(0); DrawTextR(connectionStatus.c_str(), x, y, defaultFont.get(), color, 14.0f, LEFT_CENTER); ! } ! wxString s = wxString::Format("Max update: %d", mp->updateCount); DrawTextR(s.c_str(), x, (float)statusBoxBounds.y - 15.0f, defaultFont.get(), color, 12.0f, LEFT_CENTER); *************** *** 241,244 **** --- 254,258 ---- tcMultiplayerInterface::Get()->Reset(); tcSimState::Get()->SetMultiplayerOff(); + ai::Blackboard::SetMultiplayerClientMode(false); } else if (tcMultiplayerInterface::Get()->GetNumConnections() > 0) *************** *** 251,254 **** --- 265,269 ---- tcMultiplayerInterface::Get()->MakeClient(); tcSimState::Get()->SetMultiplayerClient(); + ai::Blackboard::SetMultiplayerClientMode(true); } else if (mode == MULTIPLAYER_SERVER) *************** *** 257,260 **** --- 272,276 ---- tcSimState::Get()->SetMultiplayerServer(); tcUserInfo::Get()->SetScore(10.0e6); // set high score for high server "rank" + ai::Blackboard::SetMultiplayerClientMode(false); } else Index: tcCreditView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcCreditView.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcCreditView.cpp 17 Aug 2006 01:28:04 -0000 1.21 --- tcCreditView.cpp 24 Oct 2006 01:34:04 -0000 1.22 *************** *** 81,86 **** s = "Urwumpe"; ! AddCredit(s, 60.0f, 1); --- 81,88 ---- s = "Urwumpe"; ! AddCredit(s, 25.0f, 1); + s = "Ryan Crierie"; + AddCredit(s, 60.0f, 1); Index: cspSky.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/cspSky.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** cspSky.cpp 23 Mar 2006 01:11:02 -0000 1.17 --- cspSky.cpp 24 Oct 2006 01:34:03 -0000 1.18 *************** *** 333,338 **** float specular_scale = 1.0; float diffuse_scale = 1.0; ! float ambient = background; ! if (ambient > 0.1) ambient = 0.1; // the sky shading at the sun's position is too blue when the sun --- 333,338 ---- float specular_scale = 1.0; float diffuse_scale = 1.0; ! float ambient = 2*background; ! if (ambient > 0.25) ambient = 0.25; // the sky shading at the sun's position is too blue when the sun Index: tcMapView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcMapView.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** tcMapView.cpp 1 Oct 2006 21:07:40 -0000 1.50 --- tcMapView.cpp 24 Oct 2006 01:34:04 -0000 1.51 *************** *** 725,740 **** // update symbology selection ! // 0 - 2525, 1 - NTDS computer, 2 - NTDS image if (mpOptions->symbologyType == 0) { meSymbology = M2525; } - else if (mpOptions->symbologyType == 1) - { - meSymbology = NTDS; - } else { ! meSymbology = NTDS_IMAGE; } --- 725,736 ---- // update symbology selection ! // 0 - 2525, 1 - NTDS if (mpOptions->symbologyType == 0) { meSymbology = M2525; } else { ! meSymbology = NTDS; } *************** *** 1809,1819 **** break; } ! if (symbolArray == 0) { maSymbolB[nAffiliation][nSymbol] = pSymbol; } ! else { ! maSymbolC[nAffiliation][nSymbol] = pSymbol; } } --- 1805,1815 ---- break; } ! if (symbolArray == 0) // m2525 { maSymbolB[nAffiliation][nSymbol] = pSymbol; } ! else // ntds { ! maSymbolA[nAffiliation][nSymbol] = pSymbol; } } *************** *** 1852,1864 **** maSymbolB_fade[nAffiliation][nSymbol] = fadedB; } - { - osg::Geometry* fadedC = new osg::Geometry(*maSymbolC[nAffiliation][nSymbol]); - osg::Vec4Array* colors = new osg::Vec4Array; - colors->push_back(osg::Vec4(0.4, 0.4, 0.4, 1.0)); - fadedC->setColorArray(colors); - fadedC->setColorBinding(osg::Geometry::BIND_OVERALL); - maSymbolC_fade[nAffiliation][nSymbol] = fadedC; - } { --- 1848,1852 ---- *************** *** 1882,1894 **** maSymbolB_alt[nAffiliation][nSymbol] = altB; } - { - osg::Geometry* altC = new osg::Geometry(*maSymbolC[nAffiliation][nSymbol]); - osg::Vec4Array* colors = new osg::Vec4Array; - colors->push_back(osg::Vec4(0.6, 0.6, 0.8, 1.0)); - altC->setColorArray(colors); - altC->setColorBinding(osg::Geometry::BIND_OVERALL); - - maSymbolC_alt[nAffiliation][nSymbol] = altC; - } } --- 1870,1873 ---- *************** *** 1914,1925 **** return maSymbolA[nAffilIdx][nSymbolIdx].get(); } ! else if (meSymbology == M2525) { return maSymbolB[nAffilIdx][nSymbolIdx].get(); } - else - { - return maSymbolC[nAffilIdx][nSymbolIdx].get(); - } } --- 1893,1900 ---- return maSymbolA[nAffilIdx][nSymbolIdx].get(); } ! else // (meSymbology == M2525) { return maSymbolB[nAffilIdx][nSymbolIdx].get(); } } *************** *** 1938,1949 **** return maSymbolA_alt[nAffilIdx][nSymbolIdx].get(); } ! else if (meSymbology == M2525) { return maSymbolB_alt[nAffilIdx][nSymbolIdx].get(); } - else - { - return maSymbolC_alt[nAffilIdx][nSymbolIdx].get(); - } } --- 1913,1920 ---- return maSymbolA_alt[nAffilIdx][nSymbolIdx].get(); } ! else // (meSymbology == M2525) { return maSymbolB_alt[nAffilIdx][nSymbolIdx].get(); } } *************** *** 1962,1973 **** return maSymbolA_fade[nAffilIdx][nSymbolIdx].get(); } ! else if (meSymbology == M2525) { return maSymbolB_fade[nAffilIdx][nSymbolIdx].get(); } - else - { - return maSymbolC_fade[nAffilIdx][nSymbolIdx].get(); - } } --- 1933,1940 ---- return maSymbolA_fade[nAffilIdx][nSymbolIdx].get(); } ! else // (meSymbology == M2525) { return maSymbolB_fade[nAffilIdx][nSymbolIdx].get(); } } *************** *** 3031,3043 **** if (hookedId.size() == 0) return; ! tcGameObject* obj = tcSimState::Get()->GetObject(hookedId[0]); ! if (obj == 0) return; ! ! tcPoint pos(obj->mcKin.mfLon_rad, obj->mcKin.mfLat_rad); ! if (!PointInView(pos)) { ! tcPoint screen = GeoToScreen(pos); ! SetViewCenterZoom(wxPoint(screen.x, screen.y), 1.0); } } --- 2998,3017 ---- if (hookedId.size() == 0) return; ! tcSensorMapTrack track; ! if (tcSimState::Get()->GetTrack(hookedId[0], tcUserInfo::Get()->GetOwnAlliance(), track)) { ! tcPoint pos(track.mfLon_rad, track.mfLat_rad); ! if (!PointInView(pos)) ! { ! tcPoint screen = GeoToScreen(pos); ! SetViewCenterZoom(wxPoint(screen.x, screen.y), 1.0); ! } ! } ! else ! { ! return; // hookedId doesn't exist (friendly) or not found in sensor map (other) } + + } Index: tcGameView.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcGameView.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** tcGameView.cpp 17 Aug 2006 01:28:04 -0000 1.20 --- tcGameView.cpp 24 Oct 2006 01:34:04 -0000 1.21 *************** *** 485,489 **** AddTruthTracks(nOwnAlliance, nMapObj, nWorldMapObj, FRIENDLY); ! if ((nViewMode < 2) || (tcGameObject::IsEditMode())) { AddTruthTracks(nOtherAlliance, nMapObj, nWorldMapObj, HOSTILE); --- 485,489 ---- AddTruthTracks(nOwnAlliance, nMapObj, nWorldMapObj, FRIENDLY); ! if ((nViewMode < 2) || (tcGameObject::IsEditMode()) || mpSS->IsMultiplayerServer()) { AddTruthTracks(nOtherAlliance, nMapObj, nWorldMapObj, HOSTILE); Index: tcConsoleBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcConsoleBox.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tcConsoleBox.cpp 23 Mar 2006 01:11:02 -0000 1.17 --- tcConsoleBox.cpp 24 Oct 2006 01:34:04 -0000 1.18 *************** *** 26,29 **** --- 26,31 ---- #include "AError.h" #include "common/tinyxml.h" + #include "tcScrollBar.h" + #include "wxcommands.h" #include <stdio.h> #include <iostream> *************** *** 33,36 **** --- 35,44 ---- #endif + + BEGIN_EVENT_TABLE(tcConsoleBox, tc3DWindow) + EVT_COMMAND(-1, wxEVT_COMMAND_SCROLLBAR_UPDATED, tcConsoleBox::OnScrollbarUpdated) + EVT_COMMAND(ID_BUTTONREDRAW, wxEVT_COMMAND_BUTTON_CLICKED, tcConsoleBox::OnChildRedraw) + END_EVENT_TABLE() + using std::min; using std::max; *************** *** 38,41 **** --- 46,54 ---- + void tcConsoleBox::OnChildRedraw(wxCommandEvent& event) + { + forceRedraw = true; + } + /** * Catch key events to scroll buffer *************** *** 141,144 **** --- 154,169 ---- redraw = true; + + // update scroll bar parameters + size_t nLines = textArray.GetCount(); + float barFraction = 123.4f; + + if (nLines > 0) + { + barFraction = float(mnHeight - 35) / float(nlinespace*nLines); + } + + scrollBar->SetBarFraction(barFraction); + return 0; } *************** *** 211,214 **** --- 236,241 ---- redraw = false; + DrawChildren(); + HideUnusedObjects(); } *************** *** 285,288 **** --- 312,325 ---- } + + void tcConsoleBox::OnScrollbarUpdated(wxCommandEvent& event) + { + yOffset = 0.25 * float(event.m_extraLong); + + float maxLines = float(mnHeight) / float(nlinespace); + unsigned int offset = floorf(yOffset / maxLines); + SetLineOffset(offset); + } + /** * Scroll displayed lines of buffer history *************** *** 302,305 **** --- 339,343 ---- } + void tcConsoleBox::SetLineOffset(unsigned int offset) { *************** *** 393,396 **** --- 431,441 ---- InitFromXml(config); + int scrollBarWidth = 12; + scrollBar = new tcScrollBar(this, wxPoint(mnWidth-scrollBarWidth, 0), wxSize(scrollBarWidth, mnHeight)); + scrollBar->SetBackgroundAlpha(0.3f); + scrollBar->SetSendRedraw(true); + scrollBar->SetScrollFromBottom(true); + scrollBar->SetBarFraction(1.0); + } Index: tcEditBox.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tcEditBox.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tcEditBox.cpp 23 Mar 2006 01:11:02 -0000 1.15 --- tcEditBox.cpp 24 Oct 2006 01:34:04 -0000 1.16 *************** *** 144,147 **** --- 144,149 ---- } } + + ReleaseMouse(); } else if (keycode == WXK_BACK) *************** *** 173,176 **** --- 175,180 ---- else if (keycode == WXK_ESCAPE) { + ReleaseMouse(); + wxASSERT(GetParent()); GetParent()->SetFocus(); *************** *** 219,222 **** --- 223,239 ---- void tcEditBox::OnLButtonDown(wxMouseEvent& event) { + wxPoint pos = event.GetPosition(); + + wxRect bounds(0, 0, mnWidth, mnHeight); + bool clickedInWindow = bounds.Inside(pos); + + if (clickedInWindow) + { + CaptureMouse(); + } + else + { + ReleaseMouse(); + } } Index: tc3DViewer.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/graphics/tc3DViewer.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** tc3DViewer.cpp 1 Oct 2006 21:07:40 -0000 1.39 --- tc3DViewer.cpp 24 Oct 2006 01:34:04 -0000 1.40 *************** *** 534,537 **** --- 534,539 ---- wxASSERT(foggedObjects.valid()); + fogMode = mode; + osg::StateSet* fogState = foggedObjects->getOrCreateStateSet(); osg::Fog* fog = dynamic_cast<osg::Fog*>(fogState->getAttribute(osg::StateAttribute::FOG)); *************** *** 552,558 **** } - osg::Vec4 airFog(0.6f, 0.7f, 0.8f, 1.0f); - osg::Vec4 waterFog(0.1f, 0.2f, 0.3f, 1.0f); - fogState->setMode(GL_FOG, osg::StateAttribute::ON); --- 554,557 ---- *************** *** 912,915 **** --- 911,915 ---- osg::StateSet *terrainState = terrainNode->getOrCreateStateSet(); terrainState->setMode(GL_LIGHTING, osg::StateAttribute::ON); + terrainState->setMode(GL_FOG, osg::StateAttribute::ON); terrainState->setMode(GL_CULL_FACE, osg::StateAttribute::OFF); *************** *** 927,931 **** skyTransform = new osg::PositionAttitudeTransform; - skyTransform->setCullingActive(false); CreateSky(); --- 927,930 ---- *************** *** 935,938 **** --- 934,939 ---- skyTransform->addChild(sky.get()); + skyTransform->setCullingActive(false); + foggedObjects->addChild(worldObjects.get()); foggedObjects->addChild(terrainNode.get()); *************** *** 942,946 **** rootnode->addChild(foggedObjects.get()); ! //rootnodeFar->addChild(skyTransform.get()); --- 943,949 ---- rootnode->addChild(foggedObjects.get()); ! ! //rootnode->addChild(sky2.get()); ! //rootnodeFar->addChild(skyTransform.get()); *************** *** 991,994 **** --- 994,1014 ---- skyLights->addChild(pSunLightSource); skyLights->addChild(pMoonLightSource); + + waterLights = new osg::Group; + osg::Light* waterLight = new osg::Light; + osg::LightSource* waterLightSource = new osg::LightSource; + waterLightSource->setLight(waterLight); + waterLightSource->setLocalStateSetModes(osg::StateAttribute::ON); + waterLightSource->setStateSetModes(*globalStateSet, osg::StateAttribute::ON); // why? + waterLights->addChild(waterLightSource); + + //sky2 = new osgEphemeris::EphemerisModel; + //sky2->setSkyDomeRadius(10000.0); + //sky2->setSkyDomeCenter(osg::Vec3(0, 0, 0)); + //sky2->setCullingActive(false); + //sky2->setSunLightNum(2); + //sky2->setMoonLightNum(3); + + } *************** *** 1237,1250 **** } ! //osg::Group* terrainRoot = (useFarSceneView) ? rootnodeFar.get() : rootnode.get(); ! osg::Group* terrainRoot = rootnode.get(); // workaround for sky issue, deactivate sky when camera underwater ! if (cameraPosition._v[2] < -1.0+10e3) { if (skyTransform->getNumParents()) { terrainRoot->removeChild(skyTransform.get()); ! // SetFogMode(FOG_WATER); } } --- 1257,1271 ---- } ! osg::Group* terrainRoot = (useFarSceneView) ? rootnodeFar.get() : rootnode.get(); ! //osg::Group* terrainRoot = rootnode.get(); // workaround for sky issue, deactivate sky when camera underwater ! if (cameraPosition._v[2] <= -1.0) { if (skyTransform->getNumParents()) { terrainRoot->removeChild(skyTransform.get()); ! SetFogMode(FOG_WATER); ! //terrainRoot->addChild(waterLights.get()); } } *************** *** 1255,1258 **** --- 1276,1280 ---- terrainRoot->addChild(skyTransform.get()); SetFogMode(FOG_AIR); + //terrainRoot->removeChild(waterLights.get()); } } *************** *** 1420,1424 **** void tc3DViewer::UpdateSky(DateZulu& dateZulu) { ! sky->update(latOrigin_rad, lonOrigin_rad, dateZulu); } --- 1442,1450 ---- void tc3DViewer::UpdateSky(DateZulu& dateZulu) { ! sky->update(latOrigin_rad, lonOrigin_rad, dateZulu); ! ! airFog = sky->getHorizonColor(0); ! ! SetFogMode(fogMode); // to update fog color } *************** *** 1895,1900 **** osg::ref_ptr<osg::Node> terrainNode = terrainManager->GetTerrainNode().get(); ! //osg::Group* terrainRoot = (useFarSceneView) ? rootnodeFar.get() : rootnode.get(); ! osg::Group* terrainRoot = rootnode.get(); wxASSERT(terrainRoot); --- 1921,1926 ---- osg::ref_ptr<osg::Node> terrainNode = terrainManager->GetTerrainNode().get(); ! osg::Group* terrainRoot = (useFarSceneView) ? rootnodeFar.get() : rootnode.get(); ! //osg::Group* terrainRoot = rootnode.get(); wxASSERT(terrainRoot); *************** *** 2227,2231 **** cameraSpinRate(0), lastSpinCount(0), ! isBorderActive(false) { glCanvas = parent; --- 2253,2260 ---- cameraSpinRate(0), lastSpinCount(0), ! isBorderActive(false), ! airFog(0.6f, 0.7f, 0.8f, 1.0f), ! waterFog(0.1f, 0.2f, 0.3f, 1.0f), ! fogMode(FOG_AIR) { glCanvas = parent; *************** *** 2325,2331 **** if (useFarSceneView) { ! //rootnodeFar = new osg::Group; ! //rootnodeFar->addChild(rootnode.get()); ! sceneViewFar->setSceneData(rootnode.get()); } --- 2354,2360 ---- if (useFarSceneView) { ! rootnodeFar = new osg::Group; ! rootnodeFar->addChild(rootnode.get()); ! sceneViewFar->setSceneData(rootnodeFar.get()); } |